i965: more register number assertions
authorBrian Paul <brianp@vmware.com>
Fri, 13 Mar 2009 15:17:30 +0000 (09:17 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 13 Mar 2009 15:23:44 +0000 (09:23 -0600)
src/mesa/drivers/dri/i965/brw_eu.h

index b15e8403ccb33c94001ec4a81a66b130d8636d9e..eb99c21711ed44b82d4ddddf53ec9fffb9fa6147 100644 (file)
@@ -170,6 +170,13 @@ static INLINE struct brw_reg brw_reg( GLuint file,
                                       GLuint writemask )
 {
    struct brw_reg reg;
+   if (type == BRW_GENERAL_REGISTER_FILE)
+      assert(nr < 128);
+   else if (type == BRW_MESSAGE_REGISTER_FILE)
+      assert(nr < 9);
+   else if (type == BRW_ARCHITECTURE_REGISTER_FILE)
+      assert(nr <= BRW_ARF_IP);
+
    reg.type = type;
    reg.file = file;
    reg.nr = nr;