From 2ca0d913ea82c8025e801b33fc4a7800d4f7a9a7 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sun, 23 Dec 2018 18:22:44 -0800 Subject: [PATCH] iris: Fix framebuffer layer count cso_fb->layers is only valid for no-attachment framebuffers. Use the helper function to get the real value, then stash it so we don't have to call the helper function on the old value for comparison, or at draw time for Force Zero RTA Index setting. This fixes Force Zero RTA Index being set even when attempting layered rendering. --- src/gallium/drivers/iris/iris_state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index d26894264cd..0a2a5997ab8 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2088,6 +2088,7 @@ iris_set_framebuffer_state(struct pipe_context *ctx, struct iris_resource *stencil_res; unsigned samples = util_framebuffer_get_num_samples(state); + unsigned layers = util_framebuffer_get_num_layers(state); if (cso->samples != samples) { ice->state.dirty |= IRIS_DIRTY_MULTISAMPLE; @@ -2097,7 +2098,7 @@ iris_set_framebuffer_state(struct pipe_context *ctx, ice->state.dirty |= IRIS_DIRTY_BLEND_STATE; } - if ((cso->layers == 0) != (state->layers == 0)) { + if ((cso->layers == 0) != (layers == 0)) { ice->state.dirty |= IRIS_DIRTY_CLIP; } @@ -2107,6 +2108,7 @@ iris_set_framebuffer_state(struct pipe_context *ctx, util_copy_framebuffer_state(cso, state); cso->samples = samples; + cso->layers = layers; struct iris_depth_buffer_state *cso_z = &ice->state.genx->depth_buffer; -- 2.30.2