lavapipe: only apply pipeline state for depth bias if it's enabled

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11736>
This commit is contained in:
Mike Blumenkrantz 2021-07-06 12:20:54 -04:00 committed by Marge Bot
parent c4c279bd7a
commit e0fbaac242
1 changed files with 7 additions and 3 deletions

View File

@ -466,9 +466,13 @@ static void handle_graphics_pipeline(struct lvp_cmd_buffer_entry *cmd,
}
if (!dynamic_states[VK_DYNAMIC_STATE_DEPTH_BIAS]) {
state->rs_state.offset_units = rsc->depthBiasConstantFactor;
state->rs_state.offset_scale = rsc->depthBiasSlopeFactor;
state->rs_state.offset_clamp = rsc->depthBiasClamp;
if (pipeline->graphics_create_info.pRasterizationState->depthBiasEnable) {
state->rs_state.offset_units = rsc->depthBiasConstantFactor;
state->rs_state.offset_scale = rsc->depthBiasSlopeFactor;
state->rs_state.offset_clamp = rsc->depthBiasClamp;
} else {
state->rs_state.offset_clamp = state->rs_state.offset_scale = state->rs_state.offset_units = 0.0;
}
}
if (!dynamic_states[conv_dynamic_state_idx(VK_DYNAMIC_STATE_CULL_MODE_EXT)])