From 81eae4424db899b5a6f519f245dd5933838c5d83 Mon Sep 17 00:00:00 2001 From: ened Date: Wed, 8 Oct 2025 00:30:13 +0900 Subject: [PATCH] Fix aspect fit ratio for NVDEC --- .../Vav2Player/src/Rendering/RGBASurfaceBackend.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vav2/platforms/windows/applications/vav2player/Vav2Player/src/Rendering/RGBASurfaceBackend.cpp b/vav2/platforms/windows/applications/vav2player/Vav2Player/src/Rendering/RGBASurfaceBackend.cpp index 93e4e57..31014ef 100644 --- a/vav2/platforms/windows/applications/vav2player/Vav2Player/src/Rendering/RGBASurfaceBackend.cpp +++ b/vav2/platforms/windows/applications/vav2player/Vav2Player/src/Rendering/RGBASurfaceBackend.cpp @@ -335,12 +335,13 @@ HRESULT RGBASurfaceBackend::CompileShaders() { float2(0.0, 1.0), float2(1.0, 0.0), float2(1.0, 1.0) }; - output.position = float4(positions[vertexID], 0.0, 1.0); + // Apply AspectFit to vertex positions (not UV) + float2 pos = positions[vertexID]; + pos *= float2(uvScaleX, uvScaleY); // Scale vertex positions for AspectFit + output.position = float4(pos, 0.0, 1.0); - // Apply AspectFit UV transformation - float2 uv = uvs[vertexID]; - uv = (uv - 0.5) * float2(uvScaleX, uvScaleY) + 0.5 + float2(uvOffsetX, uvOffsetY); - output.uv = uv; + // UV coordinates remain unchanged (sample full texture) + output.uv = uvs[vertexID]; return output; }