SDL: GDK: Remove old shader sources, unify shader compilation .bats

From 23ace600fcfade74f6bec2f55a92cf29a32a3694 Mon Sep 17 00:00:00 2001
From: Jade Macho <[EMAIL REDACTED]>
Date: Fri, 1 Mar 2024 15:50:57 +0100
Subject: [PATCH] GDK: Remove old shader sources, unify shader compilation
 .bats

---
 .gitignore                                    |   3 +-
 VisualC-GDK/SDL/SDL.vcxproj                   |   8 +-
 .../shaders/D3D12_PixelShader_Colors.hlsl     |  19 ----
 .../shaders/D3D12_PixelShader_NV12_BT601.hlsl |  43 --------
 .../shaders/D3D12_PixelShader_NV12_BT709.hlsl |  43 --------
 .../shaders/D3D12_PixelShader_NV12_JPEG.hlsl  |  43 --------
 .../shaders/D3D12_PixelShader_NV21_BT601.hlsl |  43 --------
 .../shaders/D3D12_PixelShader_NV21_BT709.hlsl |  43 --------
 .../shaders/D3D12_PixelShader_NV21_JPEG.hlsl  |  43 --------
 .../shaders/D3D12_PixelShader_Textures.hlsl   |  24 ----
 .../shaders/D3D12_PixelShader_YUV_BT601.hlsl  |  46 --------
 .../shaders/D3D12_PixelShader_YUV_BT709.hlsl  |  46 --------
 .../shaders/D3D12_PixelShader_YUV_JPEG.hlsl   |  46 --------
 VisualC-GDK/shaders/D3D12_VertexShader.hlsl   |  95 ----------------
 VisualC-GDK/shaders/buildshaders.bat          |  35 ------
 .../direct3d12/SDL_shaders_d3d12_xboxone.cpp  | 103 ++++++++---------
 .../SDL_shaders_d3d12_xboxseries.cpp          | 104 ++++++++----------
 src/render/direct3d12/compile_shaders.bat     |  28 +++--
 .../direct3d12/compile_shaders_xbox.bat       |  13 +++
 19 files changed, 131 insertions(+), 697 deletions(-)
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_Colors.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_Textures.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG.hlsl
 delete mode 100644 VisualC-GDK/shaders/D3D12_VertexShader.hlsl
 delete mode 100644 VisualC-GDK/shaders/buildshaders.bat
 create mode 100644 src/render/direct3d12/compile_shaders_xbox.bat

diff --git a/.gitignore b/.gitignore
index 9e577f4984231..87d76dacb93ae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,7 +79,8 @@ VisualC/tests/testscale/sample.bmp
 VisualC/tests/testsprite/icon.bmp
 VisualC/tests/testyuv/testyuv.bmp
 VisualC-GDK/**/Layout
