diff --git a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp index f15c0df..e128f2e 100644 --- a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp +++ b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp @@ -979,7 +979,7 @@ fs_instruction_scheduler::calculate_deps() * After register allocation, reg_offsets are gone and we track individual * GRF registers. */ - schedule_node *last_grf_write[grf_count * 16]; + schedule_node **last_grf_write; schedule_node *last_mrf_write[BRW_MAX_MRF(v->devinfo->gen)]; schedule_node *last_conditional_mod[4] = {}; schedule_node *last_accumulator_write = NULL; @@ -990,7 +990,7 @@ fs_instruction_scheduler::calculate_deps() */ schedule_node *last_fixed_grf_write = NULL; - memset(last_grf_write, 0, sizeof(last_grf_write)); + last_grf_write = (schedule_node **)calloc(grf_count * 16, sizeof(schedule_node)); memset(last_mrf_write, 0, sizeof(last_mrf_write)); /* top-to-bottom dependencies: RAW and WAW. */ @@ -1114,7 +1114,7 @@ fs_instruction_scheduler::calculate_deps() } /* bottom-to-top dependencies: WAR */ - memset(last_grf_write, 0, sizeof(last_grf_write)); + memset(last_grf_write, 0, grf_count * 16 * sizeof(schedule_node)); memset(last_mrf_write, 0, sizeof(last_mrf_write)); memset(last_conditional_mod, 0, sizeof(last_conditional_mod)); last_accumulator_write = NULL; @@ -1228,6 +1228,8 @@ fs_instruction_scheduler::calculate_deps() last_accumulator_write = n; } } + + free(last_grf_write); } static bool