From: Brian Paul Date: Wed, 26 Aug 2009 18:07:52 +0000 (-0600) Subject: i965: added texture unit sanity check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=af7315e58b8bfe230f7b4c5a8d5b669d67aab9f0;p=mesa.git i965: added texture unit sanity check Check that all the textures needed by the current fragment program actually exist and are valid. --- diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 95d42d2dcc5..414620d0b39 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); + } + } }