From 58035697d54a5a1cdc57f129db6728f709fab918 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 22 Apr 2018 22:08:53 +0300 Subject: [PATCH] rsx: Restore component mapping override for depth textures --- rpcs3/Emu/RSX/GL/GLTextureCache.h | 12 ++++++++++++ rpcs3/Emu/RSX/VK/VKTextureCache.h | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/rpcs3/Emu/RSX/GL/GLTextureCache.h b/rpcs3/Emu/RSX/GL/GLTextureCache.h index e2c8e63c52..330f67afa2 100644 --- a/rpcs3/Emu/RSX/GL/GLTextureCache.h +++ b/rpcs3/Emu/RSX/GL/GLTextureCache.h @@ -758,6 +758,18 @@ namespace gl std::array get_component_mapping(u32 gcm_format, rsx::texture_create_flags flags) { + switch (gcm_format) + { + case CELL_GCM_TEXTURE_DEPTH24_D8: + case CELL_GCM_TEXTURE_DEPTH24_D8_FLOAT: + case CELL_GCM_TEXTURE_DEPTH16: + case CELL_GCM_TEXTURE_DEPTH16_FLOAT: + //Dont bother letting this propagate + return{ GL_RED, GL_RED, GL_RED, GL_RED }; + default: + break; + } + switch (flags) { case rsx::texture_create_flags::default_component_order: diff --git a/rpcs3/Emu/RSX/VK/VKTextureCache.h b/rpcs3/Emu/RSX/VK/VKTextureCache.h index 0ebee31315..e01d3756aa 100644 --- a/rpcs3/Emu/RSX/VK/VKTextureCache.h +++ b/rpcs3/Emu/RSX/VK/VKTextureCache.h @@ -472,6 +472,18 @@ namespace vk VkComponentMapping apply_component_mapping_flags(u32 gcm_format, rsx::texture_create_flags flags, const texture_channel_remap_t& remap_vector) { + switch (gcm_format) + { + case CELL_GCM_TEXTURE_DEPTH24_D8: + case CELL_GCM_TEXTURE_DEPTH24_D8_FLOAT: + case CELL_GCM_TEXTURE_DEPTH16: + case CELL_GCM_TEXTURE_DEPTH16_FLOAT: + //Dont bother letting this propagate + return{ VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_R }; + default: + break; + } + VkComponentMapping mapping = {}; switch (flags) {