Fix aspect fit ratio for NVDEC

This commit is contained in:
2025-10-08 00:30:13 +09:00
parent 8b6e8943de
commit 81eae4424d

View File

@@ -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;
}