Validation Layer Details

VK_LAYER_LUNARG_standard_validation

VK_LAYER_LUNARG_standard_validation Overview

This is a meta-layer managed by the loader. Specifying this layer name will cause the loader to load the all of the standard validation layers in the following optimal order:

  • VK_LAYER_GOOGLE_threading
  • VK_LAYER_LUNARG_parameter_validation
  • VK_LAYER_LUNARG_device_limits
  • VK_LAYER_LUNARG_object_tracker
  • VK_LAYER_LUNARG_image
  • VK_LAYER_LUNARG_core_validation
  • VK_LAYER_LUNARG_swapchain
  • VK_LAYER_GOOGLE_unique_objects

Other layers can be specified and the loader will remove duplicates. See the following individual layer descriptions for layer details.

VK_LAYER_LUNARG_core_validation

VK_LAYER_LUNARG_core_validation Overview

The VK_LAYER_LUNARG_core_validation layer is the main layer performing state tracking, object and state lifetime validation, and consistency and coherency between these states and the requirements, limits, and capabilities. Currently, it is divided into three main areas of validation: Draw State, Memory Tracking, and Shader Checking.

VK_LAYER_LUNARG_core_validation Draw State Details Table

The Draw State portion of the core validation layer tracks state leading into Draw commands. This includes the Pipeline state, dynamic state, shaders, and descriptor set state. This functionality validates the consistency and correctness between and within these states.

