diff --git a/app/shaders/d3d11_video_pixel_end.hlsli b/app/shaders/d3d11_video_pixel_end.hlsli deleted file mode 100644 index 0e30bbeb..00000000 --- a/app/shaders/d3d11_video_pixel_end.hlsli +++ /dev/null @@ -1,14 +0,0 @@ -min16float4 main(ShaderInput input) : SV_TARGET -{ - // Clamp the chrominance texcoords to avoid sampling the row of texels adjacent to the alignment padding - min16float3 yuv = min16float3(luminancePlane.Sample(theSampler, input.tex), - chrominancePlane.Sample(theSampler, min(input.tex + chromaOffset, chromaTexMax.rg))); - - // Subtract the YUV offset for limited vs full range - yuv -= offsets; - - // Multiply by the conversion matrix for this colorspace - yuv = mul(yuv, cscMatrix); - - return min16float4(yuv, 1.0); -} \ No newline at end of file diff --git a/app/shaders/d3d11_video_pixel_start.hlsli b/app/shaders/d3d11_video_pixel_start.hlsli deleted file mode 100644 index a148ff98..00000000 --- a/app/shaders/d3d11_video_pixel_start.hlsli +++ /dev/null @@ -1,14 +0,0 @@ -Texture2D luminancePlane : register(t0); -Texture2D chrominancePlane : register(t1); -SamplerState theSampler : register(s0); - -struct ShaderInput -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD0; -}; - -cbuffer ChromaLimitBuf : register(b0) -{ - min16float3 chromaTexMax; -}; diff --git a/app/shaders/d3d11_yuv420_pixel.hlsl b/app/shaders/d3d11_yuv420_pixel.hlsl index 1cb8bf92..9b68b400 100644 --- a/app/shaders/d3d11_yuv420_pixel.hlsl +++ b/app/shaders/d3d11_yuv420_pixel.hlsl @@ -1,4 +1,17 @@ -#include "d3d11_video_pixel_start.hlsli" +Texture2D luminancePlane : register(t0); +Texture2D chrominancePlane : register(t1); +SamplerState theSampler : register(s0); + +struct ShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; +}; + +cbuffer ChromaLimitBuf : register(b0) +{ + min16float3 chromaTexMax; +}; cbuffer CSC_CONST_BUF : register(b1) { @@ -7,4 +20,17 @@ cbuffer CSC_CONST_BUF : register(b1) min16float2 chromaOffset; }; -#include "d3d11_video_pixel_end.hlsli" \ No newline at end of file +min16float4 main(ShaderInput input) : SV_TARGET +{ + // Clamp the chrominance texcoords to avoid sampling the row of texels adjacent to the alignment padding + min16float3 yuv = min16float3(luminancePlane.Sample(theSampler, input.tex), + chrominancePlane.Sample(theSampler, min(input.tex + chromaOffset, chromaTexMax.rg))); + + // Subtract the YUV offset for limited vs full range + yuv -= offsets; + + // Multiply by the conversion matrix for this colorspace + yuv = mul(yuv, cscMatrix); + + return min16float4(yuv, 1.0); +} \ No newline at end of file