mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-11 11:20:45 +02:00
Don't call function pointer when it is NULL
This commit is contained in:
committed by
Sam Lantinga
parent
463b6be133
commit
dc16a35140
@@ -9633,17 +9633,14 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
|
||||
if (SDL_HasProperty(props, SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING) && SDL_HasProperty(props, SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER)) {
|
||||
int d3d12SDKVersion = SDL_GetNumberProperty(props, SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER, 0);
|
||||
const char *d3d12SDKPath = SDL_GetStringProperty(props, SDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING, ".\\D3D12\\");
|
||||
ID3D12SDKConfiguration *sdk_config = NULL;
|
||||
|
||||
pD3D12GetInterface = (PFN_D3D12_GET_INTERFACE)SDL_LoadFunction(
|
||||
renderer->d3d12_dll,
|
||||
D3D12_GET_INTERFACE_FUNC);
|
||||
if (pD3D12GetInterface == NULL) {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_GPU, "Could not load D3D12GetInterface, custom D3D12 SDK will not load.");
|
||||
}
|
||||
|
||||
ID3D12SDKConfiguration *sdk_config = NULL;
|
||||
|
||||
if (SUCCEEDED(pD3D12GetInterface(D3D_GUID(D3D_CLSID_ID3D12SDKConfiguration), D3D_GUID(D3D_IID_ID3D12SDKConfiguration), (void**) &sdk_config))) {
|
||||
} else if (SUCCEEDED(pD3D12GetInterface(D3D_GUID(D3D_CLSID_ID3D12SDKConfiguration), D3D_GUID(D3D_IID_ID3D12SDKConfiguration), (void**) &sdk_config))) {
|
||||
ID3D12SDKConfiguration1 *sdk_config1 = NULL;
|
||||
if (SUCCEEDED(IUnknown_QueryInterface(sdk_config, &D3D_IID_ID3D12SDKConfiguration1, (void**) &sdk_config1))) {
|
||||
if (SUCCEEDED(ID3D12SDKConfiguration1_CreateDeviceFactory(sdk_config1, d3d12SDKVersion, d3d12SDKPath, &D3D_IID_ID3D12DeviceFactory, (void**) &factory))) {
|
||||
|
||||
Reference in New Issue
Block a user