d3d12: Correctly key off of polygon stipple enable cap

Apparently we were only keying off the presence of a real stipple pattern
being set, and completely ignoring when the app does glDisable().

Add in the actual enable bit as an additional discriminator to determine
if we should be doing polygon stippling.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16254>
This commit is contained in:
Jesse Natalie 2022-04-29 13:14:34 -07:00 committed by Marge Bot
parent ce6d5094c8
commit 9f37579e1b
2 changed files with 5 additions and 3 deletions

View File

@ -855,7 +855,8 @@ d3d12_fill_shader_key(struct d3d12_selection_context *sel_ctx,
(!next || next->stage == PIPE_SHADER_FRAGMENT))) {
key->last_vertex_processing_stage = 1;
key->invert_depth = sel_ctx->ctx->reverse_depth_range;
if (sel_ctx->ctx->pstipple.enabled)
if (sel_ctx->ctx->pstipple.enabled &&
sel_ctx->ctx->gfx_pipeline_state.rast->base.poly_stipple_enable)
key->next_varying_inputs |= VARYING_BIT_POS;
}
@ -882,7 +883,8 @@ d3d12_fill_shader_key(struct d3d12_selection_context *sel_ctx,
key->fs.missing_dual_src_outputs = sel_ctx->missing_dual_src_outputs;
key->fs.frag_result_color_lowering = sel_ctx->frag_result_color_lowering;
key->fs.manual_depth_range = sel_ctx->manual_depth_range;
key->fs.polygon_stipple = sel_ctx->ctx->pstipple.enabled;
key->fs.polygon_stipple = sel_ctx->ctx->pstipple.enabled &&
sel_ctx->ctx->gfx_pipeline_state.rast->base.poly_stipple_enable;
key->fs.multisample_disabled = sel_ctx->ctx->gfx_pipeline_state.rast &&
!sel_ctx->ctx->gfx_pipeline_state.rast->desc.MultisampleEnable;
if (sel_ctx->ctx->gfx_pipeline_state.blend &&

View File

@ -947,7 +947,7 @@ d3d12_draw_vbo(struct pipe_context *pctx,
ctx->initial_api_prim = saved_mode;
}
if (ctx->pstipple.enabled)
if (ctx->pstipple.enabled && ctx->gfx_pipeline_state.rast->base.poly_stipple_enable)
ctx->shader_dirty[PIPE_SHADER_FRAGMENT] |= D3D12_SHADER_DIRTY_SAMPLER_VIEWS |
D3D12_SHADER_DIRTY_SAMPLERS;