diff --git a/app/shaders/build_hlsl.bat b/app/shaders/build_hlsl.bat index 4a8389ab..0fd15d53 100644 --- a/app/shaders/build_hlsl.bat +++ b/app/shaders/build_hlsl.bat @@ -1,6 +1,6 @@ -fxc /T vs_4_0_level_9_3 /Fo d3d11_vertex.fxc d3d11_vertex.hlsl +fxc /T vs_4_0 /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_genyuv_pixel.fxc d3d11_genyuv_pixel.hlsl -fxc /T ps_4_0_level_9_3 /Fo d3d11_bt601lim_pixel.fxc d3d11_bt601lim_pixel.hlsl -fxc /T ps_4_0_level_9_3 /Fo d3d11_bt2020lim_pixel.fxc d3d11_bt2020lim_pixel.hlsl \ No newline at end of file +fxc /T ps_4_0 /Fo d3d11_overlay_pixel.fxc d3d11_overlay_pixel.hlsl +fxc /T ps_4_0 /Fo d3d11_genyuv_pixel.fxc d3d11_genyuv_pixel.hlsl +fxc /T ps_4_0 /Fo d3d11_bt601lim_pixel.fxc d3d11_bt601lim_pixel.hlsl +fxc /T ps_4_0 /Fo d3d11_bt2020lim_pixel.fxc d3d11_bt2020lim_pixel.hlsl \ No newline at end of file diff --git a/app/shaders/d3d11_bt2020lim_pixel.fxc b/app/shaders/d3d11_bt2020lim_pixel.fxc index b015bbeb..920433cb 100644 Binary files a/app/shaders/d3d11_bt2020lim_pixel.fxc and b/app/shaders/d3d11_bt2020lim_pixel.fxc differ diff --git a/app/shaders/d3d11_bt601lim_pixel.fxc b/app/shaders/d3d11_bt601lim_pixel.fxc index 09f25653..14429900 100644 Binary files a/app/shaders/d3d11_bt601lim_pixel.fxc and b/app/shaders/d3d11_bt601lim_pixel.fxc differ diff --git a/app/shaders/d3d11_genyuv_pixel.fxc b/app/shaders/d3d11_genyuv_pixel.fxc index 7aa73c5e..33dcc91a 100644 Binary files a/app/shaders/d3d11_genyuv_pixel.fxc and b/app/shaders/d3d11_genyuv_pixel.fxc differ diff --git a/app/shaders/d3d11_overlay_pixel.fxc b/app/shaders/d3d11_overlay_pixel.fxc index b3978ba7..60fa1e48 100644 Binary files a/app/shaders/d3d11_overlay_pixel.fxc and b/app/shaders/d3d11_overlay_pixel.fxc differ diff --git a/app/shaders/d3d11_vertex.fxc b/app/shaders/d3d11_vertex.fxc index d0867c9a..10c0a6b0 100644 Binary files a/app/shaders/d3d11_vertex.fxc and b/app/shaders/d3d11_vertex.fxc differ diff --git a/app/shaders/d3d11_vertex.hlsl b/app/shaders/d3d11_vertex.hlsl index 1db8cdee..5ca06c8a 100644 --- a/app/shaders/d3d11_vertex.hlsl +++ b/app/shaders/d3d11_vertex.hlsl @@ -1,13 +1,13 @@ struct ShaderInput { float2 pos : POSITION; - float2 tex : TEXCOORD0; + float3 tex : TEXCOORD0; }; struct ShaderOutput { float4 pos : SV_POSITION; - float2 tex : TEXCOORD0; + float3 tex : TEXCOORD0; }; ShaderOutput main(ShaderInput input) diff --git a/app/shaders/d3d11_video_pixel_end.hlsli b/app/shaders/d3d11_video_pixel_end.hlsli index 6b7cc26a..640485f8 100644 --- a/app/shaders/d3d11_video_pixel_end.hlsli +++ b/app/shaders/d3d11_video_pixel_end.hlsli @@ -2,7 +2,7 @@ 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))); + chrominancePlane.Sample(theSampler, min(input.tex, chromaTexMax))); // Subtract the YUV offset for limited vs full range yuv -= offsets; diff --git a/app/shaders/d3d11_video_pixel_start.hlsli b/app/shaders/d3d11_video_pixel_start.hlsli index a148ff98..8f298879 100644 --- a/app/shaders/d3d11_video_pixel_start.hlsli +++ b/app/shaders/d3d11_video_pixel_start.hlsli @@ -1,11 +1,11 @@ -Texture2D luminancePlane : register(t0); -Texture2D chrominancePlane : register(t1); +Texture2DArray luminancePlane : register(t0); +Texture2DArray chrominancePlane : register(t1); SamplerState theSampler : register(s0); struct ShaderInput { float4 pos : SV_POSITION; - float2 tex : TEXCOORD0; + float3 tex : TEXCOORD0; }; cbuffer ChromaLimitBuf : register(b0) diff --git a/app/streaming/video/ffmpeg-renderers/d3d11va.cpp b/app/streaming/video/ffmpeg-renderers/d3d11va.cpp index 2fd792e5..1d9501e2 100644 --- a/app/streaming/video/ffmpeg-renderers/d3d11va.cpp +++ b/app/streaming/video/ffmpeg-renderers/d3d11va.cpp @@ -18,7 +18,7 @@ typedef struct _VERTEX { float x, y; - float tu, tv; + float tu, tv, tw; } VERTEX, *PVERTEX; #define CSC_MATRIX_RAW_ELEMENT_COUNT 9 @@ -872,10 +872,10 @@ void D3D11VARenderer::notifyOverlayUpdated(Overlay::OverlayType type) VERTEX verts[] = { - {renderRect.x, renderRect.y, 0, 1}, - {renderRect.x, renderRect.y+renderRect.h, 0, 0}, - {renderRect.x+renderRect.w, renderRect.y, 1, 1}, - {renderRect.x+renderRect.w, renderRect.y+renderRect.h, 1, 0}, + {renderRect.x, renderRect.y, 0, 1, 0}, + {renderRect.x, renderRect.y+renderRect.h, 0, 0, 0}, + {renderRect.x+renderRect.w, renderRect.y, 1, 1, 0}, + {renderRect.x+renderRect.w, renderRect.y+renderRect.h, 1, 0, 0}, }; D3D11_BUFFER_DESC vbDesc = {}; @@ -1287,10 +1287,10 @@ bool D3D11VARenderer::setupRenderingResources() VERTEX verts[] = { - {renderRect.x, renderRect.y, 0, vMax}, - {renderRect.x, renderRect.y+renderRect.h, 0, 0}, - {renderRect.x+renderRect.w, renderRect.y, uMax, vMax}, - {renderRect.x+renderRect.w, renderRect.y+renderRect.h, uMax, 0}, + {renderRect.x, renderRect.y, 0, vMax, 0}, + {renderRect.x, renderRect.y+renderRect.h, 0, 0, 0}, + {renderRect.x+renderRect.w, renderRect.y, uMax, vMax, 0}, + {renderRect.x+renderRect.w, renderRect.y+renderRect.h, uMax, 0, 0}, }; D3D11_BUFFER_DESC vbDesc = {};