summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_streamout.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-06-14 14:51:04 +1000
committerDave Airlie <[email protected]>2018-08-22 05:05:21 +1000
commit41d58e20983576212636c11afd6ca25ebd60b68f (patch)
treebcd0095cf4b21d4672ad4a45ba06a931a7c94402 /src/gallium/drivers/virgl/virgl_streamout.c
parentaa79cc2bc8e27febc159bafe7bdb52e866b8a9ec (diff)
virgl: ARB_enhanced_layouts support
We need to handle the gaps in the streamout bindings on the guest side and enable if it the host has the rest enabled. Reviewed-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_streamout.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_streamout.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/virgl/virgl_streamout.c b/src/gallium/drivers/virgl/virgl_streamout.c
index b6a65fff29e..0fc3af67959 100644
--- a/src/gallium/drivers/virgl/virgl_streamout.c
+++ b/src/gallium/drivers/virgl/virgl_streamout.c
@@ -72,7 +72,10 @@ static void virgl_set_so_targets(struct pipe_context *ctx,
struct virgl_context *vctx = virgl_context(ctx);
int i;
for (i = 0; i < num_targets; i++) {
- pipe_resource_reference(&vctx->so_targets[i].base.buffer, targets[i]->buffer);
+ if (targets[i])
+ pipe_resource_reference(&vctx->so_targets[i].base.buffer, targets[i]->buffer);
+ else
+ pipe_resource_reference(&vctx->so_targets[i].base.buffer, NULL);
}
for (i = num_targets; i < vctx->num_so_targets; i++)
pipe_resource_reference(&vctx->so_targets[i].base.buffer, NULL);