summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-08-03 10:54:18 -0600
committerBrian Paul <[email protected]>2017-10-03 12:07:05 -0600
commit3e39abf6a033cccbf2bbf85bf23785b7367cdcef (patch)
treeb333516f6699bfc9b4c180738f0022a9cca24ca1
parent3c71c42827766f66c300cf1f32679c33c54950c8 (diff)
svga: if we get nr_samples==1, store nr_samples=0
We need to be more careful not to treat nr_samples=1 as an msaa surface. This patch prevents us from errantly declaring an MSAA shader resource with 1 sample. No Piglit regressions, fixes the above-described errors. Reviewed-by: Neha Bhende <[email protected]>
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c11
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: