2022-02-09 03:43:25 +00:00
|
|
|
Texture2D<min16float> luminancePlane : register(t0);
|
|
|
|
Texture2D<min16float2> chrominancePlane : register(t1);
|
2022-02-05 03:51:34 +00:00
|
|
|
SamplerState theSampler : register(s0);
|
|
|
|
|
|
|
|
cbuffer CSC_CONST_BUF : register(b0)
|
|
|
|
{
|
2022-02-09 03:43:25 +00:00
|
|
|
min16float3x3 cscMatrix;
|
|
|
|
min16float3 offsets;
|
2022-02-05 03:51:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ShaderInput
|
|
|
|
{
|
2022-02-13 19:41:39 +00:00
|
|
|
float4 pos : SV_POSITION;
|
|
|
|
float2 tex : TEXCOORD0;
|
2022-02-05 03:51:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
min16float4 main(ShaderInput input) : SV_TARGET
|
|
|
|
{
|
2022-02-09 03:43:25 +00:00
|
|
|
min16float3 yuv = min16float3(luminancePlane.Sample(theSampler, input.tex),
|
|
|
|
chrominancePlane.Sample(theSampler, input.tex));
|
2022-02-05 03:51:34 +00:00
|
|
|
|
|
|
|
// Subtract the YUV offset for limited vs full range
|
|
|
|
yuv -= offsets;
|
|
|
|
|
|
|
|
// Multiply by the conversion matrix for this colorspace
|
|
|
|
yuv = mul(yuv, cscMatrix);
|
|
|
|
|
2022-02-10 02:46:02 +00:00
|
|
|
return min16float4(yuv, 1.0);
|
2022-02-05 03:51:34 +00:00
|
|
|
}
|