CheckOverviewENUM DRAWSTATE_*Relevant APITestnameNotes/TODO
Valid Pipeline LayoutsVerify that sets being bound are compatible with their PipelineLayout and that the last-bound PSO PipelineLayout at Draw time is compatible with all bound sets used by that PSOPIPELINE_LAYOUTS_INCOMPATIBLEvkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectTBDNone
Valid BeginCommandBuffer stateMust not call Begin on command buffers that are being recorded, and primary command buffers must specify VK_NULL_HANDLE for RenderPass or Framebuffer parameters, while secondary command buffers must provide non-null parameters,BEGIN_CB_INVALID_STATEvkBeginCommandBufferPrimaryCommandBufferFramebufferAndRenderpass SecondaryCommandBufferFramebufferAndRenderpassNone
Command Buffer Simultaneous UseViolation of VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT rules. Most likely attempting to simultaneously use a CmdBuffer w/o having that bit set. This also warns if you add secondary command buffer w/o that bit set to a primary command buffer that does have that bit set.INVALID_CB_SIMULTANEOUS_USEvkQueueSubmit vkCmdExecuteCommandsTODOWrite test
Valid Command Buffer ResetCan only reset individual command buffer that was allocated from a pool with VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT setINVALID_COMMAND_BUFFER_RESETvkBeginCommandBuffer vkResetCommandBufferCommandBufferResetErrorsNone
PSO BoundVerify that a properly created and valid pipeline object is bound to the CommandBuffer specified in these callsNO_PIPELINE_BOUNDvkCmdBindDescriptorSets vkCmdBindVertexBuffersPipelineNotBoundThis check is currently more related to VK_LAYER_LUNARG_core_validation internal data structures and less about verifying that PSO is bound at all appropriate points in API. For API purposes, need to make sure this is checked at Draw time and any other relevant calls.
Valid DescriptorPoolVerifies that the descriptor set pool object was properly created and is validINVALID_POOLvkResetDescriptorPool vkAllocateDescriptorSetsNoneThis is just an internal layer data structure check. VK_LAYER_LUNARG_parameter_validation or VK_LAYER_LUNARG_object_tracker should really catch bad DSPool
Valid DescriptorSetValidate that descriptor set was properly created and is currently validINVALID_SETvkCmdBindDescriptorSetsNoneIs this needed other places (like Update/Clear descriptors)
Valid DescriptorSetLayoutFlag DescriptorSetLayout object that was not properly createdINVALID_LAYOUTvkAllocateDescriptorSetsNoneAnywhere else to check this?
Valid PipelineFlag VkPipeline object that was not properly createdINVALID_PIPELINEvkCmdBindPipelineInvalidPipelineNA
Valid PipelineLayoutFlag VkPipelineLayout object that was not properly createdINVALID_PIPELINE_LAYOUTvkCmdBindPipelineTODOWrite test for this case
Valid Pipeline Create InfoTests for the following: That compute shaders are not specified for the graphics pipeline, tess evaluation and tess control shaders are included or excluded as a pair, that VK_PRIMITIVE_TOPOLOGY_PATCH_LIST is set as IA topology for tessellation pipelines, that VK_PRIMITIVE_TOPOLOGY_PATCH_LIST primitive topology is only set for tessellation pipelines, and that Vtx Shader specifiedINVALID_PIPELINE_CREATE_STATEvkCreateGraphicsPipelinesInvalidPipelineCreateStateNA
Valid CommandBufferValidates that the command buffer object was properly created and is currently validINVALID_COMMAND_BUFFERvkQueueSubmit vkBeginCommandBuffer vkEndCommandBuffer vkCmdBindPipeline vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearAttachments vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdBeginRenderPass vkCmdNextSubpass vkCmdEndRenderPass vkCmdExecuteCommands vkAllocateCommandBuffersNoneNA
Vtx Buffer BoundsCheck if VBO index too large for PSO Vtx binding count, and that at least one vertex buffer is attached to pipeline objectVTX_INDEX_OUT_OF_BOUNDSvkCmdBindDescriptorSets vkCmdBindVertexBuffersVtxBufferBadIndexNA
Idx Buffer AlignmentVerify that offset of Index buffer falls on an alignment boundary as defined by IdxBufferAlignmentError paramVTX_INDEX_ALIGNMENT_ERRORvkCmdBindIndexBufferIdxBufferAlignmentErrorNA
Cmd Buffer EndVerifies that EndCommandBuffer was called for this commandBuffer at QueueSubmit timeNO_END_COMMAND_BUFFERvkQueueSubmitNoEndCommandBufferNA
Cmd Buffer BeginCheck that BeginCommandBuffer was called for this command buffer when binding commands or calling endNO_BEGIN_COMMAND_BUFFERvkEndCommandBuffer vkCmdBindPipeline vkCmdSetViewport vkCmdSetLineWidth vkCmdSetDepthBias vkCmdSetBlendConstants vkCmdSetDepthBounds vkCmdSetStencilCompareMask vkCmdSetStencilWriteMask vkCmdSetStencilReference vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearAttachments vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestampNoBeginCommandBufferNA
Cmd Buffer Submit CountVerify that ONE_TIME submit cmdbuffer is not submitted multiple timesCOMMAND_BUFFER_SINGLE_SUBMIT_VIOLATIONvkBeginCommandBuffer, vkQueueSubmitCommandBufferTwoSubmitsNA
Valid Secondary CommandBufferValidates that no primary command buffers are sent to vkCmdExecuteCommands() areINVALID_SECONDARY_COMMAND_BUFFERvkCmdExecuteCommandsExecuteCommandsPrimaryCBNA
Invalid Descriptor SetInvalid Descriptor Set used. Either never created or already destroyed.INVALID_DESCRIPTOR_SETvkQueueSubmitTODOCreate Test
Descriptor TypeVerify Descriptor type in bound descriptor set layout matches descriptor type specified in update. This also includes mismatches in the TYPES of copied descriptors.DESCRIPTOR_TYPE_MISMATCHvkUpdateDescriptorSetsDSTypeMismatch CopyDescriptorUpdateErrorsNA
Descriptor StageFlagsVerify all descriptors within a single write update have the same stageFlagsDESCRIPTOR_STAGEFLAGS_MISMATCHvkUpdateDescriptorSetsNONETest this case
DS Update SizeDS update out of bounds for given layout section.DESCRIPTOR_UPDATE_OUT_OF_BOUNDSvkUpdateDescriptorSetsDSUpdateOutOfBounds CopyDescriptorUpdateErrorsNA
Descriptor Pool emptyAttempt to allocate descriptor type from descriptor pool when no more of that type are available to be allocated.DESCRIPTOR_POOL_EMPTYvkAllocateDescriptorSetsAllocDescriptorFromEmptyPoolNA
Free from NON_FREE PoolIt's invalid to call vkFreeDescriptorSets() on Sets that were allocated from a Pool created with NON_FREE usage.CANT_FREE_FROM_NON_FREE_POOLvkFreeDescriptorSetsNoneNA
DS Update IndexDS update binding too large for layout binding count.INVALID_UPDATE_INDEXvkUpdateDescriptorSetsInvalidDSUpdateIndex CopyDescriptorUpdateErrorsNA
DS Update TypeVerifies that structs in DS Update tree are properly created, currenly valid, and of the right typeINVALID_UPDATE_STRUCTvkUpdateDescriptorSetsInvalidDSUpdateStructNA
MSAA Sample CountVerifies that Pipeline, RenderPass, and Subpass sample counts are consistentNUM_SAMPLES_MISMATCHvkCmdBindPipeline vkCmdBeginRenderPass vkCmdNextSubpassNumSamplesMismatchNA
Dynamic Viewport State BindingVerify that viewport dynamic state bound to Cmd Buffer at Draw timeVIEWPORT_NOT_BOUNDvkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectViewportStateNotBoundNA
Dynamic Scissor State BindingVerify that scissor dynamic state bound to Cmd Buffer at Draw timeSCISSOR_NOT_BOUNDvkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectScissorStateNotBoundNA
Dynamic Line Width State BindingVerify that line width dynamic state bound to Cmd Buffer at when required (TODO : Verify when this is)LINE_WIDTH_NOT_BOUNDvkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectTODOVerify this check and Write targeted test
Dynamic Depth Bias State BindingVerify that depth bias dynamic state bound when depth enabledDEPTH_BIAS_NOT_BOUNDvkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectTODOVerify this check and Write targeted test
Dynamic Blend State BindingVerify that blend dynamic state bound when color blend enabledBLEND_NOT_BOUNDvkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectTODOVerify this check and Write targeted test
Dynamic Depth Bounds State BindingVerify that depth bounds dynamic state bound when depth enabledDEPTH_BOUNDS_NOT_BOUNDvkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectTODOVerify this check and Write targeted test
Dynamic Stencil State BindingVerify that stencil dynamic state bound when depth enabledSTENCIL_NOT_BOUNDvkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectTODOVerify this check and Write targeted test
RenderPass misuseTests for the following: that vkCmdDispatch, vkCmdDispatchIndirect, vkCmdCopyBuffer, vkCmdCopyImage, vkCmdBlitImage, vkCmdCopyBufferToImage, vkCmdCopyImageToBuffer, vkCmdUpdateBuffer, vkCmdFillBuffer, vkCmdClearColorImage, vkCmdClearDepthStencilImage, vkCmdResolveImage, vkCmdSetEvent, vkCmdResetEvent, vkCmdResetQueryPool, vkCmdCopyQueryPoolResults, vkCmdBeginRenderPass are not called during an active Renderpass, and that binding compute descriptor sets or pipelines does not take place during an active RenderpassINVALID_RENDERPASS_CMDvkCmdBindPipeline vkCmdBindDescriptorSets vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdResetQueryPool vkCmdCopyQueryPoolResults vkCmdBeginRenderPassRenderPassWithinRenderPass UpdateBufferWithinRenderPass ClearColorImageWithinRenderPass ClearDepthStencilImageWithinRenderPass FillBufferWithinRenderPassNA
Correct use of RenderPassValidates that the following rendering commands are issued inside an active RenderPass: vkCmdDraw, vkCmdDrawIndexed, vkCmdDrawIndirect, vkCmdDrawIndexedIndirect, vkCmdClearAttachments, vkCmdNextSubpass, vkCmdEndRenderPassNO_ACTIVE_RENDERPASSvkCmdBindPipeline vkCmdBindDescriptorSets vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdClearAttachments vkCmdNextSubpass vkCmdEndRenderPassBindPipelineNoRenderPass ClearAttachmentsOutsideRenderPassNA
Valid RenderPassFlag error if attempt made to Begin/End/Continue a NULL or otherwise invalid RenderPass objectINVALID_RENDERPASSvkCmdBeginRenderPass vkCmdEndRenderPass vkBeginCommandBufferNullRenderPassNA
RenderPass CompatibilityVerify that active renderpass is compatible with renderpass specified in secondary command buffer, and that renderpass specified for a framebuffer is compatible with renderpass specified in secondary command bufferRENDERPASS_INCOMPATIBLEvkCmdExecuteCommands vkBeginCommandBufferTBDNone
Framebuffer CompatibilityIf a framebuffer is passed to secondary command buffer in vkBeginCommandBuffer, then it must match active renderpass (if any) at time of vkCmdExecuteCommandsFRAMEBUFFER_INCOMPATIBLEvkCmdExecuteCommandsTBDNone
DescriptorSet UpdatedWarn user if DescriptorSet bound that was never updated and is not empty. Trigger error at draw time if a set being used was never updated.DESCRIPTOR_SET_NOT_UPDATEDvkCmdBindDescriptorSets vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectDescriptorSetCompatibilityNA
DescriptorSet BoundError if DescriptorSet not bound that is used by currently bound VkPipeline at draw timeDESCRIPTOR_SET_NOT_BOUNDvkCmdBindDescriptorSetsDescriptorSetNotUpdatedNA
Dynamic Offset CountError if dynamicOffsetCount at CmdBindDescriptorSets time is not equal to the actual number of dynamic descriptors in all sets being bound.INVALID_DYNAMIC_OFFSET_COUNTvkCmdBindDescriptorSetsInvalidDynamicOffsetCasesNone
Dynamic OffsetsAt draw time, for a *_DYNAMIC type descriptor, the combination of dynamicOffset along with offset and range from its descriptor update must be less than the size of its buffer.DYNAMIC_OFFSET_OVERFLOWvkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirectInvalidDynamicOffsetCasesNone
Correct Clear UseWarn user if CmdClear for Color or DepthStencil issued to Cmd Buffer prior to a Draw Cmd. RenderPass LOAD_OP_CLEAR is preferred in this case.CLEAR_CMD_BEFORE_DRAWvkCmdClearColorImage vkCmdClearDepthStencilImageClearCmdNoDrawNA
Index Buffer BindingVerify that an index buffer is bound at the point when an indexed draw is attempted.INDEX_BUFFER_NOT_BOUNDvkCmdDrawIndexed vkCmdDrawIndexedIndirectTODOImplement validation test
Viewport and Scissors matchIn PSO viewportCount and scissorCount must match. Also for each count that is non-zero, there corresponding data array ptr should be non-NULL.VIEWPORT_SCISSOR_MISMATCHvkCreateGraphicsPipelines vkCmdSetViewport vkCmdSetScissorTODOImplement validation test
Valid Image Aspects for descriptor UpdatesWhen updating ImageView for Descriptor Sets with layout of DEPTH_STENCIL type, the Image Aspect must not have both the DEPTH and STENCIL aspects set, but must have one of the two set. For COLOR_ATTACHMENT, aspect must have COLOR_BIT set.INVALID_IMAGE_ASPECTvkUpdateDescriptorSetsDepthStencilImageViewWithColorAspectBitErrorThis test hits Image layer error, but tough to create case that that skips that error and gets to VK_LAYER_LUNARG_core_validaton draw state error.
Valid sampler descriptor UpdatesAn invalid sampler is used when updating SAMPLER descriptor.SAMPLER_DESCRIPTOR_ERRORvkUpdateDescriptorSetsSampleDescriptorUpdateErrorCurrently only making sure sampler handle is known, can add further validation for sampler parameters
Immutable sampler update consistencyWithin a single write update, all sampler updates must use either immutable samplers or non-immutable samplers, but not a combination of both.INCONSISTENT_IMMUTABLE_SAMPLER_UPDATEvkUpdateDescriptorSetsNoneWrite a test for this case
Valid imageView descriptor UpdatesAn invalid imageView is used when updating *_IMAGE or *_ATTACHMENT descriptor.IMAGEVIEW_DESCRIPTOR_ERRORvkUpdateDescriptorSetsImageViewDescriptorUpdateErrorCurrently only making sure imageView handle is known, can add further validation for imageView and underlying image parameters
Valid bufferView descriptor UpdatesAn invalid bufferView is used when updating *_TEXEL_BUFFER descriptor.BUFFERVIEW_DESCRIPTOR_ERRORvkUpdateDescriptorSetsBufferViewDescriptorUpdateErrorCurrently only making sure bufferView handle is known, can add further validation for bufferView parameters
Valid bufferInfo descriptor UpdatesAn invalid bufferInfo is used when updating _UNIFORM_BUFFER or _STORAGE_BUFFER descriptor.BUFFERINFO_DESCRIPTOR_ERRORvkUpdateDescriptorSetsTODOImplement validation test
Attachment References in SubpassAttachment reference must be present in active subpassMISSING_ATTACHMENT_REFERENCEvkCmdClearAttachmentsBufferInfoDescriptorUpdateErrorCurrently only making sure bufferInfo has buffer whose handle is known, can add further validation for bufferInfo parameters
Verify Image LayoutsValidate correct image layouts for presents, image transitions, command buffers and renderpassesINVALID_IMAGE_LAYOUTvkCreateRenderPass vkMapMemory vkQueuePresentKHR vkQueueSubmit vkCmdCopyImage vkCmdCopyImageToBuffer vkCmdWaitEvents VkCmdPipelineBarrierTBDNone
Verify Memory Access Flags/Memory BarriersValidate correct access flags for memory barriersINVALID_BARRIERvkCmdWaitEvents vkCmdPipelineBarrierTBDNone
Verify Memory Buffer Not DeletedValidate Command Buffer not submitted with deleted memory bufferINVALID_BUFFERvkQueueSubmitTBDNone
Verify Memory Buffer DestroyValidate memory buffers are not destroyed more than onceDOUBLE_DESTROYvkDestroyBufferTBDNone
Verify Object Not In UseValidate that object being freed or modified is not in useOBJECT_INUSEvkDestroyBuffer vkFreeDescriptorSets vkUpdateDescriptorSetsTBDNone
Verify Get QueriesValidate that that queries are properly setup, initialized and synchronizedINVALID_QUERYvkGetFenceStatus vkQueueWaitIdle vkWaitForFences vkDeviceWaitIdle vkCmdBeginQuery vkCmdEndQueryTBDNone
Verify Fences Not In UseValidate that that fences are not used in multiple submit calls at the same timeINVALID_FENCEvkQueueSubmitTBDNone
Verify Semaphores Not In UseValidate that the semaphores are not used in multiple submit calls at the same timeINVALID_SEMAPHOREvkQueueSubmitTBDNone
Verify Events Not In UseValidate that that events are not used at the time they are destroyedINVALID_EVENTvkDestroyEventTBDNone
Live SemaphoreWhen waiting on a semaphore, need to make sure that the semaphore is live and therefore can be signalled, otherwise queue is stalled and cannot make forward progress.QUEUE_FORWARD_PROGRESSvkQueueSubmit vkQueueBindSparse vkQueuePresentKHR vkAcquireNextImageKHRTODOCreate test
Storage Buffer AlignmentStorage Buffer offsets in BindDescriptorSets must agree with offset alignment device limitINVALID_STORAGE_BUFFER_OFFSETvkCmdBindDescriptorSetsTODOCreate test
Uniform Buffer AlignmentUniform Buffer offsets in BindDescriptorSets must agree with offset alignment device limitINVALID_UNIFORM_BUFFER_OFFSETvkCmdBindDescriptorSetsTODOCreate test
Independent BlendingIf independent blending is not enabled, all elements of pAttachments must be identicalINDEPENDENT_BLENDvkCreateGraphicsPipelinesTODOCreate test
Enabled Logic OperationsIf logic operations is not enabled, logicOpEnable must be VK_FALSEDISABLED_LOGIC_OPvkCreateGraphicsPipelinesTODOCreate test
Valid Logic OperationsIf logicOpEnable is VK_TRUE, logicOp must be a valid VkLogicOp valueINVALID_LOGIC_OPvkCreateGraphicsPipelinesTODOCreate test
QueueFamilyIndex is ValidValidates that QueueFamilyIndices are less an the number of QueueFamiliesINVALID_QUEUE_INDEXvkCmdWaitEvents vkCmdPipelineBarrier vkCreateBuffer vkCreateImageTODOCreate test
Push ConstantsValidate that the size of push constant ranges and updates does not exceed maxPushConstantSizePUSH_CONSTANTS_ERRORvkCreatePipelineLayout vkCmdPushConstantsTODOCreate test
NAEnum used for informational messagesNONENANone
NAEnum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer.INTERNAL_ERRORNANone
NAEnum used when VK_LAYER_LUNARG_core_validation attempts to allocate memory for its own internal use and is unable to.OUT_OF_MEMORYNANone
NAEnum used when VK_LAYER_LUNARG_core_validation attempts to allocate memory for its own internal use and is unable to.OUT_OF_MEMORYNANone

