From b02e15d1a38b2454d7dba3e05aeb68dfbbddf007 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 1 Dec 2020 14:37:06 +0100 Subject: [PATCH] d3d12: do not inspect NULL samplers We can risk having NULL samplers in this range, so let's ignore them while we're populating the shader-key. Reviewed-by: Jesse Natalie Part-of: --- src/gallium/drivers/d3d12/d3d12_compiler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp b/src/gallium/drivers/d3d12/d3d12_compiler.cpp index 377ebe22831..5b5ef4ca851 100644 --- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp +++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp @@ -738,7 +738,8 @@ d3d12_fill_shader_key(struct d3d12_selection_context *sel_ctx, } for (int i = 0; i < sel_ctx->ctx->num_samplers[stage]; ++i) { - if (sel_ctx->ctx->samplers[stage][i]->filter == PIPE_TEX_FILTER_NEAREST) + if (!sel_ctx->ctx->samplers[stage][i] || + sel_ctx->ctx->samplers[stage][i]->filter == PIPE_TEX_FILTER_NEAREST) continue; if (sel_ctx->ctx->samplers[stage][i]->wrap_r == PIPE_TEX_WRAP_CLAMP)