summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2015-02-14 01:27:19 -0500
committerEmil Velikov <emil.l.velikov@gmail.com>2015-02-24 12:16:28 +0000
commit88d47387b89995519e9010c42939b5ee7b5bcc8d (patch)
treec76a78cc9840ceae16d56f14ad73b0a3f68d9d71 /src
parentc08e9605c2a71003359004c97392149267758a46 (diff)
st/mesa: treat resource-less xfb buffers as if they weren't there
If a transform feedback buffer's size is 0, st_bufferobj_data doesn't end up creating a buffer for it. There's no point in trying to write to such a buffer, so just pretend as if it's not really there. This fixes arb_gpu_shader5-xfb-streams-without-invocations on nvc0. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 80d373ed5b1d90a5e71747ee5b8951baac62f750)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_xformfb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_xformfb.c b/src/mesa/state_tracker/st_cb_xformfb.c
index 8f75eda8a10..a2bd86aff55 100644
--- a/src/mesa/state_tracker/st_cb_xformfb.c
+++ b/src/mesa/state_tracker/st_cb_xformfb.c
@@ -122,7 +122,7 @@ st_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
for (i = 0; i < max_num_targets; i++) {
struct st_buffer_object *bo = st_buffer_object(sobj->base.Buffers[i]);
- if (bo) {
+ if (bo && bo->buffer) {
/* Check whether we need to recreate the target. */
if (!sobj->targets[i] ||
sobj->targets[i] == sobj->draw_count ||