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.
This commit is contained in:
Kenneth Graunke 2018-12-23 18:22:44 -08:00
parent df60241ff7
commit 2ca0d913ea
1 changed files with 3 additions and 1 deletions

View File

@ -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;