-VisualC-GDK/shaders/*.h
+src/render/direct3d12/D3D12_*_One.h
+src/render/direct3d12/D3D12_*_Series.h
 
 # for Android
 android-project/local.properties
diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj
index 283cc8cb5945b..5cc952d412a86 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj
+++ b/VisualC-GDK/SDL/SDL.vcxproj
@@ -171,7 +171,7 @@
       <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
     </Link>
     <PreBuildEvent>
-      <Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir)</Command>
+      <Command>$(SolutionDir)..\src\render\direct3d12\compile_shaders_xbox.bat $(SolutionDir)</Command>
     </PreBuildEvent>
     <PreBuildEvent>
       <Message>Building shader blobs (Xbox Series)</Message>
@@ -205,7 +205,7 @@
       <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
     </Link>
     <PreBuildEvent>
-      <Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir) one</Command>
+      <Command>$(SolutionDir)..\src\render\direct3d12\compile_shaders_xbox.bat $(SolutionDir) one</Command>
     </PreBuildEvent>
     <PreBuildEvent>
       <Message>Building shader blobs (Xbox One)</Message>
@@ -271,7 +271,7 @@
       <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
     </Link>
     <PreBuildEvent>
-      <Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir)</Command>
+      <Command>$(SolutionDir)..\src\render\direct3d12\compile_shaders_xbox.bat $(SolutionDir)</Command>
     </PreBuildEvent>
     <PreBuildEvent>
       <Message>Building shader blobs (Xbox Series)</Message>
@@ -306,7 +306,7 @@
       <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
     </Link>
     <PreBuildEvent>
-      <Command>$(SolutionDir)\shaders\buildshaders.bat $(SolutionDir) one</Command>
+      <Command>$(SolutionDir)..\src\render\direct3d12\compile_shaders_xbox.bat $(SolutionDir) one</Command>
     </PreBuildEvent>
     <PreBuildEvent>
       <Message>Building shader blobs (Xbox One)</Message>
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_Colors.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_Colors.hlsl
deleted file mode 100644
index 47eff4cc2444e..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_Colors.hlsl
+++ /dev/null
@@ -1,19 +0,0 @@
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define ColorRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0)"
-
-[RootSignature(ColorRS)]
-float4 main(PixelShaderInput input) : SV_TARGET0
-{
-    return input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601.hlsl
deleted file mode 100644
index cffbc2261822c..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601.hlsl
+++ /dev/null
@@ -1,43 +0,0 @@
-Texture2D theTextureY : register(t0);
-Texture2D theTextureUV : register(t1);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define NVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(NVRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
-    const float3 Rcoeff = {1.1644,  0.0000,  1.5960};
-    const float3 Gcoeff = {1.1644, -0.3918, -0.8130};
-    const float3 Bcoeff = {1.1644,  2.0172,  0.0000};
-
-    float4 Output;
-
-    float3 yuv;
-    yuv.x = theTextureY.Sample(theSampler, input.tex).r;
-    yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg;
-
-    yuv += offset;
-    Output.r = dot(yuv, Rcoeff);
-    Output.g = dot(yuv, Gcoeff);
-    Output.b = dot(yuv, Bcoeff);
-    Output.a = 1.0f;
-
-    return Output * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709.hlsl
deleted file mode 100644
index 81d409c94eb2c..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709.hlsl
+++ /dev/null
@@ -1,43 +0,0 @@
-Texture2D theTextureY : register(t0);
-Texture2D theTextureUV : register(t1);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define NVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(NVRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
-    const float3 Rcoeff = {1.1644,  0.0000,  1.7927};
-    const float3 Gcoeff = {1.1644, -0.2132, -0.5329};
-    const float3 Bcoeff = {1.1644,  2.1124,  0.0000};
-
-    float4 Output;
-
-    float3 yuv;
-    yuv.x = theTextureY.Sample(theSampler, input.tex).r;
-    yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg;
-
-    yuv += offset;
-    Output.r = dot(yuv, Rcoeff);
-    Output.g = dot(yuv, Gcoeff);
-    Output.b = dot(yuv, Bcoeff);
-    Output.a = 1.0f;
-
-    return Output * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG.hlsl
deleted file mode 100644
index 494bce5192d3b..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG.hlsl
+++ /dev/null
@@ -1,43 +0,0 @@
-Texture2D theTextureY : register(t0);
-Texture2D theTextureUV : register(t1);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define NVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(NVRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    const float3 offset = {0.0, -0.501960814, -0.501960814};
-    const float3 Rcoeff = {1.0000,  0.0000,  1.4020};
-    const float3 Gcoeff = {1.0000, -0.3441, -0.7141};
-    const float3 Bcoeff = {1.0000,  1.7720,  0.0000};
-
-    float4 Output;
-
-    float3 yuv;
-    yuv.x = theTextureY.Sample(theSampler, input.tex).r;
-    yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg;
-
-    yuv += offset;
-    Output.r = dot(yuv, Rcoeff);
-    Output.g = dot(yuv, Gcoeff);
-    Output.b = dot(yuv, Bcoeff);
-    Output.a = 1.0f;
-
-    return Output * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601.hlsl
deleted file mode 100644
index 794c763728af1..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601.hlsl
+++ /dev/null
@@ -1,43 +0,0 @@
-Texture2D theTextureY : register(t0);
-Texture2D theTextureUV : register(t1);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define NVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(NVRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
-    const float3 Rcoeff = {1.1644,  0.0000,  1.5960};
-    const float3 Gcoeff = {1.1644, -0.3918, -0.8130};
-    const float3 Bcoeff = {1.1644,  2.0172,  0.0000};
-
-    float4 Output;
-
-    float3 yuv;
-    yuv.x = theTextureY.Sample(theSampler, input.tex).r;
-    yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr;
-
-    yuv += offset;
-    Output.r = dot(yuv, Rcoeff);
-    Output.g = dot(yuv, Gcoeff);
-    Output.b = dot(yuv, Bcoeff);
-    Output.a = 1.0f;
-
-    return Output * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709.hlsl
deleted file mode 100644
index f5b9522c0f8c5..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709.hlsl
+++ /dev/null
@@ -1,43 +0,0 @@
-Texture2D theTextureY : register(t0);
-Texture2D theTextureUV : register(t1);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define NVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(NVRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
-    const float3 Rcoeff = {1.1644,  0.0000,  1.7927};
-    const float3 Gcoeff = {1.1644, -0.2132, -0.5329};
-    const float3 Bcoeff = {1.1644,  2.1124,  0.0000};
-
-    float4 Output;
-
-    float3 yuv;
-    yuv.x = theTextureY.Sample(theSampler, input.tex).r;
-    yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr;
-
-    yuv += offset;
-    Output.r = dot(yuv, Rcoeff);
-    Output.g = dot(yuv, Gcoeff);
-    Output.b = dot(yuv, Bcoeff);
-    Output.a = 1.0f;
-
-    return Output * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG.hlsl
deleted file mode 100644
index 1b467b480369e..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG.hlsl
+++ /dev/null
@@ -1,43 +0,0 @@
-Texture2D theTextureY : register(t0);
-Texture2D theTextureUV : register(t1);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define NVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(NVRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    const float3 offset = {0.0, -0.501960814, -0.501960814};
-    const float3 Rcoeff = {1.0000,  0.0000,  1.4020};
-    const float3 Gcoeff = {1.0000, -0.3441, -0.7141};
-    const float3 Bcoeff = {1.0000,  1.7720,  0.0000};
-
-    float4 Output;
-
-    float3 yuv;
-    yuv.x = theTextureY.Sample(theSampler, input.tex).r;
-    yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr;
-
-    yuv += offset;
-    Output.r = dot(yuv, Rcoeff);
-    Output.g = dot(yuv, Gcoeff);
-    Output.b = dot(yuv, Bcoeff);
-    Output.a = 1.0f;
-
-    return Output * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_Textures.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_Textures.hlsl
deleted file mode 100644
index 0dcdf89c69bab..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_Textures.hlsl
+++ /dev/null
@@ -1,24 +0,0 @@
-Texture2D theTexture : register(t0);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define TextureRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(TextureRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    return theTexture.Sample(theSampler, input.tex) * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601.hlsl
deleted file mode 100644
index 09e58943a7f8e..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601.hlsl
+++ /dev/null
@@ -1,46 +0,0 @@
-Texture2D theTextureY : register(t0);
-Texture2D theTextureU : register(t1);
-Texture2D theTextureV : register(t2);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define YUVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(YUVRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
-    const float3 Rcoeff = {1.1644,  0.0000,  1.5960};
-    const float3 Gcoeff = {1.1644, -0.3918, -0.8130};
-    const float3 Bcoeff = {1.1644,  2.0172,  0.0000};
-
-    float4 Output;
-
-    float3 yuv;
-    yuv.x = theTextureY.Sample(theSampler, input.tex).r;
-    yuv.y = theTextureU.Sample(theSampler, input.tex).r;
-    yuv.z = theTextureV.Sample(theSampler, input.tex).r;
-
-    yuv += offset;
-    Output.r = dot(yuv, Rcoeff);
-    Output.g = dot(yuv, Gcoeff);
-    Output.b = dot(yuv, Bcoeff);
-    Output.a = 1.0f;
-
-    return Output * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709.hlsl
deleted file mode 100644
index f5aa0cd7e4abb..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709.hlsl
+++ /dev/null
@@ -1,46 +0,0 @@
-Texture2D theTextureY : register(t0);
-Texture2D theTextureU : register(t1);
-Texture2D theTextureV : register(t2);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define YUVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(YUVRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    const float3 offset = {-0.0627451017, -0.501960814, -0.501960814};
-    const float3 Rcoeff = {1.1644,  0.0000,  1.7927};
-    const float3 Gcoeff = {1.1644, -0.2132, -0.5329};
-    const float3 Bcoeff = {1.1644,  2.1124,  0.0000};
-
-    float4 Output;
-
-    float3 yuv;
-    yuv.x = theTextureY.Sample(theSampler, input.tex).r;
-    yuv.y = theTextureU.Sample(theSampler, input.tex).r;
-    yuv.z = theTextureV.Sample(theSampler, input.tex).r;
-
-    yuv += offset;
-    Output.r = dot(yuv, Rcoeff);
-    Output.g = dot(yuv, Gcoeff);
-    Output.b = dot(yuv, Bcoeff);
-    Output.a = 1.0f;
-
-    return Output * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG.hlsl
deleted file mode 100644
index 84d09b8bff031..0000000000000
--- a/VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG.hlsl
+++ /dev/null
@@ -1,46 +0,0 @@
-Texture2D theTextureY : register(t0);
-Texture2D theTextureU : register(t1);
-Texture2D theTextureV : register(t2);
-SamplerState theSampler : register(s0);
-
-struct PixelShaderInput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define YUVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(YUVRS)]
-float4 main(PixelShaderInput input) : SV_TARGET
-{
-    const float3 offset = {0.0, -0.501960814, -0.501960814};
-    const float3 Rcoeff = {1.0000,  0.0000,  1.4020};
-    const float3 Gcoeff = {1.0000, -0.3441, -0.7141};
-    const float3 Bcoeff = {1.0000,  1.7720,  0.0000};
-
-    float4 Output;
-
-    float3 yuv;
-    yuv.x = theTextureY.Sample(theSampler, input.tex).r;
-    yuv.y = theTextureU.Sample(theSampler, input.tex).r;
-    yuv.z = theTextureV.Sample(theSampler, input.tex).r;
-
-    yuv += offset;
-    Output.r = dot(yuv, Rcoeff);
-    Output.g = dot(yuv, Gcoeff);
-    Output.b = dot(yuv, Bcoeff);
-    Output.a = 1.0f;
-
-    return Output * input.color;
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/D3D12_VertexShader.hlsl b/VisualC-GDK/shaders/D3D12_VertexShader.hlsl
deleted file mode 100644
index e10b488925ef2..0000000000000
--- a/VisualC-GDK/shaders/D3D12_VertexShader.hlsl
+++ /dev/null
@@ -1,95 +0,0 @@
-#pragma pack_matrix( row_major )
-
-struct VertexShaderConstants
-{
-    matrix model;
-    matrix projectionAndView;
-};
-ConstantBuffer<VertexShaderConstants> Constants : register(b0);
-
-struct VertexShaderInput
-{
-    float3 pos : POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-struct VertexShaderOutput
-{
-    float4 pos : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float4 color : COLOR0;
-};
-
-#define ColorRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0)"
-
-#define TextureRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-#define YUVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-#define NVRS \
-    "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
-    "            DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
-    "            DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
-    "            DENY_HULL_SHADER_ROOT_ACCESS )," \
-    "RootConstants(num32BitConstants=32, b0),"\
-    "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
-    "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
-
-[RootSignature(ColorRS)]
-VertexShaderOutput mainColor(VertexShaderInput input)
-{
-    VertexShaderOutput output;
-    float4 pos = float4(input.pos, 1.0f);
-
-    // Transform the vertex position into projected space.
-    pos = mul(pos, Constants.model);
-    pos = mul(pos, Constants.projectionAndView);
-    output.pos = pos;
-
-    // Pass through texture coordinates and color values without transformation
-    output.tex = input.tex;
-    output.color = input.color;
-
-    return output;
-}
-
-[RootSignature(TextureRS)]
-VertexShaderOutput mainTexture(VertexShaderInput input)
-{
-    return mainColor(input);
-}
-
-[RootSignature(YUVRS)]
-VertexShaderOutput mainYUV(VertexShaderInput input)
-{
-    return mainColor(input);
-}
-
-[RootSignature(NVRS)]
-VertexShaderOutput mainNV(VertexShaderInput input)
-{
-    return mainColor(input);
-}
\ No newline at end of file
diff --git a/VisualC-GDK/shaders/buildshaders.bat b/VisualC-GDK/shaders/buildshaders.bat
deleted file mode 100644
index 4447b5e2f8267..0000000000000
--- a/VisualC-GDK/shaders/buildshaders.bat
+++ /dev/null
@@ -1,35 +0,0 @@
-if %2.==one. goto setxboxone
-rem Xbox Series compile
-set XBOXDXC="%GameDKLatest%\GXDK\bin\Scarlett\DXC.exe"
-set SUFFIX=_Series.h
-goto startbuild
-
-:setxboxone
-set XBOXDXC="%GameDKLatest%\GXDK\bin\XboxOne\DXC.exe"
-set SUFFIX=_One.h
-
-:startbuild
-echo Building with %XBOXDXC%
-cd "%1\shaders"
-rem Root Signatures
-%XBOXDXC% -E ColorRS -T rootsig_1_1 -rootsig-define ColorRS -Fh D3D12_RootSig_Color%SUFFIX% -Vn D3D12_RootSig_Color D3D12_VertexShader.hlsl
-%XBOXDXC% -E TextureRS -T rootsig_1_1 -rootsig-define TextureRS -Fh D3D12_RootSig_Texture%SUFFIX% -Vn D3D12_RootSig_Texture D3D12_VertexShader.hlsl
-%XBOXDXC% -E YUVRS -T rootsig_1_1 -rootsig-define YUVRS -Fh D3D12_RootSig_YUV%SUFFIX% -Vn D3D12_RootSig_YUV D3D12_VertexShader.hlsl
-%XBOXDXC% -E NVRS -T rootsig_1_1 -rootsig-define NVRS -Fh D3D12_RootSig_NV%SUFFIX% -Vn D3D12_RootSig_NV D3D12_VertexShader.hlsl
-rem Vertex Shaders
-%XBOXDXC% -E mainColor -T vs_6_0 -Fh D3D12_VertexShader_Color%SUFFIX% -Vn D3D12_VertexShader_Color D3D12_VertexShader.hlsl
-%XBOXDXC% -E mainTexture -T vs_6_0 -Fh D3D12_VertexShader_Texture%SUFFIX% -Vn D3D12_VertexShader_Texture D3D12_VertexShader.hlsl
-%XBOXDXC% -E mainNV -T vs_6_0 -Fh D3D12_VertexShader_NV%SUFFIX% -Vn D3D12_VertexShader_NV D3D12_VertexShader.hlsl
-%XBOXDXC% -E mainYUV -T vs_6_0 -Fh D3D12_VertexShader_YUV%SUFFIX% -Vn D3D12_VertexShader_YUV D3D12_VertexShader.hlsl
-rem Pixel Shaders
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_Colors%SUFFIX% -Vn D3D12_PixelShader_Colors D3D12_PixelShader_Colors.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV12_BT601%SUFFIX% -Vn D3D12_PixelShader_NV12_BT601 D3D12_PixelShader_NV12_BT601.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV12_BT709%SUFFIX% -Vn D3D12_PixelShader_NV12_BT709 D3D12_PixelShader_NV12_BT709.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV12_JPEG%SUFFIX% -Vn D3D12_PixelShader_NV12_JPEG D3D12_PixelShader_NV12_JPEG.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV21_BT601%SUFFIX% -Vn D3D12_PixelShader_NV21_BT601 D3D12_PixelShader_NV21_BT601.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV21_BT709%SUFFIX% -Vn D3D12_PixelShader_NV21_BT709 D3D12_PixelShader_NV21_BT709.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV21_JPEG%SUFFIX% -Vn D3D12_PixelShader_NV21_JPEG D3D12_PixelShader_NV21_JPEG.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_Textures%SUFFIX% -Vn D3D12_PixelShader_Textures D3D12_PixelShader_Textures.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_YUV_BT601%SUFFIX% -Vn D3D12_PixelShader_YUV_BT601 D3D12_PixelShader_YUV_BT601.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_YUV_BT709%SUFFIX% -Vn D3D12_PixelShader_YUV_BT709 D3D12_PixelShader_YUV_BT709.hlsl
-%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_YUV_JPEG%SUFFIX% -Vn D3D12_PixelShader_YUV_JPEG D3D12_PixelShader_YUV_JPEG.hlsl
\ No newline at end of file
diff --git a/src/render/direct3d12/SDL_shaders_d3d12_xboxone.cpp b/src/render/direct3d12/SDL_shaders_d3d12_xboxone.cpp
index f0f4f72a3fdbe..829e075563398 100644
--- a/src/render/direct3d12/SDL_shaders_d3d12_xboxone.cpp
+++ b/src/render/direct3d12/SDL_shaders_d3d12_xboxone.cpp
@@ -31,28 +31,46 @@
 
 #define SDL_COMPOSE_ERROR(str) SDL_STRINGIFY_ARG(__FUNCTION__) ", " str
 
-/* Shader blob headers are generated with a pre-build step using buildshaders.bat */
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_Colors_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_Textures_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709_One.h"
-#include "../VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG_One.h"
-
-#include "../VisualC-GDK/shaders/D3D12_VertexShader_Color_One.h"
-#include "../VisualC-GDK/shaders/D3D12_VertexShader_NV_One.h"
-#include "../VisualC-GDK/shaders/D3D12_VertexShader_Texture_One.h"
-#include "../VisualC-GDK/shaders/D3D12_VertexShader_YUV_One.h"
-
-#include "../VisualC-GDK/shaders/D3D12_RootSig_Color_One.h"
-#include "../VisualC-GDK/shaders/D3D12_RootSig_NV_One.h"
-#include "../VisualC-GDK/shaders/D3D12_RootSig_Texture_One.h"
-#include "../VisualC-GDK/shaders/D3D12_RootSig_YUV_One.h"
+/* Shader blob headers are generated with a pre-build step using compile_shaders_xbox.bat */
+
+#define g_main D3D12_PixelShader_Colors
+#include "D3D12_PixelShader_Colors_One.h"
+#undef g_main
+
+#define g_main D3D12_PixelShader_Textures
+#include "D3D12_PixelShader_Textures_One.h"
+#undef g_main
+
+#define g_main D3D12_PixelShader_Advanced
+#include "D3D12_PixelShader_Advanced_One.h"
+#undef g_main
+
+
+#define g_mainColor D3D12_VertexShader_Colors
+#include "D3D12_VertexShader_Color_One.h"
+#undef g_mainColor
+
+#define g_mainTexture D3D12_VertexShader_Textures
+#include "D3D12_VertexShader_Texture_One.h"
+#undef g_mainTexture
+
+#define g_mainAdvanced D3D12_VertexShader_Advanced
+#include "D3D12_VertexShader_Advanced_One.h"
+#undef g_mainAdvanced
+
+
+#define g_ColorRS D3D12_RootSig_Color
+#include "D3D12_RootSig_Color_One.h"
+#undef g_ColorRS
+
+#define g_TextureRS D3D12_RootSig_Texture
+#include "D3D12_RootSig_Texture_One.h"
+#undef g_TextureRS
+
+#define g_AdvancedRS D3D12_RootSig_Advanced
+#include "D3D12_RootSig_Advanced_

(Patch may be truncated, please check the link at the top of this post.)