Skip to content

Commit

Permalink
Null guard on SDL_DxcCreateInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcosmonaut committed Nov 7, 2024
1 parent 5aaa396 commit 632d502
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SDL_gpu_shadercross.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ static void *SDL_ShaderCross_INTERNAL_CompileUsingDXC(
IDxcCompiler3 *dxcInstance = NULL;

#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
if (SDL_DxcCreateInstance == NULL) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s", "DxcCreateInstance function not loaded. Did you forget to call Init?");
return NULL;
}
SDL_DxcCreateInstance(
&CLSID_DxcCompiler,
IID_IDxcCompiler3,
Expand Down

0 comments on commit 632d502

Please sign in to comment.