// Copyright 2020-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

// Common Valid Usage
// Common to attachment description structures
  * [[VUID-{refpage}-format-06699]]
    If pname:format includes a color or depth component and pname:loadOp is
    ename:VK_ATTACHMENT_LOAD_OP_LOAD, then pname:initialLayout must: not be
    ename:VK_IMAGE_LAYOUT_UNDEFINED
  * [[VUID-{refpage}-finalLayout-00843]]
    pname:finalLayout must: not be ename:VK_IMAGE_LAYOUT_UNDEFINED or
    ename:VK_IMAGE_LAYOUT_PREINITIALIZED
  * [[VUID-{refpage}-format-03280]]
    If pname:format is a color format, pname:initialLayout must: not be
    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
  * [[VUID-{refpage}-format-03281]]
    If pname:format is a depth/stencil format, pname:initialLayout must: not
    be ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
  * [[VUID-{refpage}-format-03282]]
    If pname:format is a color format, pname:finalLayout must: not be
    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
  * [[VUID-{refpage}-format-03283]]
    If pname:format is a depth/stencil format, pname:finalLayout must: not
    be ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
  * [[VUID-{refpage}-format-06487]]
    If pname:format is a color format, pname:initialLayout must: not be
    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
  * [[VUID-{refpage}-format-06488]]
    If pname:format is a color format, pname:finalLayout must: not be
    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
endif::VK_VERSION_1_1,VK_KHR_maintenance2[]
ifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
  * [[VUID-{refpage}-separateDepthStencilLayouts-03284]]
    If the <<features-separateDepthStencilLayouts,
    pname:separateDepthStencilLayouts>> feature is not enabled,
    pname:initialLayout must: not be
    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or
    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL,
  * [[VUID-{refpage}-separateDepthStencilLayouts-03285]]
    If the <<features-separateDepthStencilLayouts,
    pname:separateDepthStencilLayouts>> feature is not enabled,
    pname:finalLayout must: not be
    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or
    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL,
  * [[VUID-{refpage}-format-03286]]
    If pname:format is a color format, pname:initialLayout must: not be
    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or
    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
  * [[VUID-{refpage}-format-03287]]
    If pname:format is a color format, pname:finalLayout must: not be
    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, or
    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
  * [[VUID-{refpage}-format-06906]]
    If pname:format is a depth/stencil format which includes both depth and
    stencil components, pname:initialLayout must: not be
    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
  * [[VUID-{refpage}-format-06907]]
    If pname:format is a depth/stencil format which includes both depth and
    stencil components, pname:finalLayout must: not be
    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
  * [[VUID-{refpage}-format-03290]]
    If pname:format is a depth/stencil format which includes only the depth
    component, pname:initialLayout must: not be
    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
  * [[VUID-{refpage}-format-03291]]
    If pname:format is a depth/stencil format which includes only the depth
    component, pname:finalLayout must: not be
    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
endif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
ifdef::VK_KHR_synchronization2[]
  * [[VUID-{refpage}-synchronization2-06908]]
    If the <<features-synchronization2, pname:synchronization2>> feature is
    not enabled, pname:initialLayout must: not be
    ename:VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR or
    ename:VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
  * [[VUID-{refpage}-synchronization2-06909]]
    If the <<features-synchronization2, pname:synchronization2>> feature is
    not enabled, pname:finalLayout must: not be
    ename:VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR or
    ename:VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
endif::VK_KHR_synchronization2[]
ifdef::VK_EXT_attachment_feedback_loop_layout[]
  * [[VUID-{refpage}-attachmentFeedbackLoopLayout-07309]]
    If the <<features-attachmentFeedbackLoopLayout,
    pname:attachmentFeedbackLoopLayout>> feature is not enabled,
    pname:initialLayout must: not be
    ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
  * [[VUID-{refpage}-attachmentFeedbackLoopLayout-07310]]
    If the <<features-attachmentFeedbackLoopLayout,
    pname:attachmentFeedbackLoopLayout>> feature is not enabled,
    pname:finalLayout must: not be
    ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
endif::VK_EXT_attachment_feedback_loop_layout[]
  * [[VUID-{refpage}-samples-08745]]
    pname:samples must: be a valid elink:VkSampleCountFlagBits value that is
    set in pname:imageCreateSampleCounts (as defined in
    <<resources-image-creation-limits,Image Creation Limits>>) for the given
    pname:format
// Common Valid Usage
