summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2018-09-05 09:48:35 -0600
committerBrian Paul <[email protected]>2018-09-10 13:07:30 -0600
commit3f55425ee69dafb5d5dd10bea4cf2010d87d5eee (patch)
tree3afc55bc6f1d5030a0109762419336292f806172 /src/gallium/drivers
parent8088cb6f53ddf6313fefce2789f657e595f3a489 (diff)
svga: enable MSAA for SM4_1 device
The SVGA device is deprecating the DX9 MSAA support. This patch enables MSAA for SM4_1 device by explicitly setting the SVGA3D_SURFACE_MULTISAMPLE bit. For SM4_1 device, only 4 samples is supported. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/svga/svga_resource_buffer_upload.c1
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c3
-rw-r--r--src/gallium/drivers/svga/svga_surface.c3
3 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_buffer_upload.c b/src/gallium/drivers/svga/svga_resource_buffer_upload.c
index 9daae9c0f44..93a6dee0724 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer_upload.c
+++ b/src/gallium/drivers/svga/svga_resource_buffer_upload.c
@@ -191,6 +191,7 @@ svga_buffer_create_host_surface(struct svga_screen *ss,
sbuf->key.numMipLevels = 1;
sbuf->key.cachable = 1;
sbuf->key.arraySize = 1;
+ sbuf->key.sampleCount = 0;
SVGA_DBG(DEBUG_DMA, "surface_create for buffer sz %d\n",
sbuf->b.b.width0);
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index aaf62534945..aaba3ac5f96 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -1000,7 +1000,8 @@ svga_texture_create(struct pipe_screen *screen,
tex->b.b.nr_samples = 0;
}
else if (tex->b.b.nr_samples > 1) {
- tex->key.flags |= SVGA3D_SURFACE_MASKABLE_ANTIALIAS;
+ assert(svgascreen->sws->have_sm4_1);
+ tex->key.flags |= SVGA3D_SURFACE_MULTISAMPLE;
}
tex->key.sampleCount = tex->b.b.nr_samples;
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c
index 6237999b75f..45badae6ce8 100644
--- a/src/gallium/drivers/svga/svga_surface.c
+++ b/src/gallium/drivers/svga/svga_surface.c
@@ -186,7 +186,8 @@ svga_texture_view_surface(struct svga_context *svga,
key->sampleCount = tex->b.b.nr_samples > 1 ? tex->b.b.nr_samples : 0;
if (key->sampleCount > 1) {
- key->flags |= SVGA3D_SURFACE_MASKABLE_ANTIALIAS;
+ assert(ss->sws->have_sm4_1);
+ key->flags |= SVGA3D_SURFACE_MULTISAMPLE;
}
if (tex->b.b.target == PIPE_TEXTURE_CUBE && layer_pick < 0) {