diff options
author | Zack Rusin <[email protected]> | 2013-04-27 00:49:23 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2013-04-27 01:19:07 -0400 |
commit | 0031cde1e199a82dfe4b754931fb0a5bdf5582f9 (patch) | |
tree | 7d8d6bcc27f52e3e1a1d8880a25d3a69275e4611 /src/gallium/auxiliary/draw | |
parent | f9f57312de863dd058a595c69ef3f42a5d90bce5 (diff) |
draw/so: indicate overflow when buffer is missing
We were crashing if one of the buffers wasn't set, we should
just treat it as an overflow. It's useful when using so
statistics because it allows one to figure out how much data
would be generated by so without actually writing any of it.
Signed-off-by: Zack Rusin <[email protected]>
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt_so_emit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_so_emit.c b/src/gallium/auxiliary/draw/draw_pt_so_emit.c index cdfd13c6421..1328e8658c4 100644 --- a/src/gallium/auxiliary/draw/draw_pt_so_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_so_emit.c @@ -129,6 +129,10 @@ static void so_emit_prim(struct pt_so_emit *so, for (i = 0; i < draw->so.num_targets; i++) { struct draw_so_target *target = draw->so.targets[i]; + /* If a buffer is missing then that's equivalent to + * an overflow */ + if (!target) + return; buffer_total_bytes[i] = target->internal_offset + target->target.buffer_offset; } |