summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando S <fsahmkow27@gmail.com>2023-05-13 03:50:31 +0200
committerGitHub <noreply@github.com>2023-05-13 03:50:31 +0200
commit075d73f07664c303d04aa1adea78013e460bb3f5 (patch)
tree5cf10b05b1de71ca89241c2a66148363a6131f15 /src
parentMerge pull request #10237 from liamwhite/cache-storage (diff)
parentCorrectly track RT indexes for image aspect lookup during clears (diff)
downloadyuzu-075d73f07664c303d04aa1adea78013e460bb3f5.tar
yuzu-075d73f07664c303d04aa1adea78013e460bb3f5.tar.gz
yuzu-075d73f07664c303d04aa1adea78013e460bb3f5.tar.bz2
yuzu-075d73f07664c303d04aa1adea78013e460bb3f5.tar.lz
yuzu-075d73f07664c303d04aa1adea78013e460bb3f5.tar.xz
yuzu-075d73f07664c303d04aa1adea78013e460bb3f5.tar.zst
yuzu-075d73f07664c303d04aa1adea78013e460bb3f5.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp1
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 012d6fa73..4d0481f2a 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -1864,6 +1864,7 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime,
num_layers = std::max(num_layers, color_buffer->range.extent.layers);
images[num_images] = color_buffer->ImageHandle();
image_ranges[num_images] = MakeSubresourceRange(color_buffer);
+ rt_map[index] = num_images;
samples = color_buffer->Samples();
++num_images;
}
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h
index 23473bf9c..4166b3d20 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.h
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.h
@@ -334,7 +334,7 @@ public:
}
[[nodiscard]] bool HasAspectColorBit(size_t index) const noexcept {
- return (image_ranges.at(index).aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) != 0;
+ return (image_ranges.at(rt_map[index]).aspectMask & VK_IMAGE_ASPECT_COLOR_BIT) != 0;
}
[[nodiscard]] bool HasAspectDepthBit() const noexcept {
@@ -354,6 +354,7 @@ private:
u32 num_images = 0;
std::array<VkImage, 9> images{};
std::array<VkImageSubresourceRange, 9> image_ranges{};
+ std::array<size_t, NUM_RT> rt_map{};
bool has_depth{};
bool has_stencil{};
};