VK_LAYER_LUNARG_core_validation Draw State Pending Work

Additional Draw State-related checks to be added:

  1. Lifetime validation (See bug 13383)
  2. GetRenderAreaGranularity - The pname:renderPass parameter must be the same as the one given in the sname:VkRenderPassBeginInfo structure for which the render area is relevant.
  3. Update Gfx Pipe Create Info shadowing to remove new/delete and instead use unique_ptrs for auto clean-up
  4. Add validation for Pipeline Derivatives (see Pipeline Derivatives) section of the spec

See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests

VK_LAYER_LUNARG_core_validation Shader Checker Details Table

The Shader Checker portion of the VK_LAYER_LUNARG_core_validation layer inspects the SPIR-V shader images and fixed function pipeline stages at PSO creation time. It flags errors when inconsistencies are found across interfaces between shader stages. The exact behavior of the checksdepends on the pair of pipeline stages involved.

CheckOverviewENUM SHADER_CHECKER_*Relevant APITestnameNotes/TODO
Not consumedFlag warning if a location is not consumed (useless work)OUTPUT_NOT_CONSUMEDvkCreateGraphicsPipelinesCreatePipeline*NotConsumedNA
Not producedFlag error if a location is not produced (consumer reads garbage)INPUT_NOT_PRODUCEDvkCreateGraphicsPipelinesCreatePipeline*NotProvidedNA
Type mismatchFlag error if a location has inconsistent typesINTERFACE_TYPE_MISMATCHvkCreateGraphicsPipelinesCreatePipeline*TypeMismatchBetween shader stages, an exact structural type match is required. Between VI and VS, or between FS and CB, only the basic component type must match (float for UNORM/SNORM/FLOAT, int for SINT, uint for UINT) as the VI and CB stages perform conversions to the exact format.
Inconsistent shaderFlag error if an inconsistent SPIR-V image is detected. Possible cases include broken type definitions which the layer fails to walk.INCONSISTENT_SPIRVvkCreateGraphicsPipelinesTODOAll current tests use the reference compiler to produce valid SPIRV images from GLSL.
Non-SPIRV shaderFlag warning if a non-SPIR-V shader image is detected. This can occur if early drivers are ingesting GLSL. VK_LAYER_LUNARG_ShaderChecker cannot analyze non-SPIRV shaders, so this suppresses most other checks.NON_SPIRV_SHADERvkCreateGraphicsPipelinesTODONA
VI Binding DescriptionsValidate that there is a single vertex input binding description for each bindingINCONSISTENT_VIvkCreateGraphicsPipelinesCreatePipelineAttribBindingConflictNA
Shader Stage CheckWarns if shader stage is unsupportedUNKNOWN_STAGEvkCreateGraphicsPipelinesTBDNA
Shader SpecializationError if specialization entry data is not fully contained within the specialization data block.BAD_SPECIALIZATIONvkCreateGraphicsPipelines vkCreateComputePipelinesTBDNA
Missing DescriptorFlags error if shader attempts to use a descriptor binding not declared in the layoutMISSING_DESCRIPTORvkCreateGraphicsPipelinesCreatePipelineUniformBlockNotProvidedNA
Missing EntrypointFlags error if specified entrypoint is not present in the shader moduleMISSING_ENTRYPOINTvkCreateGraphicsPipelinesTBDNA
Push constant out of rangeFlags error if a member of a push constant block is not contained within a push constant range specified in the pipeline layoutPUSH_CONSTANT_OUT_OF_RANGEvkCreateGraphicsPipelinesCreatePipelinePushContantsNotInLayoutNA
Push constant not accessible from stageFlags error if the push constant range containing a push constant block member is not accessible from the current shader stage.PUSH_CONSTANT_NOT_ACCESSIBLE_FROM_STAGEvkCreateGraphicsPipelinesTBDNA
Descriptor not accessible from stageFlags error if a descriptor used by a shader stage does not include that stage in its stageFlagsDESCRIPTOR_NOT_ACCESSIBLE_FROM_STAGEvkCreateGraphicsPipelinesTBDNA
Descriptor type mismatchFlags error if a descriptor type does not match the shader resource type.DESCRIPTOR_TYPE_MISMATCHvkCreateGraphicsPipelinesTBDNA
Feature not enabledFlags error if a capability declared by the shader requires a feature not enabled on the deviceFEATURE_NOT_ENABLEDvkCreateGraphicsPipelinesTBDNA
Bad capabilityFlags error if a capability declared by the shader is not supported by Vulkan shadersBAD_CAPABILITYvkCreateGraphicsPipelinesTBDNA
NAEnum used for informational messagesNONENANone

