summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-08-26 12:07:52 -0600
committerBrian Paul <brianp@vmware.com>2009-08-26 12:08:23 -0600
commitaf7315e58b8bfe230f7b4c5a8d5b669d67aab9f0 (patch)
tree3d8a13e7a06fdf0995ce3a30481e6630bee83686 /src/mesa/drivers/dri/i965
parent34da6024e3097684110cd1fd4da0f25adc415cd6 (diff)
i965: added texture unit sanity check
Check that all the textures needed by the current fragment program actually exist and are valid.
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_upload.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 95d42d2dcc..414620d0b3 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -322,6 +322,19 @@ void brw_validate_state( struct brw_context *brw )
}
}
}
+
+ /* 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);
+ }
+ }
}