summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_state.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-12-23 18:22:44 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:11 -0800
commit2ca0d913ea82c8025e801b33fc4a7800d4f7a9a7 (patch)
tree68d9bf621b7bddaf8261fd7375f6b52e36144004 /src/gallium/drivers/iris/iris_state.c
parentdf60241ff7d212eeecfdad7090a7a4aa9fc8a4a5 (diff)
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.
Diffstat (limited to 'src/gallium/drivers/iris/iris_state.c')
-rw-r--r--src/gallium/drivers/iris/iris_state.c4
1 files changed, 3 insertions, 1 deletions
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;