Mesa (master): i965: added texture unit sanity check

Brian Paul brianp at kemper.freedesktop.org
Wed Aug 26 18:09:21 UTC 2009


Module: Mesa
Branch: master
Commit: af7315e58b8bfe230f7b4c5a8d5b669d67aab9f0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=af7315e58b8bfe230f7b4c5a8d5b669d67aab9f0

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Aug 26 12:07:52 2009 -0600

i965: added texture unit sanity check

Check that all the textures needed by the current fragment program
actually exist and are valid.

---

 src/mesa/drivers/dri/i965/brw_state_upload.c |   13 +++++++++++++
 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 95d42d2..414620d 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);
+      }
+   }
 }
 
 




More information about the mesa-commit mailing list