i965g: some more cases where file_max[] is used without obligatory +1
authorKeith Whitwell <keithw@vmware.com>
Fri, 6 Nov 2009 23:34:33 +0000 (23:34 +0000)
committerKeith Whitwell <keithw@vmware.com>
Thu, 12 Nov 2009 02:51:57 +0000 (18:51 -0800)
src/gallium/drivers/i965/brw_vs_emit.c

index e0fadc8dce70b38eae55cea7bb4f5e7fe4c355c4..26f0ec5a11a731bea153c65a91818fc880d30f39 100644 (file)
@@ -82,15 +82,15 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c )
     * works if everything fits in the GRF.
     * XXX this heuristic/check may need some fine tuning...
     */
-   if (c->vp->info.file_max[TGSI_FILE_CONSTANT] +
-       c->vp->info.file_max[TGSI_FILE_IMMEDIATE] +
-       c->vp->info.file_max[TGSI_FILE_TEMPORARY] + 21 > BRW_MAX_GRF)
+   if (c->vp->info.file_max[TGSI_FILE_CONSTANT] + 1 +
+       c->vp->info.file_max[TGSI_FILE_IMMEDIATE] + 1 +
+       c->vp->info.file_max[TGSI_FILE_TEMPORARY] + 1 + 21 > BRW_MAX_GRF)
       c->vp->use_const_buffer = GL_TRUE;
    else {
       /* XXX: immediates can go elsewhere if necessary:
        */
-      assert(c->vp->info.file_max[TGSI_FILE_IMMEDIATE] +
-            c->vp->info.file_max[TGSI_FILE_TEMPORARY] + 21 <= BRW_MAX_GRF);
+      assert(c->vp->info.file_max[TGSI_FILE_IMMEDIATE] + 1 +
+            c->vp->info.file_max[TGSI_FILE_TEMPORARY] + 1 + 21 <= BRW_MAX_GRF);
 
       c->vp->use_const_buffer = GL_FALSE;
    }