vc4: Fix tests for format supported with nr_samples == 1.
authorEric Anholt <eric@anholt.net>
Wed, 20 Apr 2016 23:31:28 +0000 (16:31 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 22 Apr 2016 18:27:11 +0000 (11:27 -0700)
This was a bug from the MSAA enabling.  Tests for surfaces with
nr_samples==1 instead of 0 (generally GL renderbuffers) would incorrectly
fail out.

Fixes the ARB_framebuffer_sRGB piglit tests other than srgb_conformance.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/vc4/vc4_screen.c

index 1da4db2ebb7de99359125142d43e9a8f40a0ceb3..4dc84d4ea62baef8574485318dd7c2c55687facd 100644 (file)
@@ -386,6 +386,9 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen,
 {
         unsigned retval = 0;
 
+        if (sample_count > 1 && sample_count != VC4_MAX_SAMPLES)
+                return FALSE;
+
         if ((target >= PIPE_MAX_TEXTURE_TYPES) ||
             !util_format_is_supported(format, usage)) {
                 return FALSE;
@@ -445,14 +448,12 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen,
         }
 
         if ((usage & PIPE_BIND_RENDER_TARGET) &&
-            (sample_count == 0 || sample_count == VC4_MAX_SAMPLES) &&
             vc4_rt_format_supported(format)) {
                 retval |= PIPE_BIND_RENDER_TARGET;
         }
 
         if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
-            (sample_count == 0 || sample_count == VC4_MAX_SAMPLES) &&
-            (vc4_tex_format_supported(format))) {
+            vc4_tex_format_supported(format)) {
                 retval |= PIPE_BIND_SAMPLER_VIEW;
         }