VK_LAYER_LUNARG_core_validation Shader Checker Pending Work

  • Additional test cases for variously broken SPIRV images
  • Validation of a single SPIRV image in isolation (the spec describes many constraints)

See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests

VK_LAYER_LUNARG_core_validation Memory Tracker Details Table

The Mem Tracker portion of the VK_LAYER_LUNARG_core_validation layer tracks memory objects and references and validates that they are managed correctly by the application. This includes tracking object bindings, memory hazards, and memory object lifetimes. Several other hazard-related issues related to command buffers, fences, and memory mapping are also validated in this layer segment.

CheckOverviewENUM MEMTRACK_*Relevant APITestnameNotes/TODO
Valid Command BufferVerifies that the command buffer was properly created and is currently validINVALID_CBvkCmdBindPipeline vkCmdSetViewport vkCmdSetLineWidth vkCmdSetDepthBias vkCmdSetBlendConstants vkCmdSetDepthBounds vkCmdSetStencilCompareMask vkCmdSetStencilWriteMask vkCmdSetStencilReference vkBeginCommandBuffer vkResetCommandBuffer vkDestroyDevice vkFreeMemoryNANA
Valid Memory ObjectVerifies that the memory object was properly created and is currently validINVALID_MEM_OBJvkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage vkFreeMemory vkBindBufferMemory vkBindImageMemory vkQueueBindSparseNANA
Memory AliasingFlag error if image and/or buffer memory binding ranges overlapINVALID_ALIASINGvkBindBufferMemory vkBindImageMemoryTODOImplement test
Memory LayoutFlag error if attachment is cleared with invalid first layoutINVALID_LAYOUTvkCmdBeginRenderPassTODOImplement test
Free Referenced MemoryChecks to see if memory being freed still has current referencesFREED_MEM_REFvmFreeMemoryFreeBoundMemoryNA
Memory Properly BoundValidate that the memory object referenced in the call was properly created, is currently valid, and is properly bound to the objectMISSING_MEM_BINDINGSvkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyQueryPoolResults vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImageNANA
Valid ObjectVerifies that the specified Vulkan object was created properly and is currently validINVALID_OBJECTvkCmdBindPipeline vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImageNANA
Bind Invalid MemoryValidate that memory object was correctly created, that the command buffer object was correctly created, and that both are currently valid objects.MEMORY_BINDING_ERRORvkQueueBindSparse vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImageNAThe valid Object checks are primarily the responsibilty of VK_LAYER_LUNARG_object_tracker layer, so these checks are more of a backup in case VK_LAYER_LUNARG_object_tracker is not enabled
Objects Not DestroyedVerify all objects destroyed at DestroyDevice timeMEMORY_LEAKvkDestroyDeviceNANA
Memory Mapping StateVerifies that mapped memory is CPU-visibleINVALID_STATEvkMapMemoryMapMemWithoutHostVisibleBitNA
Command Buffer SynchronizationCommand Buffer must be complete before BeginCommandBuffer or ResetCommandBuffer can be calledRESET_CB_WHILE_IN_FLIGHTvkBeginCommandBuffer vkResetCommandBufferCallBeginCommandBufferBeforeCompletion CallBeginCommandBufferBeforeCompletionNA
Submitted Fence StatusVerifies that: The fence is not submitted in an already signaled state, that ResetFences is not called with a fence in an unsignaled state, and that fences being checked have been submittedINVALID_FENCE_STATEvkResetFences vkWaitForFences vkQueueSubmit vkGetFenceStatusSubmitSignaledFence ResetUnsignaledFenceCreate test(s) for case where an unsubmitted fence is having its status checked
Immutable Memory BindingValidates that non-sparse memory bindings are immutable, so objects are not re-boundtREBIND_OBJECTvkBindBufferMemory, vkBindImageMemoryRebindMemoryNA
Image/Buffer Usage bitsVerify correct USAGE bits set based on how Images and Buffers are usedINVALID_USAGE_FLAGvkCreateImage, vkCreateBuffer, vkCreateBufferView, vkCmdCopyBuffer, vkCmdCopyQueryPoolResults, vkCmdCopyImage, vkCmdBlitImage, vkCmdCopyBufferToImage, vkCmdCopyImageToBuffer, vkCmdUpdateBuffer, vkCmdFillBufferInvalidUsageBitsNA
Objects Not Destroyed WarningWarns if any memory objects have not been freed before their objects are destroyedMEM_OBJ_CLEAR_EMPTY_BINDINGSvkDestroyDeviceTBDNA
Memory Map Range ChecksValidates that Memory Mapping Requests are valid for the Memory Object (in-range, not currently mapped on Map, currently mapped on UnMap, size is non-zero)INVALID_MAPvkMapMemoryTBDNA
NAEnum used for informational messagesNONENANone
NAEnum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer.INTERNAL_ERRORNANone

VK_LAYER_LUNARG_core_validation Memory Tracker Pending Work and Enhancements

See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests

  1. Consolidate error messages and make them consistent
  2. Add validation for maximum memory references, maximum object counts, and object leaks
  3. Warn on image/buffer deletion if USAGE bits were set that were not needed
  4. Modify INVALID_FENCE_STATE to be WARNINGs instead of ERROR

VK_LAYER_LUNARG_parameter_validation

VK_LAYER_LUNARG_parameter_validation Overview

The VK_LAYER_LUNARG_parameter_validation layer validates parameter values and flags errors for any values that are outside of acceptable values for the given parameter.

VK_LAYER_LUNARG_parameter_validation Details Table

