iris: ForceZeroRTAIndexEnable if last geom stage does not write layer id

This matches anv and specification behavior, change makes us toggle the
field in tests/application that may use layered framebuffer but do not
assign any value to gl_Layer.

Example of such a test:
KHR-GL46.geometry_shader.layered_rendering_boundary_condition.layered_rendering_boundary_condition_no_default_layer

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29064>
This commit is contained in:
Tapani Pälli 2024-05-05 18:00:57 +03:00 committed by Marge Bot
parent 8c22112a7d
commit 01608de875
2 changed files with 8 additions and 1 deletions

View file

@ -2801,6 +2801,10 @@ update_last_vue_map(struct iris_context *ice,
ice->state.stage_dirty_for_nos[IRIS_NOS_LAST_VUE_MAP];
}
if (changed_slots & VARYING_BIT_LAYER) {
ice->state.dirty |= IRIS_DIRTY_CLIP;
}
if (changed_slots || (old_map && old_map->separate != vue_map->separate)) {
ice->state.dirty |= IRIS_DIRTY_SBE;
}

View file

@ -7501,6 +7501,8 @@ iris_upload_dirty_render_state(struct iris_context *ice,
bool points_or_lines = cso_rast->fill_mode_point_or_line ||
(gs_or_tes ? ice->shaders.output_topology_is_points_or_lines
: ice->state.prim_is_points_or_lines);
const struct intel_vue_map *last =
&iris_vue_data(ice->shaders.last_vue_shader)->vue_map;
uint32_t dynamic_clip[GENX(3DSTATE_CLIP_length)];
iris_pack_command(GENX(3DSTATE_CLIP), &dynamic_clip, cl) {
@ -7517,7 +7519,8 @@ iris_upload_dirty_render_state(struct iris_context *ice,
cl.NonPerspectiveBarycentricEnable = fs_data->uses_nonperspective_interp_modes;
cl.ForceZeroRTAIndexEnable = cso_fb->layers <= 1;
cl.ForceZeroRTAIndexEnable = cso_fb->layers <= 1 ||
!(last->slots_valid & VARYING_BIT_LAYER);
cl.MaximumVPIndex = ice->state.num_viewports - 1;
}
iris_emit_merge(batch, cso_rast->clip, dynamic_clip,