From 6d6e803c7d2a8ce0d0353c639d7b3f991a1e0e99 Mon Sep 17 00:00:00 2001 From: Triang3l Date: Wed, 1 Aug 2018 13:12:06 +0300 Subject: [PATCH] [D3D12] Flip the viewport --- src/xenia/gpu/d3d12/d3d12_command_processor.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xenia/gpu/d3d12/d3d12_command_processor.cc b/src/xenia/gpu/d3d12/d3d12_command_processor.cc index a4c8fbb4d..96d200615 100644 --- a/src/xenia/gpu/d3d12/d3d12_command_processor.cc +++ b/src/xenia/gpu/d3d12/d3d12_command_processor.cc @@ -738,8 +738,8 @@ void D3D12CommandProcessor::UpdateFixedFunctionState( ? regs[XE_GPU_REG_PA_CL_VPORT_XSCALE].f32 : 1280.0f; float viewport_scale_y = (pa_cl_vte_cntl & (1 << 2)) - ? regs[XE_GPU_REG_PA_CL_VPORT_YSCALE].f32 - : 1280.0f; + ? -regs[XE_GPU_REG_PA_CL_VPORT_YSCALE].f32 + : -1280.0f; // TODO(Triang3l): Investigate how unnormalized coordinates should work when // using a D24FS8 depth buffer. A 20e4 buffer can store values up to // 511.99985, however, in the depth buffer, something like 1/z is stored, and @@ -910,10 +910,10 @@ void D3D12CommandProcessor::UpdateSystemConstantValues(Endian index_endian) { if (pa_cl_vte_cntl & (1 << 2)) { float viewport_scale_y = regs[XE_GPU_REG_PA_CL_VPORT_YSCALE].f32; 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; + ndc_offset_y += 1.0f / 2560.0f; } pixel_half_pixel_offset = -0.5f; }