[Mesa-dev] [PATCH 29/33] i965: Remove some old texturing debug code.

Eric Anholt eric at anholt.net
Mon Oct 24 14:17:16 PDT 2011


It caught one possible bug I recall in my time working on the driver,
and we haven't been setting it for non-fixed-function since the new FS
backend came along.  The bug it caught was likely a confusion about
sampler mappings, which we have tests for these days.
---
 src/mesa/drivers/dri/i965/brw_context.h      |    3 ---
 src/mesa/drivers/dri/i965/brw_state_upload.c |   13 -------------
 src/mesa/drivers/dri/i965/brw_wm_fp.c        |    5 -----
 3 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 526a4df..7886766 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -227,9 +227,6 @@ struct brw_vertex_program {
 struct brw_fragment_program {
    struct gl_fragment_program program;
    GLuint id;  /**< serial no. to identify frag progs, never re-used */
-
-   /** for debugging, which texture units are referenced */
-   GLbitfield tex_units_used;
 };
 
 struct brw_shader {
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 4d95f78..3479dfc 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -469,19 +469,6 @@ void brw_validate_state( struct brw_context *brw )
    }
 
    intel_check_front_buffer_rendering(intel);
-
-   /* Make sure that the textures which are referenced by the current
-    * brw fragment program are actually present/valid.
-    * If this fails, we can experience GPU lock-ups.
-    */
-   {
-      const struct brw_fragment_program *fp;
-      fp = brw_fragment_program_const(brw->fragment_program);
-      if (fp) {
-         assert((fp->tex_units_used & ctx->Texture._EnabledUnits)
-                == fp->tex_units_used);
-      }
-   }
 }
 
 
diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c
index 6c9a38e..ec2bf3c 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_fp.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c
@@ -215,10 +215,6 @@ static struct prog_instruction * emit_tex_op(struct brw_wm_compile *c,
    assert(tex_src_target < NUM_TEXTURE_TARGETS ||
           tex_src_target == TEX_TARGET_NONE);
 
-   /* update mask of which texture units are referenced by this program */
-   if (tex_src_unit != TEX_UNIT_NONE)
-      c->fp->tex_units_used |= (1 << tex_src_unit);
-
    memset(inst, 0, sizeof(*inst));
 
    inst->Opcode = op;
@@ -1066,7 +1062,6 @@ void brw_wm_pass_fp( struct brw_wm_compile *c )
    }
    c->pixel_w = src_undef();
    c->nr_fp_insns = 0;
-   c->fp->tex_units_used = 0x0;
 
    /* Emit preamble instructions.  This is where special instructions such as
     * WM_CINTERP, WM_LINTERP, WM_PINTERP and WM_WPOSXY are emitted to
-- 
1.7.7



More information about the mesa-dev mailing list