Mesa (main): d3d12: Correctly key off of polygon stipple enable cap

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 2 16:02:10 UTC 2022


Module: Mesa
Branch: main
Commit: 9f37579e1b810f1ea41fa5781bba47c15d1f93f6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f37579e1b810f1ea41fa5781bba47c15d1f93f6

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Fri Apr 29 13:14:34 2022 -0700

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 at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16254>

---

 src/gallium/drivers/d3d12/d3d12_compiler.cpp | 6 ++++--
 src/gallium/drivers/d3d12/d3d12_draw.cpp     | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
index 856cc319d89..569d6adb847 100644
--- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
@@ -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 &&
diff --git a/src/gallium/drivers/d3d12/d3d12_draw.cpp b/src/gallium/drivers/d3d12/d3d12_draw.cpp
index d49cdf62fb9..b991aab070a 100644
--- a/src/gallium/drivers/d3d12/d3d12_draw.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_draw.cpp
@@ -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;
 



More information about the mesa-commit mailing list