r200: emit max vtx info for index buffer.
authorDave Airlie <airlied@redhat.com>
Tue, 1 Sep 2009 00:12:20 +0000 (10:12 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 1 Sep 2009 00:50:31 +0000 (10:50 +1000)
We need this for the CS bounds checking.

src/mesa/drivers/dri/r200/r200_cmdbuf.c
src/mesa/drivers/dri/r200/r200_ioctl.h
src/mesa/drivers/dri/r200/r200_tcl.c

index 7d0df5519d1293c2d9286b4a0911c81db5e32a3c..1d1bea6f5f7fcfe67d7fea0606fd71e5e4b3627b 100644 (file)
@@ -225,7 +225,17 @@ GLushort *r200AllocEltsOpenEnded( r200ContextPtr rmesa,
    return retval;
 }
 
+void r200EmitMaxVtxIndex(r200ContextPtr rmesa, int count)
+{
+   BATCH_LOCALS(&rmesa->radeon);
 
+   if (rmesa->radeon.radeonScreen->kernel_mm) {
+          BEGIN_BATCH_NO_AUTOSTATE(2);
+          OUT_BATCH(CP_PACKET0(R200_SE_VF_MAX_VTX_INDX, 0));
+          OUT_BATCH(count);
+          END_BATCH();
+   }
+}
 
 void r200EmitVertexAOS( r200ContextPtr rmesa,
                        GLuint vertex_size,
index 9f06d23b384fe3d0d373f39f83ba776e402d9fbc..8d51aefa0420ec71c8811cd16c1f0aab56cdd1b9 100644 (file)
@@ -44,6 +44,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "drm.h"
 #include "radeon_drm.h"
 
+extern void r200EmitMaxVtxIndex(r200ContextPtr rmesa, int count);
 extern void r200EmitVertexAOS( r200ContextPtr rmesa,
                               GLuint vertex_size,
                               struct radeon_bo *bo,
index 348294cefcdfa8ff0e8061c8156e6da82bb8dac5..c702910ef21e2ca061d89b81035084cda91a7b73 100644 (file)
@@ -161,6 +161,7 @@ static GLushort *r200AllocElts( r200ContextPtr rmesa, GLuint nr )
       r200EmitAOS( rmesa,
                   rmesa->radeon.tcl.aos_count, 0 );
 
+      r200EmitMaxVtxIndex(rmesa, rmesa->radeon.tcl.aos[0].count);
       return r200AllocEltsOpenEnded( rmesa, rmesa->tcl.hw_primitive, nr );
    }
 }