Commit 08fe40dd authored by Gurchetan Singh's avatar Gurchetan Singh
Browse files

Add VIRGL_BIND_SHADER_BUFFER

The guest needs to always mark SSBOs as unclean, since it's possible
the shader can write to them without doing a transfer.

We don't necessarily need to add VIRGL_BIND_SHADER_BUFFER, and we can
do this just with PIPE_BIND_SHADER_BUFFER, but this seemed most
consistent with prior commits.

With some host side changes too, fixes:
    dEQP-GLES31.functional.shaders.builtin_var.compute.num_work_groups

Change-Id: Iafb5ab6bdb4483806709641a5c6f769b0679e636
parent fa3f39a1
......@@ -164,6 +164,9 @@ struct pipe_resource *virgl_buffer_create(struct virgl_screen *vs,
vbind = pipe_to_virgl_bind(template->bind);
size = template->width0;
if (vbind == VIRGL_BIND_SHADER_BUFFER)
buf->base.clean = FALSE;
buf->base.hw_res = vs->vws->resource_create(vs->vws, template->target, template->format, vbind, template->width0, 1, 1, 1, 0, 0, size);
util_range_set_empty(&buf->valid_buffer_range);
......
......@@ -211,6 +211,7 @@ enum virgl_formats {
#define VIRGL_BIND_CONSTANT_BUFFER (1 << 6)
#define VIRGL_BIND_DISPLAY_TARGET (1 << 7)
#define VIRGL_BIND_STREAM_OUTPUT (1 << 11)
#define VIRGL_BIND_SHADER_BUFFER (1 << 14)
#define VIRGL_BIND_CURSOR (1 << 16)
#define VIRGL_BIND_CUSTOM (1 << 17)
#define VIRGL_BIND_SCANOUT (1 << 18)
......
......@@ -136,6 +136,8 @@ static inline unsigned pipe_to_virgl_bind(unsigned pbind)
outbind |= VIRGL_BIND_SCANOUT;
if (pbind & PIPE_BIND_QUERY_BUFFER)
outbind |= VIRGL_BIND_QUERY_BUFFER;
if (pbind & PIPE_BIND_SHADER_BUFFER)
outbind |= VIRGL_BIND_SHADER_BUFFER;
return outbind;
}
......
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