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

Author: Giancarlo Devich <[email protected]>
Date:   Fri Feb 24 13:26:46 2023 -0800

d3d12: Don't memcmp gs/tcs keys

This is unnecessary and incomplete. Not only is it covered by the hash
map lookup, but also does not consider the other key members.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>

---

 src/gallium/drivers/d3d12/d3d12_compiler.cpp | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp 
b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
index 370b40a0963..edaac5131df 100644
--- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
@@ -677,10 +677,6 @@ validate_geometry_shader_variant(struct 
d3d12_selection_context *sel_ctx)
                     vs->initial->info.outputs_written, false);
    }
 
-   /* Check if the currently bound geometry shader variant is correct */
-   if (gs && memcmp(&gs->gs_key, &key, sizeof(key)) == 0)
-      return;
-
    /* Find/create the proper variant and bind it */
    gs = variant_needed ? d3d12_get_gs_variant(ctx, &key) : NULL;
    ctx->gfx_stages[PIPE_SHADER_GEOMETRY] = gs;
@@ -709,10 +705,6 @@ validate_tess_ctrl_shader_variant(struct 
d3d12_selection_context *sel_ctx)
       key.vertices_out = ctx->patch_vertices;
    }
 
-   /* Check if the currently bound tessellation control shader variant is 
correct */
-   if (tcs && memcmp(&tcs->tcs_key, &key, sizeof(key)) == 0)
-      return;
-
    /* Find/create the proper variant and bind it */
    tcs = variant_needed ? d3d12_get_tcs_variant(ctx, &key) : NULL;
    ctx->gfx_stages[PIPE_SHADER_TESS_CTRL] = tcs;

Reply via email to