From a8e7852b05f95cc695f3a05692a6ccd36298faf7 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 10 Dec 2008 12:02:24 +0000 Subject: [PATCH] gallium: more vertex count checks --- src/gallium/auxiliary/draw/draw_pt_emit.c | 11 +++++++++-- src/gallium/auxiliary/draw/draw_pt_fetch_emit.c | 10 ++++++++++ .../auxiliary/draw/draw_pt_fetch_shade_emit.c | 14 ++++++++++++-- 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 ); -- 2.30.2