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.
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;
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;
}
util_copy_framebuffer_state(cso, state);
cso->samples = samples;
+ cso->layers = layers;
struct iris_depth_buffer_state *cso_z = &ice->state.genx->depth_buffer;