Commit ee82bb8d authored by Dave Airlie's avatar Dave Airlie
Browse files

fixups for enhanced layouts streamout diffs

parent 69e81263
......@@ -867,7 +867,10 @@ int virgl_encoder_set_so_targets(struct virgl_context *ctx,
virgl_encoder_write_dword(ctx->cbuf, append_bitmask);
for (i = 0; i < num_targets; i++) {
struct virgl_so_target *tg = virgl_so_target(targets[i]);
virgl_encoder_write_dword(ctx->cbuf, tg->handle);
if (tg)
virgl_encoder_write_dword(ctx->cbuf, tg->handle);
else
virgl_encoder_write_dword(ctx->cbuf, 0);
}
return 0;
}
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment