From 521b9eb5c52076df1a1c3bbff7888dc821ccbdd4 Mon Sep 17 00:00:00 2001 From: DrChat Date: Mon, 16 Apr 2018 18:27:23 -0500 Subject: [PATCH] [Vulkan] Fix window scale and offset calculation --- src/xenia/gpu/vulkan/pipeline_cache.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/xenia/gpu/vulkan/pipeline_cache.cc b/src/xenia/gpu/vulkan/pipeline_cache.cc index e7c18f066..e4ba55ba7 100644 --- a/src/xenia/gpu/vulkan/pipeline_cache.cc +++ b/src/xenia/gpu/vulkan/pipeline_cache.cc @@ -675,8 +675,8 @@ bool PipelineCache::SetDynamicState(VkCommandBuffer command_buffer, vpy = window_height_scalar * voy - vph / 2 + vtx_window_offset_y; } else { // TODO(DrChat): This should be the width/height of the target picture - vpw = 2560.0f * window_width_scalar; - vph = 2560.0f * window_height_scalar; + vpw = 2560.0f; + vph = 2560.0f; vpx = vtx_window_offset_x; vpy = vtx_window_offset_y; } @@ -776,10 +776,10 @@ bool PipelineCache::SetDynamicState(VkCommandBuffer command_buffer, push_constants.window_scale[3] = 0.f; } else { // 1 / unscaled viewport w/h - push_constants.window_scale[0] = 1.0f / (1280.f * window_width_scalar); - push_constants.window_scale[1] = 1.0f / (1280.f * window_height_scalar); - push_constants.window_scale[2] = (-1280.f * window_width_scalar) + 0.5f; - push_constants.window_scale[3] = (-1280.f * window_height_scalar) + 0.5f; + push_constants.window_scale[0] = window_width_scalar / 1280.f; + push_constants.window_scale[1] = window_height_scalar / 1280.f; + push_constants.window_scale[2] = (-1280.f / window_width_scalar) + 0.5f; + push_constants.window_scale[3] = (-1280.f / window_height_scalar) + 0.5f; } // http://www.x.org/docs/AMD/old/evergreen_3D_registers_v2.pdf