summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-12-14 15:22:55 -0800
committerEric Anholt <[email protected]>2015-12-15 12:02:53 -0800
commitf2cf2a63f1211642ca20b73ad5f23c60cc3fa703 (patch)
treeda542ead992509df02bdc75f9daada8a1439dd99 /src/gallium/drivers/vc4/vc4_context.c
parentda92f16c500642879221b201a8292080236b4251 (diff)
vc4: Don't consider nr_samples==1 surfaces to be MSAA.
This is apparently a weirdness of gallium -- nr_samples==1 is occasionally used and means the same thing as nr_samples==0. Fixes a bunch of ARB_framebuffer_srgb blit cases in piglit.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_context.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index 1cd167600b9..0f6b9714929 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -70,11 +70,13 @@ vc4_flush(struct pipe_context *pctx)
vc4->msaa = false;
if (cbuf && (vc4->resolve & PIPE_CLEAR_COLOR0)) {
pipe_surface_reference(&vc4->color_write,
- cbuf->texture->nr_samples ? NULL : cbuf);
+ cbuf->texture->nr_samples > 1 ?
+ NULL : cbuf);
pipe_surface_reference(&vc4->msaa_color_write,
- cbuf->texture->nr_samples ? cbuf : NULL);
+ cbuf->texture->nr_samples > 1 ?
+ cbuf : NULL);
- if (cbuf->texture->nr_samples)
+ if (cbuf->texture->nr_samples > 1)
vc4->msaa = true;
if (!(vc4->cleared & PIPE_CLEAR_COLOR0)) {
@@ -92,13 +94,13 @@ vc4_flush(struct pipe_context *pctx)
if (vc4->framebuffer.zsbuf &&
(vc4->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL))) {
pipe_surface_reference(&vc4->zs_write,
- zsbuf->texture->nr_samples ?
+ zsbuf->texture->nr_samples > 1 ?
NULL : zsbuf);
pipe_surface_reference(&vc4->msaa_zs_write,
- zsbuf->texture->nr_samples ?
+ zsbuf->texture->nr_samples > 1 ?
zsbuf : NULL);
- if (zsbuf->texture->nr_samples)
+ if (zsbuf->texture->nr_samples > 1)
vc4->msaa = true;
if (!(vc4->cleared & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL))) {