Implement D3D11VA video rendering
This commit is contained in:
parent
67612f607e
commit
f256407789
8 changed files with 362 additions and 35 deletions
|
|
@ -1,3 +1,4 @@
|
|||
fxc /T vs_4_0_level_9_3 /Fo d3d11_vertex.fxc d3d11_vertex.hlsl
|
||||
|
||||
fxc /T ps_4_0_level_9_3 /Fo d3d11_overlay_pixel.fxc d3d11_overlay_pixel.hlsl
|
||||
fxc /T ps_4_0_level_9_3 /Fo d3d11_overlay_pixel.fxc d3d11_overlay_pixel.hlsl
|
||||
fxc /T ps_4_0_level_9_3 /Fo d3d11_video_pixel.fxc d3d11_video_pixel.hlsl
|
||||
BIN
app/shaders/d3d11_video_pixel.fxc
Normal file
BIN
app/shaders/d3d11_video_pixel.fxc
Normal file
Binary file not shown.
30
app/shaders/d3d11_video_pixel.hlsl
Normal file
30
app/shaders/d3d11_video_pixel.hlsl
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
Texture2D luminancePlane : register(t0);
|
||||
Texture2D chrominancePlane : register(t1);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
cbuffer CSC_CONST_BUF : register(b0)
|
||||
{
|
||||
float3x3 cscMatrix;
|
||||
float3 offsets;
|
||||
};
|
||||
|
||||
struct ShaderInput
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
};
|
||||
|
||||
min16float4 main(ShaderInput input) : SV_TARGET
|
||||
{
|
||||
float y = luminancePlane.Sample(theSampler, input.tex);
|
||||
float2 uv = chrominancePlane.Sample(theSampler, input.tex);
|
||||
float3 yuv = float3(y, uv);
|
||||
|
||||
// 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.0f);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue