summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-04-20 16:31:28 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2016-05-05 13:59:31 +0100
commita12a9a57638ebbd21017ef9246cbf870b0bcb8ab (patch)
treefdb151f4926efbec07b71f1e427f0e8066323b6a
parent69bfd3b54390fa3632d04861c9d310c63c32c86b (diff)
vc4: Fix tests for format supported with nr_samples == 1.
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> (cherry picked from commit 1410403e1e6cd948b087ebb19f6865f054d14877)
-rw-r--r--src/gallium/drivers/vc4/vc4_screen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
index a4b3efcfda..c71367d1fb 100644
--- a/src/gallium/drivers/vc4/vc4_screen.c
+++ b/src/gallium/drivers/vc4/vc4_screen.c
@@ -380,6 +380,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;
@@ -439,14 +442,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;
}