mirror of
https://github.com/starr-dusT/yuzu-mainline
synced 2024-03-05 21:12:25 -08:00
Correctly track RT indexes for image aspect lookup during clears
This commit is contained in:
parent
182221b9ff
commit
cd0ded7771
@ -1864,6 +1864,7 @@ void Framebuffer::CreateFramebuffer(TextureCacheRuntime& runtime,
|
|||||||
num_layers = std::max(num_layers, color_buffer->range.extent.layers);
|
num_layers = std::max(num_layers, color_buffer->range.extent.layers);
|
||||||
images[num_images] = color_buffer->ImageHandle();
|
images[num_images] = color_buffer->ImageHandle();
|
||||||
image_ranges[num_images] = MakeSubresourceRange(color_buffer);
|
image_ranges[num_images] = MakeSubresourceRange(color_buffer);
|
||||||
|
rt_map[index] = num_images;
|
||||||
samples = color_buffer->Samples();
|
samples = color_buffer->Samples();
|
||||||
++num_images;
|
++num_images;
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool HasAspectColorBit(size_t index) const noexcept {
|
[[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 {
|
[[nodiscard]] bool HasAspectDepthBit() const noexcept {
|
||||||
@ -354,6 +354,7 @@ private:
|
|||||||
u32 num_images = 0;
|
u32 num_images = 0;
|
||||||
std::array<VkImage, 9> images{};
|
std::array<VkImage, 9> images{};
|
||||||
std::array<VkImageSubresourceRange, 9> image_ranges{};
|
std::array<VkImageSubresourceRange, 9> image_ranges{};
|
||||||
|
std::array<size_t, NUM_RT> rt_map{};
|
||||||
bool has_depth{};
|
bool has_depth{};
|
||||||
bool has_stencil{};
|
bool has_stencil{};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user