From 9655b76f68b1a333f4398234e1e4e79e8580b05c Mon Sep 17 00:00:00 2001 From: gibbed Date: Sat, 19 May 2018 14:48:00 -0500 Subject: [PATCH] [Vulkan] Simplify color/depth info access in IssueCopy. --- .../gpu/vulkan/vulkan_command_processor.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/xenia/gpu/vulkan/vulkan_command_processor.cc b/src/xenia/gpu/vulkan/vulkan_command_processor.cc index 0ef040576..523c5f7d5 100644 --- a/src/xenia/gpu/vulkan/vulkan_command_processor.cc +++ b/src/xenia/gpu/vulkan/vulkan_command_processor.cc @@ -980,25 +980,22 @@ bool VulkanCommandProcessor::IssueCopy() { DepthRenderTargetFormat depth_format; if (is_color_source) { // Source from a color target. - uint32_t color_info[4] = { + reg::RB_COLOR_INFO color_info[4] = { regs[XE_GPU_REG_RB_COLOR_INFO].u32, regs[XE_GPU_REG_RB_COLOR1_INFO].u32, regs[XE_GPU_REG_RB_COLOR2_INFO].u32, regs[XE_GPU_REG_RB_COLOR3_INFO].u32, }; - color_edram_base = color_info[copy_src_select] & 0xFFF; - - color_format = static_cast( - (color_info[copy_src_select] >> 16) & 0xF); + color_edram_base = color_info[copy_src_select].color_base; + color_format = color_info[copy_src_select].color_format; + assert_true(color_info[copy_src_select].color_exp_bias == 0); } if (!is_color_source || depth_clear_enabled) { // Source from or clear a depth target. - uint32_t depth_info = regs[XE_GPU_REG_RB_DEPTH_INFO].u32; - depth_edram_base = depth_info & 0xFFF; - - depth_format = - static_cast((depth_info >> 16) & 0x1); + reg::RB_DEPTH_INFO depth_info = {regs[XE_GPU_REG_RB_DEPTH_INFO].u32}; + depth_edram_base = depth_info.depth_base; + depth_format = depth_info.depth_format; if (!is_color_source) { copy_dest_format = DepthRenderTargetToTextureFormat(depth_format); }