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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35248>
This commit is contained in:
Jesse Natalie
2025-05-29 16:56:47 -07:00
committed by Marge Bot
parent 0c0f6c6df1
commit 47f4d3e701
@@ -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;
}