#include <assert.h>
#include <vector>
#include <vulkan/vk_enum_string_helper.h>
#include "generated/chassis.h"
#include "core_validation.h"
#include "sync/sync_vuid_maps.h"
#include "utils/image_layout_utils.h"
#include "state_tracker/image_state.h"
#include "state_tracker/render_pass_state.h"
bool VerifyAspectsPresent(VkImageAspectFlags aspect_mask, VkFormat format);
LayoutRange;
LayoutEntry;
struct LayoutUseCheckAndMessage { … };
template <typename RangeFactory>
bool CoreChecks::VerifyImageLayoutRange(const vvl::CommandBuffer &cb_state, const vvl::Image &image_state,
VkImageAspectFlags aspect_mask, VkImageLayout explicit_layout,
const RangeFactory &range_factory, const Location &loc, const char *mismatch_layout_vuid,
bool *error) const { … }
bool CoreChecks::VerifyImageLayoutSubresource(const vvl::CommandBuffer &cb_state, const vvl::Image &image_state,
const VkImageSubresourceLayers &subresource_layers, VkImageLayout explicit_layout,
const Location &loc, const char *vuid) const { … }
bool CoreChecks::VerifyImageLayout(const vvl::CommandBuffer &cb_state, const vvl::ImageView &image_view_state,
VkImageLayout explicit_layout, const Location &loc, const char *mismatch_layout_vuid,
bool *error) const { … }
bool CoreChecks::VerifyImageLayout(const vvl::CommandBuffer &cb_state, const vvl::Image &image_state,
const VkImageSubresourceRange &range, VkImageLayout explicit_layout, const Location &loc,
const char *mismatch_layout_vuid, bool *error) const { … }
void CoreChecks::TransitionFinalSubpassLayouts(vvl::CommandBuffer &cb_state) { … }
static GlobalImageLayoutRangeMap *GetLayoutRangeMap(GlobalImageLayoutMap &map, const vvl::Image &image_state) { … }
struct GlobalLayoutUpdater { … };
bool CoreChecks::ValidateCmdBufImageLayouts(const Location &loc, const vvl::CommandBuffer &cb_state,
GlobalImageLayoutMap &overlayLayoutMap) const { … }
void CoreChecks::UpdateCmdBufImageLayouts(const vvl::CommandBuffer &cb_state) { … }
bool CoreChecks::ValidateLayoutVsAttachmentDescription(const VkImageLayout first_layout, const uint32_t attachment,
const VkAttachmentDescription2 &attachment_description,
const Location &layout_loc) const { … }
bool CoreChecks::ValidateMultipassRenderedToSingleSampledSampleCount(VkFramebuffer framebuffer, VkRenderPass renderpass,
vvl::Image &image_state, VkSampleCountFlagBits msrtss_samples,
const Location &rasterization_samples_loc) const { … }
bool CoreChecks::ValidateRenderPassLayoutAgainstFramebufferImageUsage(VkImageLayout layout, const vvl::ImageView &image_view_state,
VkFramebuffer framebuffer, VkRenderPass renderpass,
uint32_t attachment_index, const Location &rp_loc,
const Location &attachment_reference_loc) const { … }
bool CoreChecks::ValidateRenderPassStencilLayoutAgainstFramebufferImageUsage(VkImageLayout layout,
const vvl::ImageView &image_view_state,
VkFramebuffer framebuffer, VkRenderPass renderpass,
const Location &layout_loc) const { … }
bool CoreChecks::VerifyFramebufferAndRenderPassLayouts(const vvl::CommandBuffer &cb_state, const VkRenderPassBeginInfo &begin_info,
const vvl::RenderPass &render_pass_state,
const vvl::Framebuffer &framebuffer_state,
const Location &rp_begin_loc) const { … }
void CoreChecks::TransitionAttachmentRefLayout(vvl::CommandBuffer &cb_state, const vku::safe_VkAttachmentReference2 &ref) { … }
void CoreChecks::TransitionSubpassLayouts(vvl::CommandBuffer &cb_state, const vvl::RenderPass &render_pass_state,
const int subpass_index) { … }
void CoreChecks::TransitionBeginRenderPassLayouts(vvl::CommandBuffer &cb_state, const vvl::RenderPass &render_pass_state) { … }
bool CoreChecks::VerifyClearImageLayout(const vvl::CommandBuffer &cb_state, const vvl::Image &image_state,
const VkImageSubresourceRange &range, VkImageLayout dest_image_layout,
const Location &loc) const { … }
bool CoreChecks::UpdateCommandBufferImageLayoutMap(const vvl::CommandBuffer &cb_state, const Location &image_loc,
const ImageBarrier &img_barrier, const vvl::CommandBuffer::ImageLayoutMap ¤t_map,
vvl::CommandBuffer::ImageLayoutMap &layout_updates) const { … }
bool CoreChecks::FindLayouts(const vvl::Image &image_state, std::vector<VkImageLayout> &layouts) const { … }
void CoreChecks::RecordTransitionImageLayout(vvl::CommandBuffer &cb_state, const ImageBarrier &mem_barrier) { … }
void CoreChecks::TransitionImageLayouts(vvl::CommandBuffer &cb_state, uint32_t barrier_count,
const VkImageMemoryBarrier2 *image_barriers) { … }
void CoreChecks::TransitionImageLayouts(vvl::CommandBuffer &cb_state, uint32_t barrier_count,
const VkImageMemoryBarrier *image_barriers, VkPipelineStageFlags src_stage_mask,
VkPipelineStageFlags dst_stage_mask) { … }
bool CoreChecks::IsCompliantSubresourceRange(const VkImageSubresourceRange &subres_range, const vvl::Image &image_state) const { … }
bool CoreChecks::ValidateHostCopyCurrentLayout(const VkImageLayout expected_layout, const VkImageSubresourceLayers &subres_layers,
uint32_t region_index, const vvl::Image &image_state, const Location &loc,
const char *image_label, const char *vuid) const { … }
bool CoreChecks::ValidateHostCopyCurrentLayout(const VkImageLayout expected_layout, const VkImageSubresourceRange &validate_range,
uint32_t region_index, const vvl::Image &image_state, const Location &loc,
const char *image_label, const char *vuid) const { … }