CheckOverviewENUMRelevant APITestnameNotes/TODO
Input ParametersPointers in structures are recursively validated to be non-null. Enumerated types are validated against min and max enum values. Structure Types are verified to be correct.NAvkQueueSubmit vkAllocateMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkQueueBindSparse vkCreateFence vkResetFences vkWaitForFences vkCreateSemaphore vkCreateEvent vkCreateQueryPool vkCreateBuffer vkCreateBufferView vkCreateImage vkGetImageSubresourceLayout vkCreateImageView vkCreatePipelineCache vkMergePipelineCaches vkCreateGraphicsPipelines vkCreateComputePipelines vkCreatePipelineLayout vkCreateSampler vkCreateDescriptorSetLayout( vkCreateDescriptorPool vkAllocateDescriptorSets vkFreeDescriptorSets vkUpdateDescriptorSets vkCreateFramebuffer vkCreateRenderPass vkCreateCommandPool vkAllocateCommandBuffers vkBeginCommandBuffer vkCmdBindDescriptorSets vkCmdBindVertexBuffers vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearAttachments vkCmdResolveImage vkCmdWaitEvents vkCmdPipelineBarrier vkCmdPushConstants vkCmdBeginRenderPass vkCmdExecuteCommandsTBDNA
Call results, Output ParametersReturn values are checked for VK_SUCCESS, returned pointers are checked to be NON-NULL, enumerated types of return values are checked to be within the defined range.NAvkEnumeratePhysicalDevices vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceLimits vkGetPhysicalDeviceProperties vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceMemoryProperties vkGetDeviceQueue vkQueueSubmit vkQueueWaitIdle vkDeviceWaitIdle vkAllocateMemory vkFreeMemory vkMapMemory vkUnmapMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkGetDeviceMemoryCommitment vkBindBufferMemory vkBindImageMemory vkGetBufferMemoryRequirements vkGetImageMemoryRequirements vkGetImageSparseMemoryRequirements vkGetPhysicalDeviceSparseImageFormatProperties vkQueueBindSparse vkCreateFence vkDestroyFence vkResetFences vkGetFenceStatus vkWaitForFences vkCreateSemaphore vkDestroySemaphore vkCreateEvent vkDestroyEvent vkGetEventStatus vkSetEvent vkResetEvent vkCreateQueryPool vkDestroyQueryPool vkGetQueryPoolResults vkCreateBuffer vkDestroyBuffer vkCreateBufferView vkDestroyBufferView vkCreateImage vkDestroyImage vkGetImageSubresourceLayout vkCreateImageView vkDestroyImageView vkDestroyShaderModule vkCreatePipelineCache vkDestroyPipelineCache vkGetPipelineCacheData vkMergePipelineCaches vkCreateGraphicsPipelines vkCreateComputePipelines vkDestroyPipeline vkCreatePipelineLayout vkDestroyPipelineLayout vkCreateSampler vkDestroySampler vkCreateDescriptorSetLayout vkDestroyDescriptorSetLayout vkCreateDescriptorPool vkDestroyDescriptorPool vkResetDescriptorPool vkAllocateDescriptorSets vkFreeDescriptorSets vkUpdateDescriptorSets vkCreateFramebuffer vkDestroyFramebuffer vkCreateRenderPass vkDestroyRenderPass vkGetRenderAreaGranularity vkCreateCommandPool vkDestroyCommandPool vkResetCommandPool vkAllocateCommandBuffers vkFreeCommandBuffers vkBeginCommandBuffer vkEndCommandBuffer vkResetCommandBuffer vkCmdBindPipeline vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearAttachments vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdCopyQueryPoolResults vkCmdPushConstants vkCmdBeginRenderPass vkCmdNextSubpass vkCmdEndRenderPass vkCmdExecuteCommandsTBDNA
NAEnum used for informational messagesNONENANone

VK_LAYER_LUNARG_parameter_validation Pending Work

Additional work to be done

  1. Source2 was creating a VK_FORMAT_R8_SRGB texture (and image view) which was not supported by the underlying implementation (rendersystemtest imageformat test). Checking that formats are supported by the implementation is something the validation layer could do using the VK_FORMAT_INFO_TYPE_PROPERTIES query. There are probably a bunch of checks here you could be doing around vkCreateImage formats along with whether image/color/depth attachment views are valid. I’m not sure how much of this is already there.
  2. From AMD: we were using an image view with a swizzle of VK_COLOR_COMPONENT_FORMAT_A with a BC1_RGB texture, which is not valid because the texture does not have an alpha channel. In general, should validate that the swizzles do not reference components not in the texture format.
  3. When querying VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PROPERTIES must provide enough memory for all the queues on the device (not just 1 when device has multiple queues).
  4. INT & FLOAT bordercolors. Border color int/float selection must match associated texture format.
  5. Flag error on VkBufferCreateInfo if buffer size is 0
  6. VkImageViewCreateInfo.format must be set
  7. For vkCreateGraphicsPipelines, correctly handle array of pCreateInfos and array of pStages within each element of pCreatInfos
  8. Check for valid VkIndexType in vkCmdBindIndexBuffer() should be in PreCmdBindIndexBuffer() call
  9. Check for valid VkPipelineBindPoint in vkCmdBindPipeline() & vkCmdBindDescriptorSets() should be in PreCmdBindPipeline() & PreCmdBindDescriptorSets() calls respectively.

See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests

VK_LAYER_LUNARG_image

VK_LAYER_LUNARG_image Layer Overview

The VK_LAYER_LUNARG_image layer is responsible for validating format-related information and enforcing format restrictions.

VK_LAYER_LUNARG_image Layer Details Table

DETAILS TABLE PENDING

CheckOverviewENUM IMAGE_*Relevant APITestnameNotes/TODO
Image FormatVerifies that requested format is a supported Vulkan format on this deviceFORMAT_UNSUPPORTEDvkCreateImage vkCreateRenderPassTBDNA
RenderPass AttachmentsValidates that attachment image layouts, loadOps, and storeOps are valid Vulkan valuesRENDERPASS_INVALID_ATTACHMENTvkCreateRenderPassTBDNA
Subpass DS SettingsVerifies that if there is no depth attachment then the subpass attachment is set to VK_ATTACHMENT_UNUSEDRENDERPASS_INVALID_DS_ATTACHMENTvkCreateRenderPassTBDNA
View CreationVerify that requested Image View Creation parameters are reasonable for the image that the view is being created forVIEW_CREATE_ERRORvkCreateImageViewTBDNA
Image AspectsVerify that Image commands are using valid Image Aspect flagsINVALID_IMAGE_ASPECTvkCreateImageView vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearAttachments vkCmdCopyImage vkCmdCopyImageToBuffer vkCmdCopyBufferToImage vkCmdResolveImage vkCmdBlitImageInvalidImageViewAspectNA
Image Aspect MismatchVerify that Image commands with source and dest images use matching aspect flagsMISMATCHED_IMAGE_ASPECTvkCmdCopyImageTBDNA
Image Type MismatchVerify that Image commands with source and dest images use matching typesMISMATCHED_IMAGE_TYPEvkCmdCopyImage vkCmdResolveImageCopyImageTypeMismatch ResolveImageTypeMismatchNA
Image Format MismatchVerify that Image commands with source and dest images use matching formatsMISMATCHED_IMAGE_FORMATvkCmdCopyImage vkCmdResolveImageCopyImageDepthStencilFormatMismatch ResolveImageFormatMismatchNA
Resolve Sample CountVerifies that source and dest images sample counts are validINVALID_RESOLVE_SAMPLESvkCmdResolveImageResolveImageHighSampleCount ResolveImageLowSampleCountNA
Verify FormatVerifies the formats are valid for this image operationINVALID_FORMATvkCreateImageView vkCmdBlitImageTBDNA
Verify Correct Image FilterVerifies that specified filter is validINVALID_FILTERvkCmdBlitImageTBDNA
Verify Correct Image SettingsVerifies that values are valid for a given resource or subresourceINVALID_IMAGE_RESOURCEvkCmdPipelineBarrierTBDNA
Verify Image Format LimitsVerifies that image creation parameters are with the device format limitsINVALID_FORMAT_LIMITS_VIOLATIONvkCreateImageTBDNA
Verify LayoutVerifies the layouts are valid for this image operationINVALID_LAYOUTvkCreateImage vkCmdClearColorImageTBDNA
NAEnum used for informational messagesNONENANone

VK_LAYER_LUNARG_image Pending Work

See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests

VK_LAYER_LUNARG_object_tracker

VK_LAYER_LUNARG_object_tracker Overview

The VK_LAYER_LUNARG_object_tracker layer maintains a record of all Vulkan objects. It flags errors when invalid objects are used and at DestroyInstance time it flags any objects that were not properly destroyed.

VK_LAYER_LUNARG_object_tracker Details Table

CheckOverviewENUM OBJTRACK_*Relevant APITestnameNotes/TODO
Valid ObjectValidates that referenced object was properly created and is currently valid.INVALID_OBJECTvkAcquireNextImageKHR vkAllocateDescriptorSets vkAllocateMemory vkBeginCommandBuffer vkBindBufferMemory vkBindImageMemory vkCmdBeginQuery vkCmdBeginRenderPass vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindPipeline vkCmdBindVertexBuffers vkCmdBlitImage vkCmdClearAttachments vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdCopyBuffer vkCmdCopyBufferToImage vkCmdCopyImage vkCmdCopyImageToBuffer vkCmdCopyQueryPoolResults vkCmdDispatch vkCmdDispatchIndirect vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndexedIndirect vkCmdDrawIndirect vkCmdEndQuery vkCmdEndRenderPass vkCmdExecuteCommands vkCmdFillBuffer vkCmdNextSubpass vkCmdPipelineBarrier vkCmdPushConstants vkCmdResetEvent vkCmdResetQueryPool vkCmdResolveImage vkCmdSetEvent vkCmdUpdateBuffer vkCmdWaitEvents vkCmdWriteTimestamp vkCreateBuffer vkCreateBufferView vkAllocateCommandBuffers vkCreateCommandPool vkCreateComputePipelines vkCreateDescriptorPool vkCreateDescriptorSetLayout vkCreateEvent vkCreateFence vkCreateFramebuffer vkCreateGraphicsPipelines vkCreateImage vkCreateImageView vkCreatePipelineCache vkCreatePipelineLayout vkCreateQueryPool vkCreateRenderPass vkCreateSampler vkCreateSemaphore vkCreateShaderModule vkCreateSwapchainKHR vkDestroyBuffer vkDestroyBufferView vkFreeCommandBuffers vkDestroyCommandPool vkDestroyDescriptorPool vkDestroyDescriptorSetLayout vkDestroyEvent vkDestroyFence vkDestroyFramebuffer vkDestroyImage vkDestroyImageView vkDestroyPipeline vkDestroyPipelineCache vkDestroyPipelineLayout vkDestroyQueryPool vkDestroyRenderPass vkDestroySampler vkDestroySemaphore vkDestroyShaderModule vkDestroySwapchainKHR vkDeviceWaitIdle vkEndCommandBuffer vkEnumeratePhysicalDevices vkFreeDescriptorSets vkFreeMemory vkFreeMemory vkGetBufferMemoryRequirements vkGetDeviceMemoryCommitment vkGetDeviceQueue vkGetEventStatus vkGetFenceStatus vkGetImageMemoryRequirements vkGetImageSparseMemoryRequirements vkGetImageSubresourceLayout vkGetPhysicalDeviceSurfaceSupportKHR vkGetPipelineCacheData vkGetQueryPoolResults vkGetRenderAreaGranularity vkInvalidateMappedMemoryRanges vkMapMemory vkMergePipelineCaches vkQueueBindSparse vkResetCommandBuffer vkResetCommandPool vkResetDescriptorPool vkResetEvent vkResetFences vkSetEvent vkUnmapMemory vkUpdateDescriptorSets vkWaitForFencesBindInvalidMemory BindMemoryToDestroyedObjectEvery VkObject class of parameter will be run through this check. This check may ultimately supersede UNKNOWN_OBJECT
Object CleanupVerify that object properly destroyedDESTROY_OBJECT_FAILEDvkDestroyInstance, vkDestroyDevice, vkFreeMemory?NA
Objects LeakWhen an Instance or Device object is destroyed, validates that all objects belonging to that device/instance have previously been destroyedOBJECT_LEAKvkDestroyDevice vkDestroyInstance?NA
Object CountFlag error if number of objects requested from extenstion functions exceeds max number of actual objectsOBJCOUNT_MAX_EXCEEDEDobjTrackGetObjects objTrackGetObjectsOfType?NA
Valid Destroy ObjectValidates that an object pass into a destroy function was properly created and is currently validNONEvkDestroyInstance vkDestroyDevice vkDestroyFence vkDestroySemaphore vkDestroyEvent vkDestroyQueryPool vkDestroyBuffer vkDestroyBufferView vkDestroyImage vkDestroyImageView vkDestroyShaderModule vkDestroyPipelineCache vkDestroyPipeline vkDestroyPipelineLayout vkDestroySampler vkDestroyDescriptorSetLayout vkDestroyDescriptorPool vkDestroyCommandPool vkFreeCommandBuffers vkDestroyFramebuffer vkDestroyRenderPass vkDestroySwapchainKHRTBDThese cases need to be moved to a more appropriate error enum
Unknown objectInternal layer errors when it attempts to update use count for an object that's not in its internal tracking datastructures.UNKNOWN_OBJECTNAThis may be irrelevant due to INVALID_OBJECT error, need to look closely and merge this with that error as appropriate.
Correct Command PoolValidates that command buffers in a FreeCommandBuffers call were all created in the specified commandPoolCOMMAND_POOL_MISMATCHvkFreeCommandBuffersTBDNA
Correct Descriptor PoolValidates that descriptor sets in a FreeDescriptorSets call were all created in the specified descriptorPoolDESCRIPTOR_POOL_MISMATCHvkFreeDescriptorSetsTBDNA
NAEnum used for informational messagesNONENANone
NAEnum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer.INTERNAL_ERRORNANone

VK_LAYER_LUNARG_object_tracker Pending Work

  1. Verify images have CmdPipelineBarrier layouts matching new layout parameters to CmdImage functions
  2. For specific object instances that are allowed to be NULL, update object validation to verify that such objects are either NULL or valid
  3. Verify cube array VkImageView objects use subresourceRange.arraySize (or effective arraySize when VK_REMAINING_ARRAY_SLICES is specified) that is a multiple of 6.
  4. Make object maps specific to instance and device. Objects may only be used with matching instance or device.

See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests

VK_LAYER_GOOGLE_threading

VK_LAYER_GOOGLE_threading Overview

The VK_LAYER_GOOGLE_threading layer checks for simultaneous use of objects by calls from multiple threads. Application code is responsible for preventing simultaneous use of the same objects by certain calls that modify objects. See bug 13433 and https://cvs.khronos.org/svn/repos/oglc/trunk/nextgen/vulkan/function_properties.csv for threading rules. Objects that may need a mutex include VkQueue, VkDeviceMemory, VkObject, VkBuffer, VkImage, VkDescriptorSet, VkDescriptorPool, VkCommandBuffer, and VkSemaphore. The most common case is that a VkCommandBuffer passed to VkCmd* calls must be used by only one thread at a time.

In addition to reporting threading rule violations, the layer will enforce a mutex for those calls. That can allow an application to continue running without actually crashing due to the reported threading problem.

The layer can only observe when a mutual exclusion rule is actually violated. It cannot insure that there is no latent race condition needing mutual exclusion.

The layer can also catch reentrant use of the same object by calls from a single thread. That might happen if Vulkan calls are made from a callback function or a signal handler. But the layer cannot prevent such a reentrant use of an object.

The layer can only observe when a mutual exclusion rule is actually violated. It cannot insure that there is no latent race condition.

VK_LAYER_GOOGLE_threading Details Table

CheckOverviewENUM THREADING_CHECKER_*Relevant APITestnameNotes/TODO
Thread CollisionDetects and notifies user if multiple threads are modifying thes same objectMULTIPLE_THREADSvkQueueSubmit vkFreeMemory vkMapMemory vkUnmapMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkBindBufferMemory vkBindImageMemory vkQueueBindSparse vkDestroySemaphore vkDestroyBuffer vkDestroyImage vkDestroyDescriptorPool vkResetDescriptorPool vkAllocateDescriptorSets vkFreeDescriptorSets vkFreeCommandBuffers vkBeginCommandBuffer vkEndCommandBuffer vkResetCommandBuffer vkCmdBindPipeline vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearAttachments vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdCopyQueryPoolResults vkCmdBeginRenderPass vkCmdNextSubpass vkCmdPushConstants vkCmdEndRenderPass vkCmdExecuteCommands???NA
Thread ReentrancyDetects cases of a single thread calling Vulkan reentrantlySINGLE_THREAD_REUSEvkQueueSubmit vkFreeMemory vkMapMemory vkUnmapMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkBindBufferMemory vkBindImageMemory vkQueueBindSparse vkDestroySemaphore vkDestroyBuffer vkDestroyImage vkDestroyDescriptorPool vkResetDescriptorPool vkAllocateDescriptorSets vkFreeDescriptorSets vkFreeCommandBuffers vkBeginCommandBuffer vkEndCommandBuffer vkResetCommandBuffer vkCmdBindPipeline vkCmdSetViewport vkCmdSetBlendConstants vkCmdSetLineWidth vkCmdSetDepthBias vkCmdSetDepthBounds vkCmdSetStencilCompareMask vkCmdSetStencilWriteMask vkCmdSetStencilReference vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearAttachments vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdCopyQueryPoolResults vkCmdBeginRenderPass vkCmdNextSubpass vkCmdPushConstants vkCmdEndRenderPass vkCmdExecuteCommands???NA
NAEnum used for informational messagesNONENANone

VK_LAYER_GOOGLE_threading Pending Work

See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests

VK_LAYER_LUNARG_device_limits

VK_LAYER_LUNARG_device_limits Overview

This layer is a work in progress. VK_LAYER_LUNARG_device_limits layer is intended to capture two broad categories of errors:

  1. Incorrect use of APIs to query device capabilities
  2. Attempt to use API functionality beyond the capability of the underlying device

For the first category, the layer tracks which calls are made and flags errors if calls are excluded that should not be, or if call sequencing is incorrect. An example is an app that assumes attempts to Query and use queues without ever having called vkGetPhysicalDeviceQueueFamilyProperties(). Also, if an app is calling vkGetPhysicalDeviceQueueFamilyProperties() to retrieve properties with some assumed count for array size instead of first calling vkGetPhysicalDeviceQueueFamilyProperties() w/ a NULL pQueueFamilyProperties parameter in order to query the actual count. For the second category of errors, VK_LAYER_LUNARG_device_limits stores its own internal record of underlying device capabilities and flags errors if requests are made beyond those limits. Most (all?) of the limits are queried via vkGetPhysicalDevice* calls.

VK_LAYER_LUNARG_device_limits Details Table

CheckOverviewENUM DEVLIMITS_*Relevant APITestnameNotes/TODO
Valid instanceIf an invalid instance is used, this error will be flaggedINVALID_INSTANCEvkEnumeratePhysicalDevicesNAVK_LAYER_LUNARG_object_tracker should also catch this so if we made sure VK_LAYER_LUNARG_object_tracker was always on top, we could avoid this check
Valid physical deviceEnum used for informational messagesINVALID_PHYSICAL_DEVICEvkEnumeratePhysicalDevicesNAVK_LAYER_LUNARG_object_tracker should also catch this so if we made sure VK_LAYER_LUNARG_object_tracker was always on top, we could avoid this check
Valid inherited queryIf an invalid inherited query is used, this error will be flaggedINVALID_INHERITED_QUERYvkBeginCommandBufferNANone
Querying array countsFor API calls where an array count should be queried with an initial call and a NULL array pointer, verify that such a call was made before making a call with non-null array pointer.MUST_QUERY_COUNTvkEnumeratePhysicalDevices vkGetPhysicalDeviceQueueFamilyPropertiesNACreate focused test
Array count valueFor API calls where an array of details is queried, verify that the size of the requested array matches the size of the array supported by the device.COUNT_MISMATCHvkEnumeratePhysicalDevices vkGetPhysicalDeviceQueueFamilyPropertiesNACreate focused test
Queue CreationWhen creating/requesting queues, make sure that QueueFamilyPropertiesIndex and index/count within that queue family are valid.INVALID_QUEUE_CREATE_REQUESTvkGetDeviceQueue vkCreateDeviceNACreate focused test
Query PropertiesBefore creating an Image, warn if physical device properties have not been queriedMUST_QUERY_PROPERTIESvkCreateImageNAAdd validation test
API Call SequencingThis is a general error indicating that an app did not use vkGetPhysicalDevice* and other such query calls, but rather made an assumption about device capabilities.INVALID_CALL_SEQUENCEvkCreateDeviceNAAdd validation test
Feature RequestAttempting to vkCreateDevice with a feature that is not supported by the underlying physical device.INVALID_FEATURE_REQUESTEDvkCreateDeviceNAAdd validation test
Valid Image ExtentsWhen creating an Image, ensure that image extents are within device limits for the specified formatLIMITS_VIOLATIONvkCreateImageCreateImageLimitsViolationWidthNA
Valid Image Resource SizeWhen creating an image, ensure the the total image resource size is less than the queried device maximum resource sizeLIMITS_VIOLATIONvkCreateImageCreateImageResourceSizeViolationNA
AlignmentWhen updating a buffer, data should be aligned on 4 byte boundariesLIMITS_VIOLATIONvkCmdUpdateBufferUpdateBufferAlignmentNA
AlignmentWhen filling a buffer, data should be aligned on 4 byte boundariesLIMITS_VIOLATIONvkCmdFillBufferUpdateBufferAlignmentNA
Storage Buffer AlignmentStorage Buffer offsets must agree with offset alignment device limitINVALID_STORAGE_BUFFER_OFFSETvkBindBufferMemory vkUpdateDescriptorSetsTODOCreate test
Uniform Buffer AlignmentUniform Buffer offsets must agree with offset alignment device limitINVALID_UNIFORM_BUFFER_OFFSETvkBindBufferMemory vkUpdateDescriptorSetsTODOCreate test
NAEnum used for informational messagesNONENANone

VK_LAYER_LUNARG_device_limits Pending Work

  1. For all Formats, call vkGetPhysicalDeviceFormatProperties to pull their properties for the underlying device. After that point, if the app attempts to use any formats in violation of those properties, flag errors (this is done for Images).

See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests

VK_LAYER_LUNARG_swapchain

Swapchain Overview

This layer is a work in progress. VK_LAYER_LUNARG_swapchain layer is intended to ...

VK_LAYER_LUNARG_swapchain Details Table

CheckOverviewENUM SWAPCHAIN_*Relevant APITestnameNotes/TODO
Valid handleIf an invalid handle is used, this error will be flaggedINVALID_HANDLEvkCreateDevice vkCreateSwapchainKHRNANone
Valid pointerIf a NULL pointer is used, this error will be flaggedNULL_POINTERvkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfacePresentModesKHR vkCreateSwapchainKHR vkGetSwapchainImagesKHR vkAcquireNextImageKHR vkQueuePresentKHRNANone
Extension enabled before useValidates that a WSI extension is enabled before its functions are usedEXT_NOT_ENABLED_BUT_USEDvkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfacePresentModesKHR vkCreateSwapchainKHR vkDestroySwapchainKHR vkGetSwapchainImagesKHR vkAcquireNextImageKHR vkQueuePresentKHRNANone
Swapchains destroyed before devicesValidates that vkDestroySwapchainKHR() is called for all swapchains associated with a device before vkDestroyDevice() is calledDEL_OBJECT_BEFORE_CHILDRENvkDestroyDevice vkDestroySurfaceKHRNANone
Surface seen to support presentationValidates that pCreateInfo->surface was seen by vkGetPhysicalDeviceSurfaceSupportKHR() to support presentationCREATE_UNSUPPORTED_SURFACEvkCreateSwapchainKHRNANone
Queries occur before swapchain creationValidates that vkGetPhysicalDeviceSurfaceCapabilitiesKHR(), vkGetPhysicalDeviceSurfaceFormatsKHR() and vkGetPhysicalDeviceSurfacePresentModesKHR() are called before vkCreateSwapchainKHR()CREATE_SWAP_WITHOUT_QUERYvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->minImageCount)Validates vkCreateSwapchainKHR(pCreateInfo->minImageCount)CREATE_SWAP_BAD_MIN_IMG_COUNTvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->imageExtent)Validates vkCreateSwapchainKHR(pCreateInfo->imageExtent) when window has no fixed sizeCREATE_SWAP_OUT_OF_BOUNDS_EXTENTSvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->imageExtent)Validates vkCreateSwapchainKHR(pCreateInfo->imageExtent) when window has a fixed sizeCREATE_SWAP_EXTENTS_NO_MATCH_WINvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->preTransform)Validates vkCreateSwapchainKHR(pCreateInfo->preTransform)CREATE_SWAP_BAD_PRE_TRANSFORMvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->compositeAlpha)Validates vkCreateSwapchainKHR(pCreateInfo->compositeAlpha)CREATE_SWAP_BAD_COMPOSITE_ALPHAvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->imageArraySize)Validates vkCreateSwapchainKHR(pCreateInfo->imageArraySize)CREATE_SWAP_BAD_IMG_ARRAY_SIZEvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->imageUsageFlags)Validates vkCreateSwapchainKHR(pCreateInfo->imageUsageFlags)CREATE_SWAP_BAD_IMG_USAGE_FLAGSvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->imageColorSpace)Validates vkCreateSwapchainKHR(pCreateInfo->imageColorSpace)CREATE_SWAP_BAD_IMG_COLOR_SPACEvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->imageFormat)Validates vkCreateSwapchainKHR(pCreateInfo->imageFormat)CREATE_SWAP_BAD_IMG_FORMATvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->imageFormat and pCreateInfo->imageColorSpace)Validates vkCreateSwapchainKHR(pCreateInfo->imageFormat and pCreateInfo->imageColorSpace)CREATE_SWAP_BAD_IMG_FMT_CLR_SPvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->presentMode)Validates vkCreateSwapchainKHR(pCreateInfo->presentMode)CREATE_SWAP_BAD_PRESENT_MODEvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->imageSharingMode)Validates vkCreateSwapchainKHR(pCreateInfo->imageSharingMode)CREATE_SWAP_BAD_SHARING_MODEvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->imageSharingMode)Validates vkCreateSwapchainKHR(pCreateInfo->imageSharingMode)CREATE_SWAP_BAD_SHARING_VALUESvkCreateSwapchainKHRNANone
vkCreateSwapchainKHR(pCreateInfo->oldSwapchain and pCreateInfo->surface)pCreateInfo->surface must match pCreateInfo->oldSwapchain's surfaceCREATE_SWAP_DIFF_SURFACEvkCreateSwapchainKHRNANone
Use same device for swapchainValidates that vkDestroySwapchainKHR() called with the same VkDevice as vkCreateSwapchainKHR()DESTROY_SWAP_DIFF_DEVICEvkCreateSwapchainKHR vkDestroySwapchainKHRNANone
Don't use too many imagesValidates that app never tries to own too many swapchain images at a timeAPP_OWNS_TOO_MANY_IMAGESvkAcquireNextImageKHRNANone
Index too largeValidates that an image index is within the number of images in a swapchainINDEX_TOO_LARGEvkQueuePresentKHRNANone
Can't present a non-owned imageValidates that application only presents images that it ownsINDEX_NOT_IN_USEvkQueuePresentKHRNANone
A VkBool32 must have values of VK_TRUE or VK_FALSEValidates that a VkBool32 must have values of VK_TRUE or VK_FALSEBAD_BOOLvkCreateSwapchainKHRNANone
pCount must point to same value regardless of whether other pointer is NULLValidates that app doesn't change value of pCount returned by a queryINVALID_COUNTvkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfacePresentModesKHR vkGetSwapchainImagesKHRNANone
Valid sTypeValidates that a struct has correct value for sTypeWRONG_STYPEvkCreateSwapchainKHR vkQueuePresentKHRNANone
Valid pNextValidates that a struct has NULL for the value of pNextWRONG_NEXTvkCreateSwapchainKHR vkQueuePresentKHRNANone
Non-zero valueValidates that a required value should be non-zeroZERO_VALUEvkQueuePresentKHRNANone
Compatible AllocatorValidates that pAllocator is compatible (i.e. NULL or not) when an object is created and destroyedINCOMPATIBLE_ALLOCATORvkDestroySurfaceKHRNANone
Valid use of queueFamilyIndexValidates that a queueFamilyIndex not used before vkGetPhysicalDeviceQueueFamilyProperties() was calledDID_NOT_QUERY_QUEUE_FAMILIESvkGetPhysicalDeviceSurfaceSupportKHRNANone
Valid queueFamilyIndex valueValidates that a queueFamilyIndex value is less-than pQueueFamilyPropertyCount returned by vkGetPhysicalDeviceQueueFamilyPropertiesQUEUE_FAMILY_INDEX_TOO_LARGEvkGetPhysicalDeviceSurfaceSupportKHRNANone
Supported combination of queue and surfaceValidates that the surface associated with a swapchain was seen to support the queueFamilyIndex of a given queueSURFACE_NOT_SUPPORTED_WITH_QUEUEvkQueuePresentKHRNANone
Proper synchronization of acquired imagesvkAcquireNextImageKHR should be called with a valid semaphore and/or fenceNO_SYNC_FOR_ACQUIREvkAcquireNextImageKHRNANone

