Merge pull request #2149 from NZJenkins/half-pixel-offset

Add D3D9 half-pixel offset
This commit is contained in:
PatrickvL 2021-03-01 08:11:24 +01:00 committed by GitHub
commit e6d9c6de15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -4197,6 +4197,12 @@ void CxbxUpdateHostViewPortOffsetAndScaleConstants()
GetScreenScaleFactors(screenScaleX, screenScaleY);
GetMultiSampleOffset(aaOffsetX, aaOffsetY);
// Add D3D9 half-pixel offset (-0.5 given this offset is subtracted)
// We should be able to remove this when off D3D9
// https://aras-p.info/blog/2016/04/08/solving-dx9-half-pixel-offset/
aaOffsetX -= 0.5f;
aaOffsetY -= 0.5f;
float xboxScreenspaceWidth = xboxRenderTargetWidth * screenScaleX;
float xboxScreenspaceHeight = xboxRenderTargetHeight * screenScaleY;