[D3D12] Fix Y half-pixel offset

This commit is contained in:
Triang3l 2018-08-25 10:50:47 +03:00
parent 961c7e1198
commit 304544cc72
1 changed files with 3 additions and 1 deletions

View File

@ -1308,6 +1308,8 @@ void D3D12CommandProcessor::UpdateSystemConstantValues(
float ndc_offset_z = gl_clip_space_def ? 0.5f : 0.0f;
float pixel_half_pixel_offset = 0.0f;
if (!(pa_su_vtx_cntl & (1 << 0))) {
// Signs are hopefully correct here, tested in GTA IV on both clearing
// (without a viewport) and drawing things near the edges of the screen.
if (pa_cl_vte_cntl & (1 << 0)) {
if (viewport_scale_x != 0.0f) {
ndc_offset_x += 0.5f / viewport_scale_x;
@ -1317,7 +1319,7 @@ void D3D12CommandProcessor::UpdateSystemConstantValues(
}
if (pa_cl_vte_cntl & (1 << 2)) {
if (viewport_scale_y != 0.0f) {
ndc_offset_y -= 0.5f / viewport_scale_y;
ndc_offset_y += 0.5f / viewport_scale_y;
}
} else {
ndc_offset_y -= 1.0f / 2560.0f;