Fix aspect fit ratio for NVDEC
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user