summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2010-06-12 10:44:31 -0400
committerZack Rusin <[email protected]>2010-06-12 10:45:42 -0400
commitdb05972807c5cb7911b5745df00fa13130cf919e (patch)
tree7ddc7dee39972448837cf28a250a4bbd7017c0aa /src/gallium
parent1551b4da8c7ee3c13e07c7aa79cf148ca444d0f5 (diff)
draw/gs: copy the outputs only if we emitted something
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/draw/draw_gs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index a1ca7071e35..52f61d29b79 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -367,9 +367,11 @@ int draw_geometry_shader_run(struct draw_geometry_shader *shader,
gs_run(shader, pipe_prim, count);
- memcpy(output, pipeline_verts->data,
- shader->info.num_outputs * 4 * sizeof(float) +
- vertex_size * (shader->emitted_vertices -1));
+ if (shader->emitted_vertices > 0) {
+ memcpy(output, pipeline_verts->data,
+ shader->info.num_outputs * 4 * sizeof(float) +
+ vertex_size * (shader->emitted_vertices -1));
+ }
FREE(pipeline_verts);
return shader->emitted_vertices;