diff options
author | Zack Rusin <[email protected]> | 2010-06-10 05:15:55 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2010-06-10 05:15:55 -0400 |
commit | 9ef6d34f7e03f3d33c0ebad4191f3300a9062c4a (patch) | |
tree | 20bc95ca67e090310e745c5b20a4f82f63a69852 /src/gallium/auxiliary | |
parent | 9be40de0871980ca541f0682aef6c1c507c1610f (diff) |
draw: make sure that the gs never outputs more data than we allocated for
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c index 152437c4f72..4f88b27b7d5 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c @@ -191,7 +191,7 @@ static void fetch_pipeline_run( struct draw_pt_middle_end *middle, fetch_count, fpme->vertex_size, fpme->vertex_size); - if (gshader) + if (gshader) { fetch_count = draw_geometry_shader_run(gshader, (const float (*)[4])pipeline_verts->data, @@ -200,6 +200,8 @@ static void fetch_pipeline_run( struct draw_pt_middle_end *middle, fetch_count, fpme->vertex_size, fpme->vertex_size); + debug_assert(fetch_count <= alloc_count); + } } /* stream output needs to be done before clipping */ @@ -283,14 +285,17 @@ static void fetch_pipeline_linear_run( struct draw_pt_middle_end *middle, fpme->vertex_size, fpme->vertex_size); - if (geometry_shader) - count = draw_geometry_shader_run(geometry_shader, - (const float (*)[4])pipeline_verts->data, - ( float (*)[4])pipeline_verts->data, - draw->pt.user.gs_constants, - count, - fpme->vertex_size, - fpme->vertex_size); + if (geometry_shader) { + count = + draw_geometry_shader_run(geometry_shader, + (const float (*)[4])pipeline_verts->data, + ( float (*)[4])pipeline_verts->data, + draw->pt.user.gs_constants, + count, + fpme->vertex_size, + fpme->vertex_size); + debug_assert(count <= alloc_count); + } } /* stream output needs to be done before clipping */ @@ -368,14 +373,17 @@ static boolean fetch_pipeline_linear_run_elts( struct draw_pt_middle_end *middle fpme->vertex_size, fpme->vertex_size); - if (geometry_shader) - count = draw_geometry_shader_run(geometry_shader, - (const float (*)[4])pipeline_verts->data, - ( float (*)[4])pipeline_verts->data, - draw->pt.user.gs_constants, - count, - fpme->vertex_size, - fpme->vertex_size); + if (geometry_shader) { + count = + draw_geometry_shader_run(geometry_shader, + (const float (*)[4])pipeline_verts->data, + ( float (*)[4])pipeline_verts->data, + draw->pt.user.gs_constants, + count, + fpme->vertex_size, + fpme->vertex_size); + debug_assert(count <= alloc_count); + } } /* stream output needs to be done before clipping */ |