Note: The following platform-specific functions are not mentioned above, because they are protected by ifdefs, which cause test failures:

  • vkCreateAndroidSurfaceKHR
  • vkCreateMirSurfaceKHR
  • vkGetPhysicalDeviceMirPresentationSupportKHR
  • vkCreateWaylandSurfaceKHR
  • vkGetPhysicalDeviceWaylandPresentationSupportKHR
  • vkCreateWin32SurfaceKHR
  • vkGetPhysicalDeviceWin32PresentationSupportKHR
  • vkCreateXcbSurfaceKHR
  • vkGetPhysicalDeviceXcbPresentationSupportKHR
  • vkCreateXlibSurfaceKHR
  • vkGetPhysicalDeviceXlibPresentationSupportKHR

VK_LAYER_LUNARG_Swapchain Pending Work

Additional checks to be added to VK_LAYER_LUNARG_swapchain

  1. Check that the queue used for presenting was checked/valid during vkGetPhysicalDeviceSurfaceSupportKHR.
  2. One issue that has already come up is correct UsageFlags for WSI SwapChains and SurfaceProperties.
  3. Tons of other stuff including semaphore and synchronization validation.

See the Khronos github repository for Vulkan-LoaderAndValidationLayers for additional pending issues, or to submit new validation requests

VK_LAYER_GOOGLE_unique_objects

VK_LAYER_GOOGLE_unique_objects Overview

The unique_objects is not a validation layer but a helper layer that assists with validation. The Vulkan specification allows objects that have non-unique handles. This makes tracking object lifetimes difficult in that it is unclear which object is being referenced upon deletion. The unique_objects layer addresses this by wrapping all objects with a unique object representation allowing proper object lifetime tracking. This layer does no validation on its own and may not be required for the proper operation of all layers or all platforms. One sign that it is needed is the appearance of many errors from the object_tracker layer indicating the use of previously destroyed objects. For optimal effectiveness this layer should be loaded last (to reside in the layer chain closest to the display driver and farthest from the application).

General Pending Work

A place to capture general validation work to be done. This includes new checks that don't clearly fit into the above layers.

  1. For Upcoming Dynamic State overhaul (if approved): If dynamic state value that is consumed is never set prior to consumption, flag an error
  2. For Upcoming Dynamic State overhaul (if approved): If dynamic state that was bound as “static” in current PSO is attempted to be set with vkCmdSet* flag an error
  3. Need to check VkShaderCreateInfo.stage is being set properly (Issue reported by Dan G)