Skip to content

Commit

Permalink
GPU: Remove D3D11 backend and allow D3D12 to ingest DXBC (libsdl-org#…
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcosmonaut authored Nov 12, 2024
1 parent fc12cc6 commit 119b4fa
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 8,305 deletions.
1 change: 0 additions & 1 deletion VisualC-GDK/SDL/SDL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,6 @@
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_std.c" />
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c" />
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c">
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
Expand Down
1 change: 0 additions & 1 deletion VisualC-GDK/SDL/SDL.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<ClCompile Include="..\..\src\file\SDL_iostream.c" />
<ClCompile Include="..\..\src\filesystem\gdk\SDL_sysfilesystem.cpp" />
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c" />
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c" />
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
Expand Down
1 change: 0 additions & 1 deletion VisualC/SDL/SDL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c" />
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c" />
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
Expand Down
3 changes: 0 additions & 3 deletions VisualC/SDL/SDL.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1601,9 +1601,6 @@
<ClCompile Include="..\..\src\gpu\SDL_gpu.c">
<Filter>gpu</Filter>
</ClCompile>
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c">
<Filter>gpu</Filter>
</ClCompile>
<ClCompile Include="..\..\src\gpu\d3d12\SDL_gpu_d3d12.c">
<Filter>gpu</Filter>
</ClCompile>
Expand Down
23 changes: 4 additions & 19 deletions include/SDL3/SDL_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,8 @@ typedef Uint32 SDL_GPUShaderFormat;
#define SDL_GPU_SHADERFORMAT_INVALID 0
#define SDL_GPU_SHADERFORMAT_PRIVATE (1u << 0) /**< Shaders for NDA'd platforms. */
#define SDL_GPU_SHADERFORMAT_SPIRV (1u << 1) /**< SPIR-V shaders for Vulkan. */
#define SDL_GPU_SHADERFORMAT_DXBC (1u << 2) /**< DXBC SM5_0 shaders for D3D11. */
#define SDL_GPU_SHADERFORMAT_DXIL (1u << 3) /**< DXIL shaders for D3D12. */
#define SDL_GPU_SHADERFORMAT_DXBC (1u << 2) /**< DXBC SM5_1 shaders for D3D12. */
#define SDL_GPU_SHADERFORMAT_DXIL (1u << 3) /**< DXIL SM6_0 shaders for D3D12. */
#define SDL_GPU_SHADERFORMAT_MSL (1u << 4) /**< MSL shaders for Metal. */
#define SDL_GPU_SHADERFORMAT_METALLIB (1u << 5) /**< Precompiled metallib shaders for Metal. */

Expand Down Expand Up @@ -2076,15 +2076,7 @@ extern SDL_DECLSPEC SDL_GPUShaderFormat SDLCALL SDL_GetGPUShaderFormats(SDL_GPUD
* - 1: Write-only storage textures, followed by write-only storage buffers
* - 2: Uniform buffers
*
* For DXBC Shader Model 5_0 shaders, use the following register order:
*
* - t registers: Sampled textures, followed by read-only storage textures,
* followed by read-only storage buffers
* - u registers: Write-only storage textures, followed by write-only storage
* buffers
* - b registers: Uniform buffers
*
* For DXIL shaders, use the following register order:
* For DXBC and DXIL shaders, use the following register order:
*
* - (t[n], space0): Sampled textures, followed by read-only storage textures,
* followed by read-only storage buffers
Expand Down Expand Up @@ -2172,14 +2164,7 @@ extern SDL_DECLSPEC SDL_GPUSampler *SDLCALL SDL_CreateGPUSampler(
* buffers
* - 3: Uniform buffers
*
* For DXBC Shader Model 5_0 shaders, use the following register order:
*
* - t registers: Sampled textures, followed by storage textures, followed by
* storage buffers
* - s registers: Samplers with indices corresponding to the sampled textures
* - b registers: Uniform buffers
*
* For DXIL shaders, use the following register order:
* For DXBC and DXIL shaders, use the following register order:
*
* For vertex shaders:
*
Expand Down
1 change: 0 additions & 1 deletion src/SDL_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@
#endif // SDL_RENDER_DISABLED

#ifdef SDL_GPU_DISABLED
#undef SDL_GPU_D3D11
#undef SDL_GPU_D3D12
#undef SDL_GPU_METAL
#undef SDL_GPU_VULKAN
Expand Down
3 changes: 0 additions & 3 deletions src/gpu/SDL_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ static const SDL_GPUBootstrap *backends[] = {
#endif
#ifdef SDL_GPU_D3D12
&D3D12Driver,
#endif
#ifdef SDL_GPU_D3D11
&D3D11Driver,
#endif
NULL
};
Expand Down
1 change: 0 additions & 1 deletion src/gpu/SDL_sysgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,6 @@ extern "C" {
#endif

extern SDL_GPUBootstrap VulkanDriver;
extern SDL_GPUBootstrap D3D11Driver;
extern SDL_GPUBootstrap D3D12Driver;
extern SDL_GPUBootstrap MetalDriver;
extern SDL_GPUBootstrap PS5Driver;
Expand Down
Loading

0 comments on commit 119b4fa

Please sign in to comment.