From 68e6bca3bf74423b97e63e2707400d70d588798a Mon Sep 17 00:00:00 2001 From: Aitor Camacho Date: Wed, 8 Jun 2022 14:55:54 +0200 Subject: [PATCH] layers: Use ImageRangeGenerator instead of RangeGenerator --- layers/core_validation.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 33eadca1d41..7dac6ac3cbf 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -12647,12 +12647,18 @@ bool CoreChecks::ValidateDependencies(FRAMEBUFFER_STATE const *framebuffer, REND } if (!image_data_i->sparse && !image_data_j->sparse) { - subresource_adapter::RangeGenerator generator_i = view_state_i->range_generator; + subresource_adapter::ImageRangeGenerator generator_i{*image_data_i->fragment_encoder.get(), + view_state_i->create_info.subresourceRange, 0u, + view_state_i->IsDepthSliced()}; + + subresource_adapter::ImageRangeGenerator generator_j{*image_data_j->fragment_encoder.get(), + view_state_j->create_info.subresourceRange, 0u, + view_state_j->IsDepthSliced()}; for (; generator_i->non_empty(); ++generator_i) { - subresource_adapter::RangeGenerator generator_j = view_state_j->range_generator; - for (; generator_j->non_empty(); ++generator_j) { + subresource_adapter::ImageRangeGenerator generator_j_copy = generator_j; + for (; generator_j_copy->non_empty(); ++generator_j_copy) { sparse_container::range range_i{generator_i->begin, generator_i->end}; - sparse_container::range range_j{generator_j->begin, generator_j->end}; + sparse_container::range range_j{generator_j_copy->begin, generator_j_copy->end}; if (image_data_i->DoesResourceMemoryOverlap(range_i, image_data_j, range_j)) { attachments[i].overlapping.emplace_back(j);