mirror of
https://github.com/mpv-player/mpv
synced 2024-12-20 13:52:10 +00:00
9f27ebbe63
This was an awkward hack that attempted to avoid the use of 16 bit textures, while still allowing rendering 10-16 bit YUV formats. The idea was that even if the hardware doesn't support 16 bit textures, an A8L8 textures could be used to convert 10 bit (etc.) to 8 bit in the shader, instead of doing this on the CPU. This was an experiment, disabled by default, and was (probably) rarely used. I've never heard of this being used successfully. Remove it.
30 lines
788 B
HLSL
30 lines
788 B
HLSL
// Compile with:
|
|
// fxc.exe /Tps_2_0 /Fhd3d_shader_yuv.h d3d_shader_yuv.hlsl /Vnd3d_shader_yuv
|
|
|
|
// Be careful with this shader. You can't use constant slots, since we don't
|
|
// load the shader with D3DX. All uniform variables are mapped to hardcoded
|
|
// constant slots.
|
|
|
|
sampler2D tex0 : register(s0);
|
|
sampler2D tex1 : register(s1);
|
|
sampler2D tex2 : register(s2);
|
|
|
|
uniform float4x4 colormatrix : register(c0);
|
|
|
|
float1 sample(sampler2D tex, float2 t)
|
|
{
|
|
return tex2D(tex, t).x;
|
|
}
|
|
|
|
float4 main(float2 t0 : TEXCOORD0,
|
|
float2 t1 : TEXCOORD1,
|
|
float2 t2 : TEXCOORD2)
|
|
: COLOR
|
|
{
|
|
float4 c = float4(sample(tex0, t0),
|
|
sample(tex1, t1),
|
|
sample(tex2, t2),
|
|
1);
|
|
return mul(c, colormatrix);
|
|
}
|