lavapipe: don't read line stipple info in pipeline creation if stipple is disabled

otherwise these values may be (harmlessly) garbage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11933>
This commit is contained in:
Mike Blumenkrantz 2021-07-16 16:59:37 -04:00 committed by Marge Bot
parent 11f9ad9238
commit 59e923e5a1
1 changed files with 8 additions and 3 deletions

View File

@ -816,9 +816,14 @@ lvp_graphics_pipeline_init(struct lvp_pipeline *pipeline,
pipeline->disable_multisample = line_state->lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT ||
line_state->lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT;
pipeline->line_rectangular = line_state->lineRasterizationMode != VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT;
if (!dynamic_state_contains(pipeline->graphics_create_info.pDynamicState, VK_DYNAMIC_STATE_LINE_STIPPLE_EXT)) {
pipeline->line_stipple_factor = line_state->lineStippleFactor - 1;
pipeline->line_stipple_pattern = line_state->lineStipplePattern;
if (pipeline->line_stipple_enable) {
if (!dynamic_state_contains(pipeline->graphics_create_info.pDynamicState, VK_DYNAMIC_STATE_LINE_STIPPLE_EXT)) {
pipeline->line_stipple_factor = line_state->lineStippleFactor - 1;
pipeline->line_stipple_pattern = line_state->lineStipplePattern;
} else {
pipeline->line_stipple_factor = 0;
pipeline->line_stipple_pattern = UINT16_MAX;
}
}
} else
pipeline->line_rectangular = true;