From 705c8247fa0eb50587b6c19561eb31e4d3a1b876 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 12 Mar 2013 21:09:35 -0700 Subject: [PATCH] i965: Remove now dead brw_wm_prog_key::proj_attrib_mask field. The previous commit removed the last user of this field, so there's no longer any point in setting it. Removing this should eliminate state-dependent recompiles, and make the precompile more reliable. Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/brw_fs.cpp | 12 ------------ src/mesa/drivers/dri/i965/brw_wm.c | 15 --------------- src/mesa/drivers/dri/i965/brw_wm.h | 2 -- 3 files changed, 29 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 1dc08bfec50..c12ba4571a9 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2972,15 +2972,6 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog) key.iz_lookup |= IZ_DEPTH_WRITE_ENABLE_BIT; } - if (prog->Name != 0) - key.proj_attrib_mask = ~(GLbitfield64) 0; - else { - /* Bit VARYING_BIT_POS of key.proj_attrib_mask is never used, so to - * avoid unnecessary recompiles, always set it to 1. - */ - key.proj_attrib_mask |= VARYING_BIT_POS; - } - if (intel->gen < 6) key.input_slots_valid |= BITFIELD64_BIT(VARYING_SLOT_POS); @@ -2988,9 +2979,6 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog) if (!(fp->Base.InputsRead & BITFIELD64_BIT(i))) continue; - if (prog->Name == 0) - key.proj_attrib_mask |= BITFIELD64_BIT(i); - if (intel->gen < 6) { if (_mesa_varying_slot_in_fs((gl_varying_slot) i)) key.input_slots_valid |= BITFIELD64_BIT(i); diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 895619abee5..35d6876edc8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -285,8 +285,6 @@ brw_wm_debug_recompile(struct brw_context *brw, old_key->clamp_fragment_color, key->clamp_fragment_color); found |= key_debug(intel, "line smoothing", old_key->line_aa, key->line_aa); - found |= key_debug(intel, "proj_attrib_mask", - old_key->proj_attrib_mask, key->proj_attrib_mask); found |= key_debug(intel, "renderbuffer height", old_key->drawable_height, key->drawable_height); found |= key_debug(intel, "input slots valid", @@ -423,19 +421,6 @@ static void brw_wm_populate_key( struct brw_context *brw, if (intel->gen < 6) key->stats_wm = brw->intel.stats_wm; - /* BRW_NEW_WM_INPUT_DIMENSIONS */ - /* Only set this for fixed function. The optimization it enables isn't - * useful for programs using shaders. - */ - if (ctx->Shader.CurrentFragmentProgram) - key->proj_attrib_mask = ~(GLbitfield64) 0; - else { - /* Bit VARYING_BIT_POS of key.proj_attrib_mask is never used, so to - * avoid unnecessary recompiles, always set it to 1. - */ - key->proj_attrib_mask = brw->wm.input_size_masks[4-1] | VARYING_BIT_POS; - } - /* _NEW_LIGHT */ key->flat_shade = (ctx->Light.ShadeModel == GL_FLAT); diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index f43d42c4b10..28e87344364 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -67,8 +67,6 @@ struct brw_wm_prog_key { GLuint clamp_fragment_color:1; GLuint line_aa:2; - GLbitfield64 proj_attrib_mask; /**< one bit per fragment program attribute */ - GLushort drawable_height; GLbitfield64 input_slots_valid; GLuint program_string_id:32; -- 2.30.2