aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_screen.c
diff options
context:
space:
mode:
authorAlexandros Frantzis <[email protected]>2019-03-18 16:30:29 +0200
committerAlexandros Frantzis <[email protected]>2019-03-27 15:46:14 +0200
commit3bccf702118dda542da3b96990fd0bcca97f9a89 (patch)
tree90704adecb080134d883af33643025d634976ea9 /src/gallium/drivers/virgl/virgl_screen.c
parentd6a07732c9c155c73f7d2cddc10faa7eab768df9 (diff)
virgl: Fake MSAA when max samples is 1
When the host is running on softpipe/llvmpipe the maximum number of samples for multisampling is 1. GL 3.0 requires at least 4 samples, and softpipe/llvmpipe get around this by enabling PIPE_CAP_FAKE_SW_MSAA. This patch mimics softpipe/llvmpipe behavior in virgl by enabling the same PIPE_CAP_FAKE_SW_MSAA workaround when the max sample count reported by the host is 1. This change allows virgl on a softpipe/llvmpipe host to advertise support for GL 3.0 and beyond. Signed-off-by: Alexandros Frantzis <[email protected]> Reviewed-By: Gert Wollny <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_screen.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index 66e520eab8a..1ad8863bfca 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -265,9 +265,12 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
if (vscreen->caps.caps.v1.glsl_level < 150)
return vscreen->caps.caps.v2.max_vertex_attribs;
return 32;
+ case PIPE_CAP_FAKE_SW_MSAA:
+ /* If the host supports only one sample (e.g., if it is using softpipe),
+ * fake multisampling to able to advertise higher GL versions. */
+ return (vscreen->caps.caps.v1.max_samples == 1) ? 1 : 0;
case PIPE_CAP_TEXTURE_GATHER_SM5:
case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
- case PIPE_CAP_FAKE_SW_MSAA:
case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
case PIPE_CAP_MULTI_DRAW_INDIRECT: