layers: Fix state recording of 2D ImageViews of 3D Images

Layout transitions of these ImageViews affect the entire mip level,
not just the slice the view references, so don't use the slice
aliasing in NormalizeSubresourceRange(). Add methods to retrieve
the depth slice offset and extent so that sync validation can
use it.

This fixes additional corner cases uncovered by the fix for Issue #2910.
diff --git a/layers/synchronization_validation.cpp b/layers/synchronization_validation.cpp
index 8d788bc..5748a42 100644
--- a/layers/synchronization_validation.cpp
+++ b/layers/synchronization_validation.cpp
@@ -1802,6 +1802,10 @@
                         }
                         if (!img_view_state) continue;
                         HazardResult hazard;
+                        // NOTE: 2D ImageViews of VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT Images are not allowed in
+                        // Descriptors, so we do not have to worry about depth slicing here.
+                        // See: VUID 00343
+                        assert(!img_view_state->IsDepthSliced());
                         const IMAGE_STATE *img_state = img_view_state->image_state.get();
                         const auto &subresource_range = img_view_state->normalized_subresource_range;
 
@@ -1927,6 +1931,10 @@
                             img_view_state = static_cast<const ImageDescriptor *>(descriptor)->GetImageViewState();
                         }
                         if (!img_view_state) continue;
+                        // NOTE: 2D ImageViews of VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT Images are not allowed in
+                        // Descriptors, so we do not have to worry about depth slicing here.
+                        // See: VUID 00343
+                        assert(!img_view_state->IsDepthSliced());
                         const IMAGE_STATE *img_state = img_view_state->image_state.get();
                         if (sync_index == SYNC_FRAGMENT_SHADER_INPUT_ATTACHMENT_READ) {
                             const VkExtent3D extent = CastTo3D(cb_state_->activeRenderPassBeginInfo.renderArea.extent);
@@ -5846,8 +5854,9 @@
     const auto base_address = ResourceBaseAddress(image_state);
     const auto *encoder = image_state.fragment_encoder.get();
     if (!encoder) return;
-    const VkOffset3D zero_offset = {0, 0, 0};
-    const VkExtent3D &image_extent = image_state.createInfo.extent;
+    // Get offset and extent for the view, accounting for possible depth slicing
+    const VkOffset3D zero_offset = view->GetOffset();
+    const VkExtent3D &image_extent = view->GetExtent();
     // Intentional copy
     VkImageSubresourceRange subres_range = view_->normalized_subresource_range;
     view_mask_ = subres_range.aspectMask;