lavapipe: disable stencil test if no stencil attachment

stencil test must not be enabled if there is no stencil attachment

fixes dEQP-VK.pipeline.*.stencil.no_stencil_att.dynamic_rendering.*

fixes #10990

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28772>
This commit is contained in:
Mike Blumenkrantz 2024-04-16 14:37:47 -04:00 committed by Marge Bot
parent 5363f7cce5
commit fc691d9f37

View file

@ -87,6 +87,7 @@ struct rendering_state {
bool blend_dirty;
bool rs_dirty;
bool dsa_dirty;
bool dsa_no_stencil;
bool stencil_ref_dirty;
bool clip_state_dirty;
bool blend_color_dirty;
@ -503,8 +504,16 @@ static void emit_state(struct rendering_state *state)
}
if (state->dsa_dirty) {
bool s0_enabled = state->dsa_state.stencil[0].enabled;
bool s1_enabled = state->dsa_state.stencil[1].enabled;
if (state->dsa_no_stencil) {
state->dsa_state.stencil[0].enabled = false;
state->dsa_state.stencil[1].enabled = false;
}
cso_set_depth_stencil_alpha(state->cso, &state->dsa_state);
state->dsa_dirty = false;
state->dsa_state.stencil[0].enabled = s0_enabled;
state->dsa_state.stencil[1].enabled = s1_enabled;
}
if (state->sample_mask_dirty) {
@ -1853,6 +1862,8 @@ handle_begin_rendering(struct vk_cmd_queue_entry *cmd,
render_att_init(&state->depth_att, info->pDepthAttachment, state->poison_mem, false);
render_att_init(&state->stencil_att, info->pStencilAttachment, state->poison_mem, true);
state->dsa_no_stencil = !state->stencil_att.imgv;
state->dsa_dirty = true;
if (state->depth_att.imgv || state->stencil_att.imgv) {
assert(state->depth_att.imgv == NULL ||
state->stencil_att.imgv == NULL ||