mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-08-18 01:44:46 +08:00
gpu: Use DXBC for D3D12 blit shaders on Windows (#16095)
This commit is contained in:
+1892
-3325
File diff suppressed because it is too large
Load Diff
@@ -8430,7 +8430,11 @@ static void D3D12_INTERNAL_InitBlitResources(
|
||||
shaderCreateInfo.code = (Uint8 *)D3D12_FullscreenVert;
|
||||
shaderCreateInfo.code_size = sizeof(D3D12_FullscreenVert);
|
||||
shaderCreateInfo.stage = SDL_GPU_SHADERSTAGE_VERTEX;
|
||||
#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
|
||||
shaderCreateInfo.format = SDL_GPU_SHADERFORMAT_DXIL;
|
||||
#else
|
||||
shaderCreateInfo.format = SDL_GPU_SHADERFORMAT_DXBC;
|
||||
#endif
|
||||
|
||||
renderer->blitVertexShader = D3D12_CreateShader(
|
||||
(SDL_GPURenderer *)renderer,
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
rem This script runs for the Windows build, but also via the _xbox variant with these vars set.
|
||||
rem Make sure to default to building for Windows if they're not set.
|
||||
if %DXC%.==. set DXC=dxc
|
||||
if %COMPILER%.==. set COMPILER=fxc
|
||||
if %SUFFIX%.==. set SUFFIX=.h
|
||||
if %MODEL%.==. set MODEL=5_1
|
||||
|
||||
echo Building with %DXC%
|
||||
echo Building with %COMPILER%
|
||||
echo Suffix %SUFFIX%
|
||||
echo Shader Model %MODEL%
|
||||
|
||||
cd "%~dp0"
|
||||
|
||||
%DXC% -E FullscreenVert -T vs_6_0 -Fh D3D12_FullscreenVert.h D3D_Blit.hlsl
|
||||
%DXC% -E BlitFrom2D -T ps_6_0 -Fh D3D12_BlitFrom2D.h D3D_Blit.hlsl
|
||||
%DXC% -E BlitFrom2DArray -T ps_6_0 -Fh D3D12_BlitFrom2DArray.h D3D_Blit.hlsl
|
||||
%DXC% -E BlitFrom3D -T ps_6_0 -Fh D3D12_BlitFrom3D.h D3D_Blit.hlsl
|
||||
%DXC% -E BlitFromCube -T ps_6_0 -Fh D3D12_BlitFromCube.h D3D_Blit.hlsl
|
||||
%DXC% -E BlitFromCubeArray -T ps_6_0 -Fh D3D12_BlitFromCubeArray.h D3D_Blit.hlsl
|
||||
%COMPILER% -E FullscreenVert -T vs_%MODEL% -Fh D3D12_FullscreenVert.h D3D_Blit.hlsl
|
||||
%COMPILER% -E BlitFrom2D -T ps_%MODEL% -Fh D3D12_BlitFrom2D.h D3D_Blit.hlsl
|
||||
%COMPILER% -E BlitFrom2DArray -T ps_%MODEL% -Fh D3D12_BlitFrom2DArray.h D3D_Blit.hlsl
|
||||
%COMPILER% -E BlitFrom3D -T ps_%MODEL% -Fh D3D12_BlitFrom3D.h D3D_Blit.hlsl
|
||||
%COMPILER% -E BlitFromCube -T ps_%MODEL% -Fh D3D12_BlitFromCube.h D3D_Blit.hlsl
|
||||
%COMPILER% -E BlitFromCubeArray -T ps_%MODEL% -Fh D3D12_BlitFromCubeArray.h D3D_Blit.hlsl
|
||||
copy /b D3D12_FullscreenVert.h+D3D12_BlitFrom2D.h+D3D12_BlitFrom2DArray.h+D3D12_BlitFrom3D.h+D3D12_BlitFromCube.h+D3D12_BlitFromCubeArray.h D3D12_Blit%SUFFIX%
|
||||
del D3D12_FullscreenVert.h D3D12_BlitFrom2D.h D3D12_BlitFrom2DArray.h D3D12_BlitFrom3D.h D3D12_BlitFromCube.h D3D12_BlitFromCubeArray.h
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
if %2.==one. goto setxboxone
|
||||
rem Xbox Series compile
|
||||
set DXC="%GameDKLatest%\GXDK\bin\Scarlett\DXC.exe"
|
||||
set COMPILER="%GameDKLatest%\GXDK\bin\Scarlett\DXC.exe"
|
||||
set SUFFIX=_Series.h
|
||||
goto startbuild
|
||||
|
||||
:setxboxone
|
||||
set DXC="%GameDKLatest%\GXDK\bin\XboxOne\DXC.exe"
|
||||
set COMPILER="%GameDKLatest%\GXDK\bin\XboxOne\DXC.exe"
|
||||
set SUFFIX=_One.h
|
||||
|
||||
:startbuild
|
||||
|
||||
set MODEL=6_0
|
||||
call "%~dp0\compile_shaders.bat"
|
||||
|
||||
Reference in New Issue
Block a user