mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-16 22:23:07 +00:00
29 lines
No EOL
770 B
HLSL
29 lines
No EOL
770 B
HLSL
Texture2D<min16float> luminancePlane : register(t0);
|
|
Texture2D<min16float2> chrominancePlane : register(t1);
|
|
SamplerState theSampler : register(s0);
|
|
|
|
cbuffer CSC_CONST_BUF : register(b0)
|
|
{
|
|
min16float3x3 cscMatrix;
|
|
min16float3 offsets;
|
|
};
|
|
|
|
struct ShaderInput
|
|
{
|
|
min16float4 pos : SV_POSITION;
|
|
min16float2 tex : TEXCOORD0;
|
|
};
|
|
|
|
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(saturate(yuv), 1.0);
|
|
} |