r300: Swtcl prediction was still missing scissors.
authorPauli Nieminen <suokkos@gmail.com>
Sat, 29 Aug 2009 18:00:21 +0000 (21:00 +0300)
committerPauli Nieminen <suokkos@gmail.com>
Sat, 29 Aug 2009 18:05:19 +0000 (21:05 +0300)
All that state stuff should really be in state atoms :/

src/mesa/drivers/dri/r300/r300_swtcl.c

index 45dfbf26e6aaa9060ecd274e75b82abb8733ec28..b3793e28d58f2e6f33ef2a70d1f1217711a29891 100644 (file)
@@ -249,10 +249,11 @@ static void r300_predict_emit_size( r300ContextPtr rmesa )
                const int prim_size = 3;
                const int cache_flush_size = 4;
                const int pre_emit_state = 4;
+               const int scissor_size = 3;
                const int state_size = radeonCountStateEmitSize(&rmesa->radeon);
 
                if (rcommonEnsureCmdBufSpace(&rmesa->radeon,
-                                       state_size + pre_emit_state
+                                       state_size + pre_emit_state + scissor_size
                                        + vertex_size + prim_size + cache_flush_size * 2,
                                        __FUNCTION__))
                        rmesa->radeon.swtcl.emit_prediction = radeonCountStateEmitSize(&rmesa->radeon);
@@ -260,7 +261,7 @@ static void r300_predict_emit_size( r300ContextPtr rmesa )
                        rmesa->radeon.swtcl.emit_prediction = state_size;
 
                rmesa->radeon.swtcl.emit_prediction += rmesa->radeon.cmdbuf.cs->cdw
-                       + vertex_size + prim_size + cache_flush_size * 2 + pre_emit_state;
+                       + vertex_size + scissor_size + prim_size + cache_flush_size * 2 + pre_emit_state;
        }
 }