summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_screen.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-07-18 12:54:30 +1000
committerDave Airlie <[email protected]>2018-08-01 08:02:27 +1000
commit452eea140d909db6d10101914dff0e1274acc1e0 (patch)
tree9b63b79dd0851c2c9329285d669ddf0036e97cc2 /src/gallium/drivers/virgl/virgl_screen.c
parentfaa29c0e2449e3d7521bc273d723012b537593df (diff)
virgl: add initial images support (v2)
v2: add max image samples support Reviwed-by: Gert Wollny <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_screen.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index 18b636b869f..1c94603a2dc 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -375,6 +375,11 @@ virgl_get_shader_param(struct pipe_screen *screen,
return vscreen->caps.caps.v2.max_shader_buffer_frag_compute;
else
return vscreen->caps.caps.v2.max_shader_buffer_other_stages;
+ case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
+ if (shader == PIPE_SHADER_FRAGMENT)
+ return vscreen->caps.caps.v2.max_shader_image_frag_compute;
+ else
+ return vscreen->caps.caps.v2.max_shader_image_other_stages;
case PIPE_SHADER_CAP_LOWER_IF_THRESHOLD:
case PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS:
case PIPE_SHADER_CAP_INT64_ATOMICS:
@@ -494,6 +499,12 @@ virgl_is_format_supported( struct pipe_screen *screen,
if (sample_count > 1) {
if (!vscreen->caps.caps.v1.bset.texture_multisample)
return FALSE;
+
+ if (bind & PIPE_BIND_SHADER_IMAGE) {
+ if (sample_count > vscreen->caps.caps.v2.max_image_samples)
+ return FALSE;
+ }
+
if (sample_count > vscreen->caps.caps.v1.max_samples)
return FALSE;
}