From 47f4d3e701a6fe12b069d3ef7d43baaaabd2ac4d Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 29 May 2025 16:56:47 -0700 Subject: [PATCH] d3d12: Handle a null threaded context When GALLIUM_THREAD=0, the threaded context doesn't get created and the following lines would fault. Part-of: --- src/gallium/drivers/d3d12/d3d12_context_common.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/d3d12/d3d12_context_common.cpp b/src/gallium/drivers/d3d12/d3d12_context_common.cpp index 42f8fe9c9fb..7f7bcda87aa 100644 --- a/src/gallium/drivers/d3d12/d3d12_context_common.cpp +++ b/src/gallium/drivers/d3d12/d3d12_context_common.cpp @@ -500,8 +500,10 @@ d3d12_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) d3d12_replace_buffer_storage, NULL, &ctx->threaded_context); - ctx->threaded_context->bytes_replaced_limit = 1024 * 1024 * 1024; /* 1GiB */ - threaded_context_init_bytes_mapped_limit(ctx->threaded_context, 4); + if (ctx->threaded_context) { + ctx->threaded_context->bytes_replaced_limit = 1024 * 1024 * 1024; /* 1GiB */ + threaded_context_init_bytes_mapped_limit(ctx->threaded_context, 4); + } return ret; }