summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorAlan Hourihane <[email protected]>2008-12-10 12:02:24 +0000
committerAlan Hourihane <[email protected]>2008-12-10 12:02:24 +0000
commita8e7852b05f95cc695f3a05692a6ccd36298faf7 (patch)
tree4cbd4afd285e1888354c3a45b5bf3e95671fa04a /src/gallium/auxiliary
parente3f5370d637f367dbfe7d21f726e84185ad1e07d (diff)
gallium: more vertex count checks
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_emit.c11
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_emit.c10
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c14
3 files changed, 31 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c
index 9c73d9c735c..c4fc93ffbae 100644
--- a/src/gallium/auxiliary/draw/draw_pt_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_emit.c
@@ -165,8 +165,10 @@ void draw_pt_emit( struct pt_emit *emit,
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
- if (count > 65535) /* FIXME */
- return FALSE;
+ if (vertex_count > 65535) { /* FIXME */
+ assert(0);
+ return;
+ }
/* XXX: and work out some way to coordinate the render primitive
* between vbuf.c and here...
@@ -229,6 +231,11 @@ void draw_pt_emit_linear(struct pt_emit *emit,
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
+ if (count > 65535) { /* FIXME */
+ assert(0);
+ return;
+ }
+
/* XXX: and work out some way to coordinate the render primitive
* between vbuf.c and here...
*/
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
index 8ab08959e3b..5727b91c48c 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
@@ -229,6 +229,11 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle,
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
+ if (fetch_count > 65535) { /* FIXME */
+ assert(0);
+ return;
+ }
+
hw_verts = draw->render->allocate_vertices( draw->render,
(ushort)feme->translate->key.output_stride,
(ushort)fetch_count );
@@ -283,6 +288,11 @@ static void fetch_emit_run_linear( struct draw_pt_middle_end *middle,
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
+ if (count > 65535) { /* FIXME */
+ assert(0);
+ return;
+ }
+
hw_verts = draw->render->allocate_vertices( draw->render,
(ushort)feme->translate->key.output_stride,
(ushort)count );
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
index 77e630c0992..69580f14723 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
@@ -234,8 +234,10 @@ static void fse_run_linear( struct draw_pt_middle_end *middle,
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
- if (count > 65535) /* FIXME */
- return FALSE;
+ if (count > 65535) { /* FIXME */
+ assert(0);
+ return;
+ }
hw_verts = draw->render->allocate_vertices( draw->render,
(ushort)fse->key.output_stride,
@@ -296,6 +298,11 @@ fse_run(struct draw_pt_middle_end *middle,
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
+ if (fetch_count > 65535) { /* FIXME */
+ assert(0);
+ return;
+ }
+
hw_verts = draw->render->allocate_vertices( draw->render,
(ushort)fse->key.output_stride,
(ushort)fetch_count );
@@ -350,6 +357,9 @@ static boolean fse_run_linear_elts( struct draw_pt_middle_end *middle,
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
+ if (count > 65535) /* FIXME */
+ return FALSE;
+
hw_verts = draw->render->allocate_vertices( draw->render,
(ushort)fse->key.output_stride,
(ushort)count );