diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp b/src/gallium/drivers/d3d12/d3d12_compiler.cpp index cca8cf3699f..370b40a0963 100644 --- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp +++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp @@ -637,17 +637,19 @@ static void validate_geometry_shader_variant(struct d3d12_selection_context *sel_ctx) { struct d3d12_context *ctx = sel_ctx->ctx; - d3d12_shader_selector *vs = ctx->gfx_stages[PIPE_SHADER_VERTEX]; - d3d12_shader_selector *fs = ctx->gfx_stages[PIPE_SHADER_FRAGMENT]; - struct d3d12_gs_variant_key key = {0}; - bool variant_needed = false; - d3d12_shader_selector *gs = ctx->gfx_stages[PIPE_SHADER_GEOMETRY]; /* Nothing to do if there is a user geometry shader bound */ if (gs != NULL && !gs->is_variant) return; + d3d12_shader_selector* vs = ctx->gfx_stages[PIPE_SHADER_VERTEX]; + d3d12_shader_selector* fs = ctx->gfx_stages[PIPE_SHADER_FRAGMENT]; + + struct d3d12_gs_variant_key key{0}; + + bool variant_needed = false; + /* Fill the geometry shader variant key */ if (sel_ctx->fill_mode_lowered != PIPE_POLYGON_MODE_FILL) { key.fill_mode = sel_ctx->fill_mode_lowered; @@ -688,15 +690,16 @@ static void validate_tess_ctrl_shader_variant(struct d3d12_selection_context *sel_ctx) { struct d3d12_context *ctx = sel_ctx->ctx; - d3d12_shader_selector *vs = ctx->gfx_stages[PIPE_SHADER_VERTEX]; d3d12_shader_selector *tcs = ctx->gfx_stages[PIPE_SHADER_TESS_CTRL]; - d3d12_shader_selector *tes = ctx->gfx_stages[PIPE_SHADER_TESS_EVAL]; - struct d3d12_tcs_variant_key key = {0}; /* Nothing to do if there is a user tess ctrl shader bound */ if (tcs != NULL && !tcs->is_variant) return; + d3d12_shader_selector *vs = ctx->gfx_stages[PIPE_SHADER_VERTEX]; + d3d12_shader_selector *tes = ctx->gfx_stages[PIPE_SHADER_TESS_EVAL]; + struct d3d12_tcs_variant_key key = {0}; + bool variant_needed = tes != nullptr; /* Fill the variant key */