diff --git a/app/shaders/build_hlsl.bat b/app/shaders/build_hlsl.bat index 0fd15d53..4a8389ab 100644 --- a/app/shaders/build_hlsl.bat +++ b/app/shaders/build_hlsl.bat @@ -1,6 +1,6 @@ -fxc /T vs_4_0 /Fo d3d11_vertex.fxc d3d11_vertex.hlsl +fxc /T vs_4_0_level_9_3 /Fo d3d11_vertex.fxc d3d11_vertex.hlsl -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 +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 diff --git a/app/shaders/d3d11_bt2020lim_pixel.fxc b/app/shaders/d3d11_bt2020lim_pixel.fxc index 920433cb..b015bbeb 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 14429900..09f25653 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 33dcc91a..7aa73c5e 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 60fa1e48..b3978ba7 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 10c0a6b0..d0867c9a 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 5ca06c8a..1db8cdee 100644 --- a/app/shaders/d3d11_vertex.hlsl +++ b/app/shaders/d3d11_vertex.hlsl @@ -1,13 +1,13 @@ struct ShaderInput { float2 pos : POSITION; - float3 tex : TEXCOORD0; + float2 tex : TEXCOORD0; }; struct ShaderOutput { float4 pos : SV_POSITION; - float3 tex : TEXCOORD0; + float2 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 640485f8..6b7cc26a 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))); + chrominancePlane.Sample(theSampler, min(input.tex, chromaTexMax.rg))); // 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 8f298879..a148ff98 100644 --- a/app/shaders/d3d11_video_pixel_start.hlsli +++ b/app/shaders/d3d11_video_pixel_start.hlsli @@ -1,11 +1,11 @@ -Texture2DArray luminancePlane : register(t0); -Texture2DArray chrominancePlane : register(t1); +Texture2D luminancePlane : register(t0); +Texture2D chrominancePlane : register(t1); SamplerState theSampler : register(s0); struct ShaderInput { float4 pos : SV_POSITION; - float3 tex : TEXCOORD0; + float2 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 fa75c04e..42a3b419 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, tw; + float tu, tv; } VERTEX, *PVERTEX; #define CSC_MATRIX_RAW_ELEMENT_COUNT 9 @@ -890,10 +890,10 @@ void D3D11VARenderer::notifyOverlayUpdated(Overlay::OverlayType type) VERTEX verts[] = { - {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}, + {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}, }; D3D11_BUFFER_DESC vbDesc = {}; @@ -1305,10 +1305,10 @@ bool D3D11VARenderer::setupRenderingResources() VERTEX verts[] = { - {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}, + {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}, }; D3D11_BUFFER_DESC vbDesc = {};