mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-01 07:15:27 +00:00
14 lines
551 B
HLSL
14 lines
551 B
HLSL
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, 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);
|
|
} |