GPU: Update to set supported shader formats inside CreateDevice

(cherry picked from commit 8289656a4e)
This commit is contained in:
Logan authored and Sam Lantinga committed 2025-05-18 18:33:07 -07:00
1 parent b55cfaf90b
commit 9571b0ece8
4 files changed
+17 -1

No files matched your search

-1
View File
@@ -672,7 +672,6 @@ SDL_GPUDevice *SDL_CreateGPUDeviceWithProperties(SDL_PropertiesID props)
result = selectedBackend->CreateDevice(debug_mode, preferLowPower, props);
if (result != NULL) {
result->backend = selectedBackend->name;
result->shader_formats = selectedBackend->shader_formats;
result->debug_mode = debug_mode;
}
}
+15
View File
@@ -9159,8 +9159,23 @@ static SDL_GPUDevice *D3D12_CreateDevice(bool debugMode, bool preferLowPower, SD
return NULL;
}
SDL_GPUShaderFormat shaderFormats = SDL_GPU_SHADERFORMAT_DXBC;
D3D12_FEATURE_DATA_SHADER_MODEL shaderModel;
shaderModel.HighestShaderModel = D3D_SHADER_MODEL_6_0;
res = ID3D12Device_CheckFeatureSupport(
renderer->device,
D3D12_FEATURE_SHADER_MODEL,
&shaderModel,
sizeof(shaderModel));
if (SUCCEEDED(res) && shaderModel.HighestShaderModel >= D3D_SHADER_MODEL_6_0) {
shaderFormats |= SDL_GPU_SHADERFORMAT_DXIL;
}
ASSIGN_DRIVER(D3D12)
result->driverData = (SDL_GPURenderer *)renderer;
result->shader_formats = shaderFormats;
result->debug_mode = debugMode;
renderer->sdlGPUDevice = result;
+1
View File
@@ -4570,6 +4570,7 @@ static SDL_GPUDevice *METAL_CreateDevice(bool debugMode, bool preferLowPower, SD
SDL_GPUDevice *result = SDL_calloc(1, sizeof(SDL_GPUDevice));
ASSIGN_DRIVER(METAL)
result->driverData = (SDL_GPURenderer *)renderer;
result->shader_formats = SDL_GPU_SHADERFORMAT_MSL | SDL_GPU_SHADERFORMAT_METALLIB;
renderer->sdlGPUDevice = result;
return result;
+1
View File
@@ -11693,6 +11693,7 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
ASSIGN_DRIVER(VULKAN)
result->driverData = (SDL_GPURenderer *)renderer;
result->shader_formats = SDL_GPU_SHADERFORMAT_SPIRV;
/*
* Create initial swapchain array