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 <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7856>
This commit is contained in:
Erik Faye-Lund 2020-12-01 14:37:06 +01:00 committed by Marge Bot
parent 94f8cb29ee
commit b02e15d1a3

View file

@ -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)