Refactor D3D11 shaders to reduce duplicated code

This commit is contained in:
Cameron Gutman
2022-02-16 19:38:18 -06:00
parent b1f980c216
commit 36db791516
9 changed files with 25 additions and 63 deletions
+13
View File
@@ -0,0 +1,13 @@
min16float4 main(ShaderInput input) : SV_TARGET
{
min16float3 yuv = min16float3(luminancePlane.Sample(theSampler, input.tex),
chrominancePlane.Sample(theSampler, input.tex));
// 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);
}