summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2018-07-10 16:19:24 -0700
committerDave Airlie <[email protected]>2018-08-01 08:05:39 +1000
commit9c136e8a07b10ce0c034cbeab1180ae2b4d89bf7 (patch)
tree36150b0b104bdc27ac9e74b18c0f40db78152c04 /src
parenta090df0d5dc804c1b6e16442a49b2ecb612a990d (diff)
virgl: also mark sampler views as dirty
When texture buffers are used as images in compute shaders, the guest never sees the modified data since the TBO is always marked as clean. Fixes most dEQP-GLES31.functional.image_load_store.buffer.* tests. Example test cases: dEQP-GLES31.functional.image_load_store.buffer.load_store.r32ui dEQP-GLES31.functional.image_load_store.buffer.qualifiers.coherent_r32f dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.rgba8_rgba8ui Note: virglrenderer side patch also needed to bind TBOs correctly Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/virgl/virgl_buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/virgl/virgl_buffer.c b/src/gallium/drivers/virgl/virgl_buffer.c
index 3288bb20bd1..88a22b56f9a 100644
--- a/src/gallium/drivers/virgl/virgl_buffer.c
+++ b/src/gallium/drivers/virgl/virgl_buffer.c
@@ -164,7 +164,8 @@ 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)
+ /* SSBOs and texture buffers can written to by host compute shaders. */
+ if (vbind == VIRGL_BIND_SHADER_BUFFER || vbind == VIRGL_BIND_SAMPLER_VIEW)
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);