Mesa (master): virgl: Fake MSAA when max samples is 1
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Mar 27 14:09:00 UTC 2019
Module: Mesa
Branch: master
Commit: 3bccf702118dda542da3b96990fd0bcca97f9a89
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3bccf702118dda542da3b96990fd0bcca97f9a89
Author: Alexandros Frantzis <alexandros.frantzis at collabora.com>
Date: Mon Mar 18 16:30:29 2019 +0200
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 <alexandros.frantzis at collabora.com>
Reviewed-By: Gert Wollny <gert.wollny at collabora.com>
---
src/gallium/drivers/virgl/virgl_screen.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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:
More information about the mesa-commit
mailing list