diff options
-rw-r--r-- | src/gallium/drivers/svga/svga_resource_texture.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c index 5b82e9eb7b6..9e4d6c9fb18 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.c +++ b/src/gallium/drivers/svga/svga_resource_texture.c @@ -985,13 +985,16 @@ svga_texture_create(struct pipe_screen *screen, tex->key.arraySize = 1; tex->key.numFaces = 1; - /* single sample texture can be treated as non-multisamples texture */ - tex->key.sampleCount = template->nr_samples > 1 ? template->nr_samples : 0; - - if (template->nr_samples > 1) { + /* nr_samples=1 must be treated as a non-multisample texture */ + if (tex->b.b.nr_samples == 1) { + tex->b.b.nr_samples = 0; + } + else if (tex->b.b.nr_samples > 1) { tex->key.flags |= SVGA3D_SURFACE_MASKABLE_ANTIALIAS; } + tex->key.sampleCount = tex->b.b.nr_samples; + if (svgascreen->sws->have_vgpu10) { switch (template->target) { case PIPE_TEXTURE_1D: |