blob: 92904ad1ca44d1899b9a03ad314143e0f739701a [file] [log] [blame] [view]
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -06001[TOC]
2
Jens Owen3682f6a2015-08-25 12:29:34 -04003# Validation Layer Details
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -06004
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -07005## VK_LAYER_LUNARG_draw_state
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -06006
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -07007### VK_LAYER_LUNARG_draw_state Overview
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -06008
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -07009The VK_LAYER_LUNARG_draw_state layer tracks state leading into Draw cmds. This includes the Pipeline state, dynamic state, shaders, and descriptor set state. VK_LAYER_LUNARG_draw_state validates the consistency and correctness between and within these states. VK_LAYER_LUNARG_draw_state also includes SPIR-V validation which functionality is recorded under the VK_LAYER_LUNARG_ShaderChecker section below.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060010
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -070011### VK_LAYER_LUNARG_draw_state Details Table
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060012
13| Check | Overview | ENUM DRAWSTATE_* | Relevant API | Testname | Notes/TODO |
14| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Tobin Ehlis559c6382015-11-05 09:52:49 -070015| Valid Pipeline Layouts | Verify 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 PSO | PIPELINE_LAYOUTS_INCOMPATIBLE | vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | TBD | None |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -060016| Validate DbgMarker exensions | Validates that DbgMarker extensions have been enabled before use | INVALID_EXTENSION | vkCmdDbgMarkerBegin vkCmdDbgMarkerEnd | TBD | None |
Tobin Ehlisac0ef842015-12-14 13:46:38 -070017| Valid BeginCommandBuffer state | Must 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_STATE | vkBeginCommandBuffer | PrimaryCommandBufferFramebufferAndRenderpass SecondaryCommandBufferFramebufferAndRenderpass | None |
18| Valid Command Buffer Reset | Can only reset individual command buffer that was allocated from a pool with VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT set | INVALID_COMMAND_BUFFER_RESET | vkBeginCommandBuffer vkResetCommandBuffer | CommandBufferResetErrors | None |
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -070019| PSO Bound | Verify that a properly created and valid pipeline object is bound to the CommandBuffer specified in these calls | NO_PIPELINE_BOUND | vkCmdBindDescriptorSets vkCmdBindVertexBuffers | PipelineNotBound | This check is currently more related to VK_LAYER_LUNARG_draw_state 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. |
20| Valid DescriptorPool | Verifies that the descriptor set pool object was properly created and is valid | INVALID_POOL | vkResetDescriptorPool vkAllocateDescriptorSets | None | This is just an internal layer data structure check. VK_LAYER_LUNARG_param_checker or VK_LAYER_LUNARG_object_tracker should really catch bad DSPool |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060021| Valid DescriptorSet | Validate that descriptor set was properly created and is currently valid | INVALID_SET | vkCmdBindDescriptorSets | None | Is this needed other places (like Update/Clear descriptors) |
Chia-I Wu3432a0c2015-10-27 18:04:07 +080022| Valid DescriptorSetLayout | Flag DescriptorSetLayout object that was not properly created | INVALID_LAYOUT | vkAllocateDescriptorSets | None | Anywhere else to check this? |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060023| Valid Pipeline | Flag VkPipeline object that was not properly created | INVALID_PIPELINE | vkCmdBindPipeline | InvalidPipeline | NA |
Tobin Ehlis559c6382015-11-05 09:52:49 -070024| Valid PipelineLayout | Flag VkPipelineLayout object that was not properly created | INVALID_PIPELINE_LAYOUT | vkCmdBindPipeline | TODO | Write test for this case |
Chia-I Wu515eb8f2015-10-31 00:31:16 +080025| Valid Pipeline Create Info | Tests 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 specified | INVALID_PIPELINE_CREATE_STATE | vkCreateGraphicsPipelines | InvalidPipelineCreateState | NA |
Chia-I Wu3432a0c2015-10-27 18:04:07 +080026| Valid CommandBuffer | Validates that the command buffer object was properly created and is currently valid | INVALID_COMMAND_BUFFER | vkQueueSubmit 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 vkCmdDbgMarkerBegin vkCmdDbgMarkerEnd vkAllocateCommandBuffers | None | NA |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060027| Vtx Buffer Bounds | Check if VBO index too large for PSO Vtx binding count, and that at least one vertex buffer is attached to pipeline object | VTX_INDEX_OUT_OF_BOUNDS | vkCmdBindDescriptorSets vkCmdBindVertexBuffers | VtxBufferBadIndex | NA |
Tobin Ehlisc4c23182015-09-17 12:24:13 -060028| Idx Buffer Alignment | Verify that offset of Index buffer falls on an alignment boundary as defined by IdxBufferAlignmentError param | VTX_INDEX_ALIGNMENT_ERROR | vkCmdBindIndexBuffer | IdxBufferAlignmentError | NA |
Chia-I Wu3432a0c2015-10-27 18:04:07 +080029| Cmd Buffer End | Verifies that EndCommandBuffer was called for this commandBuffer at QueueSubmit time | NO_END_COMMAND_BUFFER | vkQueueSubmit | NoEndCommandBuffer | NA |
30| Cmd Buffer Begin | Check that BeginCommandBuffer was called for this command buffer when binding commands or calling end | NO_BEGIN_COMMAND_BUFFER | vkEndCommandBuffer 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 vkCmdWriteTimestamp | NoBeginCommandBuffer | NA |
31| Cmd Buffer Submit Count | Verify that ONE_TIME submit cmdbuffer is not submitted multiple times | COMMAND_BUFFER_SINGLE_SUBMIT_VIOLATION | vkBeginCommandBuffer, vkQueueSubmit | CommandBufferTwoSubmits | NA |
32| Valid Secondary CommandBuffer | Validates that no primary command buffers are sent to vkCmdExecuteCommands() are | INVALID_SECONDARY_COMMAND_BUFFER | vkCmdExecuteCommands | ExecuteCommandsPrimaryCB | NA |
Tobin Ehlis04356f92015-10-27 16:35:27 -060033| Descriptor Type | Verify 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_MISMATCH | vkUpdateDescriptorSets | DSTypeMismatch CopyDescriptorUpdateErrors | NA |
Tobin Ehlisa1f9b642015-10-27 12:25:35 -060034| Descriptor StageFlags | Verify all descriptors within a single write update have the same stageFlags | DESCRIPTOR_STAGEFLAGS_MISMATCH | vkUpdateDescriptorSets | NONE | Test this case |
Tobin Ehlis04356f92015-10-27 16:35:27 -060035| DS Update Size | DS update out of bounds for given layout section. | DESCRIPTOR_UPDATE_OUT_OF_BOUNDS | vkUpdateDescriptorSets | DSUpdateOutOfBounds CopyDescriptorUpdateErrors | NA |
Chia-I Wu3432a0c2015-10-27 18:04:07 +080036| Descriptor Pool empty | Attempt to allocate descriptor type from descriptor pool when no more of that type are available to be allocated. | DESCRIPTOR_POOL_EMPTY | vkAllocateDescriptorSets | AllocDescriptorFromEmptyPool | NA |
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -060037| Free from NON_FREE Pool | It's invalid to call vkFreeDescriptorSets() on Sets that were allocated from a Pool created with NON_FREE usage. | CANT_FREE_FROM_NON_FREE_POOL | vkFreeDescriptorSets | None | NA |
Tobin Ehlis04356f92015-10-27 16:35:27 -060038| DS Update Index | DS update binding too large for layout binding count. | INVALID_UPDATE_INDEX | vkUpdateDescriptorSets | InvalidDSUpdateIndex CopyDescriptorUpdateErrors | NA |
Tobin Ehlis64686392015-08-27 17:43:11 -060039| DS Update Type | Verifies that structs in DS Update tree are properly created, currenly valid, and of the right type | INVALID_UPDATE_STRUCT | vkUpdateDescriptorSets | InvalidDSUpdateStruct | NA |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060040| MSAA Sample Count | Verifies that Pipeline, RenderPass, and Subpass sample counts are consistent | NUM_SAMPLES_MISMATCH | vkCmdBindPipeline vkCmdBeginRenderPass vkCmdNextSubpass | NumSamplesMismatch | NA |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -060041| Dynamic Viewport State Binding | Verify that viewport dynamic state bound to Cmd Buffer at Draw time | VIEWPORT_NOT_BOUND |vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | ViewportStateNotBound | NA |
Tobin Ehlis963a4042015-09-29 08:18:34 -060042| Dynamic Scissor State Binding | Verify that scissor dynamic state bound to Cmd Buffer at Draw time | SCISSOR_NOT_BOUND |vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | ScissorStateNotBound | NA |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -060043| Dynamic Line Width State Binding | Verify that line width dynamic state bound to Cmd Buffer at when required (TODO : Verify when this is) | LINE_WIDTH_NOT_BOUND |vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | TODO | Verify this check and Write targeted test |
44| Dynamic Depth Bias State Binding | Verify that depth bias dynamic state bound when depth enabled | DEPTH_BIAS_NOT_BOUND |vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | TODO | Verify this check and Write targeted test |
45| Dynamic Blend State Binding | Verify that blend dynamic state bound when color blend enabled | BLEND_NOT_BOUND |vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | TODO | Verify this check and Write targeted test |
46| Dynamic Depth Bounds State Binding | Verify that depth bounds dynamic state bound when depth enabled | DEPTH_BOUNDS_NOT_BOUND |vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | TODO | Verify this check and Write targeted test |
Tobin Ehlis88452832015-12-03 09:40:56 -070047| Dynamic Stencil State Binding | Verify that stencil dynamic state bound when depth enabled | STENCIL_NOT_BOUND | vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | TODO | Verify this check and Write targeted test |
Mark Lobodzinski61f4d1f2015-10-01 17:00:47 -060048| RenderPass misuse | Tests 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 Renderpass | INVALID_RENDERPASS_CMD | vkCmdBindPipeline vkCmdBindDescriptorSets vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdResetQueryPool vkCmdCopyQueryPoolResults vkCmdBeginRenderPass | RenderPassWithinRenderPass UpdateBufferWithinRenderPass ClearColorImageWithinRenderPass ClearDepthStencilImageWithinRenderPass FillBufferWithinRenderPass | NA |
Courtney Goeltzenleuchterc9323e02015-10-15 16:51:05 -060049| Correct use of RenderPass | Validates that the following rendering commands are issued inside an active RenderPass: vkCmdDraw, vkCmdDrawIndexed, vkCmdDrawIndirect, vkCmdDrawIndexedIndirect, vkCmdClearAttachments, vkCmdNextSubpass, vkCmdEndRenderPass | NO_ACTIVE_RENDERPASS | vkCmdBindPipeline vkCmdBindDescriptorSets vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdClearAttachments vkCmdNextSubpass vkCmdEndRenderPass | BindPipelineNoRenderPass ClearAttachmentsOutsideRenderPass | NA |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -060050| Valid RenderPass | Flag error if attempt made to Begin/End/Continue a NULL or otherwise invalid RenderPass object | INVALID_RENDERPASS | vkCmdBeginRenderPass vkCmdEndRenderPass vkBeginCommandBuffer | NullRenderPass | NA |
Tobin Ehlis651d9b02015-12-16 05:01:22 -070051| RenderPass Compatibility | Verify 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 buffer | RENDERPASS_INCOMPATIBLE | vkCmdExecuteCommands vkBeginCommandBuffer | TBD | None |
52| Framebuffer Compatibility | If a framebuffer is passed to secondary command buffer in vkBeginCommandBuffer, then it must match active renderpass (if any) at time of vkCmdExecuteCommands | FRAMEBUFFER_INCOMPATIBLE | vkCmdExecuteCommands | TBD | None |
Tobin Ehlis88452832015-12-03 09:40:56 -070053| DescriptorSet Updated | Warn user if DescriptorSet bound that was never updated | DESCRIPTOR_SET_NOT_UPDATED | vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | DescriptorSetCompatibility | NA |
54| DescriptorSet Bound | Error if DescriptorSet not bound that is used by currently bound VkPipeline at draw time | DESCRIPTOR_SET_NOT_BOUND | vkCmdBindDescriptorSets | DescriptorSetNotUpdated | NA |
Tobin Ehlisf6585052015-12-17 11:48:42 -070055| Dynamic Offset Count | Error if dynamicOffsetCount at CmdBindDescriptorSets time is not equal to the actual number of dynamic descriptors in all sets being bound. | INVALID_DYNAMIC_OFFSET_COUNT | vkCmdBindDescriptorSets | InvalidDynamicOffsetCases | None |
56| Dynamic Offsets | At 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_OVERFLOW | vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | InvalidDynamicOffsetCases | None |
Tobin Ehlis64686392015-08-27 17:43:11 -060057| Correct Clear Use | Warn 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_DRAW | vkCmdClearColorImage vkCmdClearDepthStencilImage | ClearCmdNoDraw | NA |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -060058| Index Buffer Binding | Verify that an index buffer is bound at the point when an indexed draw is attempted. | INDEX_BUFFER_NOT_BOUND | vkCmdDrawIndexed vkCmdDrawIndexedIndirect | TODO | Implement validation test |
Tobin Ehlise68360f2015-10-01 11:15:13 -060059| Viewport and Scissors match | In 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_MISMATCH | vkCreateGraphicsPipelines vkCmdSetViewport vkCmdSetScissor | TODO | Implement validation test |
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -070060| Valid Image Aspects for descriptor Updates | When 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_ASPECT | vkUpdateDescriptorSets | DepthStencilImageViewWithColorAspectBitError | This test hits Image layer error, but tough to create case that that skips that error and gets to VK_LAYER_LUNARG_draw_state error. |
Tobin Ehlisa1c28562015-10-23 16:00:08 -060061| Valid sampler descriptor Updates | An invalid sampler is used when updating SAMPLER descriptor. | SAMPLER_DESCRIPTOR_ERROR | vkUpdateDescriptorSets | SampleDescriptorUpdateError | Currently only making sure sampler handle is known, can add further validation for sampler parameters |
Tobin Ehlisa1f9b642015-10-27 12:25:35 -060062| Immutable sampler update consistency | Within 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_UPDATE | vkUpdateDescriptorSets | None | Write a test for this case |
Tobin Ehlisa1c28562015-10-23 16:00:08 -060063| Valid imageView descriptor Updates | An invalid imageView is used when updating *_IMAGE or *_ATTACHMENT descriptor. | IMAGEVIEW_DESCRIPTOR_ERROR | vkUpdateDescriptorSets | ImageViewDescriptorUpdateError | Currently only making sure imageView handle is known, can add further validation for imageView and underlying image parameters |
64| Valid bufferView descriptor Updates | An invalid bufferView is used when updating *_TEXEL_BUFFER descriptor. | BUFFERVIEW_DESCRIPTOR_ERROR | vkUpdateDescriptorSets | BufferViewDescriptorUpdateError | Currently only making sure bufferView handle is known, can add further validation for bufferView parameters |
65| Valid bufferInfo descriptor Updates | An invalid bufferInfo is used when updating *_UNIFORM_BUFFER* or *_STORAGE_BUFFER* descriptor. | BUFFERINFO_DESCRIPTOR_ERROR | vkUpdateDescriptorSets | TODO | Implement validation test |
66| Attachment References in Subpass | Attachment reference must be present in active subpass | MISSING_ATTACHMENT_REFERENCE | vkCmdClearAttachments | BufferInfoDescriptorUpdateError | Currently only making sure bufferInfo has buffer whose handle is known, can add further validation for bufferInfo parameters |
Mark Lobodzinski0f30f9e2015-10-28 13:03:56 -060067| Verify Image Layouts | Validate correct image layouts for presents, image transitions, command buffers and renderpasses | INVALID_IMAGE_LAYOUT | vkCreateRenderPass vkMapMemory vkQueuePresentKHR vkQueueSubmit vkCmdCopyImage vkCmdCopyImageToBuffer vkCmdWaitEvents VkCmdPipelineBarrier | TBD | None |
68| Verify Memory Access Flags/Memory Barriers | Validate correct access flags for memory barriers | INVALID_BARRIER | vkCmdWaitEvents VkCmdPipelineBarrier | TBD | None |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -060069| NA | Enum used for informational messages | NONE | | NA | None |
70| NA | Enum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer. | INTERNAL_ERROR | | NA | None |
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -070071| NA | Enum used when VK_LAYER_LUNARG_draw_state attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | NA | None |
72| NA | Enum used when VK_LAYER_LUNARG_draw_state attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | NA | None |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060073
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -070074### VK_LAYER_LUNARG_draw_state Pending Work
75Additional checks to be added to VK_LAYER_LUNARG_draw_state
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060076
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060077 7. Lifetime validation (See [bug 13383](https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13383))
78 8. XGL_DESCRIPTOR_SET
79 9. Cannot be deleted until no longer in use on GPU, or referenced in any pending command.
Courtney Goeltzenleuchterbee18a92015-10-23 14:21:05 -060080 10. Sets in XGL_DESCRIPTOR_REGION_USAGE_NON_FREE regions can never be deleted. Instead the xglClearDescriptorRegion() deletes all sets.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060081 11. Sets in XGL_DESCRIPTOR_REGION_USAGE_DYNAMIC regions can be deleted.
82 12. XGL_DESCRIPTOR_SET_LAYOUT
83 13. What do IHVs want here?
84 14. Option 1 (assuming this one): Must not be deleted until all sets and layout chains referencing the set layout are deleted.
85 15. Option 2: Can be freely deleted after usage.
86 19. XGL_DESCRIPTOR_REGION
87 20. Cannot be deleted until no longer in use on the GPU, or referenced in any pending command.
88 21. XGL_BUFFER_VIEW, XGL_IMAGE_VIEW, etc
89 22. Cannot be deleted until the descriptors referencing the objects are deleted.
Courtney Goeltzenleuchterc9323e02015-10-15 16:51:05 -060090 23. For ClearAttachments function, verify that the index of referenced attachment actually exists
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060091 24. 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.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060092 28. Verify that all relevent dynamic state objects are bound (See https://cvs.khronos.org/bugzilla/show_bug.cgi?id=14323)
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060093 30. At PSO creation time, there is no case when NOT including a FS should flag an error since there exist dynamic state configurations that can be set to cause a FS to not be required. Instead, in the case when no FS is in the PSO, validation should detect at runtime if dynamic state will require a FS, and in those case issue a runtime warning about undefined behavior. (see bug https://cvs.khronos.org/bugzilla/show_bug.cgi?id=14429)
94 31. Error if a cmdbuffer is submitted on a queue whose family doesn't match the family of the pool from which it was created.
Tobin Ehlis963a4042015-09-29 08:18:34 -060095 32. Update Gfx Pipe Create Info shadowing to remove new/delete and instead use unique_ptrs for auto clean-up
Tobin Ehlis559c6382015-11-05 09:52:49 -070096 33. Add validation for Pipeline Derivatives (see Pipeline Derivatives) section of the spec
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060097
David Pinedo8f2d1e12015-12-08 11:52:30 -070098## VK_LAYER_LUNARG_ShaderChecker
Tobin Ehlis7e2ad752015-12-01 09:48:58 -070099
David Pinedo8f2d1e12015-12-08 11:52:30 -0700100### VK_LAYER_LUNARG_ShaderChecker Overview
Tobin Ehlis7e2ad752015-12-01 09:48:58 -0700101
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700102The VK_LAYER_LUNARG_ShaderChecker functionality is part of VK_LAYER_LUNARG_draw_state layer and it inspects the SPIR-V shader images and fixed function pipeline stages at PSO creation time.
Tobin Ehlis7e2ad752015-12-01 09:48:58 -0700103It flags errors when inconsistencies are found across interfaces between shader stages. The exact behavior of the checks
104depends on the pair of pipeline stages involved.
105
David Pinedo8f2d1e12015-12-08 11:52:30 -0700106### VK_LAYER_LUNARG_ShaderChecker Details Table
Tobin Ehlis7e2ad752015-12-01 09:48:58 -0700107
108| Check | Overview | ENUM SHADER_CHECKER_* | Relevant API | Testname | Notes/TODO |
109| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
110| Not consumed | Flag warning if a location is not consumed (useless work) | OUTPUT_NOT_CONSUMED | vkCreateGraphicsPipelines | CreatePipeline*NotConsumed | NA |
111| Not produced | Flag error if a location is not produced (consumer reads garbage) | INPUT_NOT_PRODUCED | vkCreateGraphicsPipelines | CreatePipeline*NotProvided | NA |
112| Type mismatch | Flag error if a location has inconsistent types | INTERFACE_TYPE_MISMATCH | vkCreateGraphicsPipelines | CreatePipeline*TypeMismatch | Between 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. |
113| Inconsistent shader | Flag error if an inconsistent SPIR-V image is detected. Possible cases include broken type definitions which the layer fails to walk. | INCONSISTENT_SPIRV | vkCreateGraphicsPipelines | TODO | All current tests use the reference compiler to produce valid SPIRV images from GLSL. |
David Pinedo8f2d1e12015-12-08 11:52:30 -0700114| Non-SPIRV shader | Flag 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_SHADER | vkCreateGraphicsPipelines | TODO | NA |
Tobin Ehlis7e2ad752015-12-01 09:48:58 -0700115| FS mixed broadcast | Flag error if the fragment shader writes both the legacy gl_FragCoord (which broadcasts to all CBs) and custom FS outputs. | FS_MIXED_BROADCAST | vkCreateGraphicsPipelines | TODO | Reference compiler refuses to compile shaders which do this |
116| VI Binding Descriptions | Validate that there is a single vertex input binding description for each binding | INCONSISTENT_VI | vkCreateGraphicsPipelines | CreatePipelineAttribBindingConflict | NA |
117| Shader Stage Check | Warns if shader stage is unsupported | UNKNOWN_STAGE | vkCreateGraphicsPipelines | TBD | NA |
118| Missing Descriptor | Flags error if shader attempts to use a descriptor binding not declared in the layout | MISSING_DESCRIPTOR | vkCreateGraphicsPipelines | CreatePipelineUniformBlockNotProvided | NA |
119| NA | Enum used for informational messages | NONE | | NA | None |
120
David Pinedo8f2d1e12015-12-08 11:52:30 -0700121### VK_LAYER_LUNARG_ShaderChecker Pending Work
Tobin Ehlis7e2ad752015-12-01 09:48:58 -0700122- Additional test cases for variously broken SPIRV images
123- Validation of a single SPIRV image in isolation (the spec describes many constraints)
Tobin Ehlis7e2ad752015-12-01 09:48:58 -0700124
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700125## VK_LAYER_LUNARG_param_checker
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600126
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700127### VK_LAYER_LUNARG_param_checker Overview
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600128
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700129The VK_LAYER_LUNARG_param_checker layer validates parameter values and flags errors for any values that are outside of acceptable values for the given parameter.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600130
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700131### VK_LAYER_LUNARG_param_checker Details Table
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600132
133| Check | Overview | ENUM | Relevant API | Testname | Notes/TODO |
134| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Chia-I Wu28e06912015-10-31 00:31:16 +0800135| Input Parameters | Pointers 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. | NA | vkQueueSubmit 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 vkCmdExecuteCommands | TBD | NA |
136| Call results, Output Parameters | Return 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. | NA | vkEnumeratePhysicalDevices 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 vkCmdExecuteCommands | TBD | NA |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -0600137| NA | Enum used for informational messages | NONE | | NA | None |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600138
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700139### VK_LAYER_LUNARG_param_checker Pending Work
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600140Additional work to be done
141
142 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.
Chia-I Wu1b99bb22015-10-27 19:25:11 +0800143 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.
tobine9c58ab32015-12-11 11:41:32 -0700144 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).
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600145 4. INT & FLOAT bordercolors. Border color int/float selection must match associated texture format.
146 5. Flag error on VkBufferCreateInfo if buffer size is 0
Courtney Goeltzenleuchter5861a1b2015-09-01 17:30:39 -0600147 6. VkImageViewCreateInfo.format must be set
Tobin Ehlis912df022015-09-17 08:46:18 -0600148 7. For vkCreateGraphicsPipelines, correctly handle array of pCreateInfos and array of pStages within each element of pCreatInfos
Tobin Ehlisc4c23182015-09-17 12:24:13 -0600149 8. Check for valid VkIndexType in vkCmdBindIndexBuffer() should be in PreCmdBindIndexBuffer() call
Tobin Ehlis4b34ddc2015-09-17 14:18:16 -0600150 9. Check for valid VkPipelineBindPoint in vkCmdBindPipeline() & vkCmdBindDescriptorSets() should be in PreCmdBindPipeline() & PreCmdBindDescriptorSets() calls respectively.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600151
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700152## VK_LAYER_LUNARG_image
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600153
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700154### VK_LAYER_LUNARG_image Layer Overview
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600155
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700156The VK_LAYER_LUNARG_image layer is responsible for validating format-related information and enforcing format restrictions.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600157
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700158### VK_LAYER_LUNARG_image Layer Details Table
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600159
160DETAILS TABLE PENDING
161
Tobin Ehlisad8c4462015-09-21 15:20:28 -0600162| Check | Overview | ENUM IMAGE_* | Relevant API | Testname | Notes/TODO |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600163| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Tobin Ehlisad8c4462015-09-21 15:20:28 -0600164| Image Format | Verifies that requested format is a supported Vulkan format on this device | FORMAT_UNSUPPORTED | vkCreateImage vkCreateRenderPass | TBD | NA |
165| RenderPass Attachments | Validates that attachment image layouts, loadOps, and storeOps are valid Vulkan values | RENDERPASS_INVALID_ATTACHMENT | vkCreateRenderPass | TBD | NA |
166| Subpass DS Settings | Verifies that if there is no depth attachment then the subpass attachment is set to VK_ATTACHMENT_UNUSED | RENDERPASS_INVALID_DS_ATTACHMENT | vkCreateRenderPass | TBD | NA |
167| View Creation | Verify that requested Image View Creation parameters are reasonable for the image that the view is being created for | VIEW_CREATE_ERROR | vkCreateImageView | TBD | NA |
Mark Lobodzinskidc86b852015-10-23 14:20:31 -0600168| Image Aspects | Verify that Image commands are using valid Image Aspect flags | INVALID_IMAGE_ASPECT | vkCreateImageView vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearAttachments vkCmdCopyImage vkCmdCopyImageToBuffer vkCmdCopyBufferToImage vkCmdResolveImage vkCmdBlitImage | InvalidImageViewAspect | NA |
Mark Lobodzinskia5eabe72015-10-05 17:16:05 -0600169| Image Aspect Mismatch | Verify that Image commands with source and dest images use matching aspect flags | MISMATCHED_IMAGE_ASPECT | vkCmdCopyImage | TBD | NA |
Mike Stroyana3082432015-09-25 13:39:21 -0600170| Image Type Mismatch | Verify that Image commands with source and dest images use matching types | MISMATCHED_IMAGE_TYPE | vkCmdCopyImage vkCmdResolveImage | CopyImageTypeMismatch ResolveImageTypeMismatch | NA |
171| Image Format Mismatch | Verify that Image commands with source and dest images use matching formats | MISMATCHED_IMAGE_FORMAT | vkCmdCopyImage vkCmdResolveImage | CopyImageDepthStencilFormatMismatch ResolveImageFormatMismatch | NA |
172| Resolve Sample Count | Verifies that source and dest images sample counts are valid | INVALID_RESOLVE_SAMPLES | vkCmdResolveImage | ResolveImageHighSampleCount ResolveImageLowSampleCount | NA |
Mark Lobodzinskidc86b852015-10-23 14:20:31 -0600173| Verify Format | Verifies the formats are valid for this image operation | INVALID_FORMAT | vkCreateImageView vkCmdBlitImage | TBD | NA |
174| Verify Correct Image Filter| Verifies that specified filter is valid | INVALID_FILTER | vkCmdBlitImage | TBD | NA |
Mark Lobodzinski37a38b12016-01-04 13:32:45 -0700175| Verify Correct Image Settings | Verifies that values are valid for a given resource or subresource | INVALID_IMAGE_RESOURCE | vkCmdPipelineBarrier | TBD | NA |
Mark Lobodzinskid5a23822015-11-12 15:14:35 -0700176| Verify Image Format Limits | Verifies that image creation parameters are with the device format limits | INVALID_FORMAT_LIMITS_VIOLATION | vkCreateImage | TBD | NA |
Tobin Ehlisad8c4462015-09-21 15:20:28 -0600177| NA | Enum used for informational messages | NONE | | NA | None |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600178
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700179### VK_LAYER_LUNARG_image Pending Work
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600180Additional work to be done
181
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700182## VK_LAYER_LUNARG_mem_tracker
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600183
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700184### VK_LAYER_LUNARG_mem_tracker Overview
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600185
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700186The VK_LAYER_LUNARG_mem_tracker 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. VK_LAYER_LUNARG_mem_tracker validates several other hazard-related issues related to command buffers, fences, and memory mapping.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600187
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700188### VK_LAYER_LUNARG_mem_tracker Details Table
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600189
190| Check | Overview | ENUM MEMTRACK_* | Relevant API | Testname | Notes/TODO |
191| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600192| Valid Command Buffer | Verifies that the command buffer was properly created and is currently valid | INVALID_CB | vkCmdBindPipeline vkCmdSetViewport vkCmdSetLineWidth vkCmdSetDepthBias vkCmdSetBlendConstants vkCmdSetDepthBounds vkCmdSetStencilCompareMask vkCmdSetStencilWriteMask vkCmdSetStencilReference vkBeginCommandBuffer vkResetCommandBuffer vkDestroyDevice vkFreeMemory | NA | NA |
Chia-I Wu1ff4c3d2015-10-26 16:55:27 +0800193| Valid Memory Object | Verifies that the memory object was properly created and is currently valid | INVALID_MEM_OBJ | vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage vkFreeMemory vkBindBufferMemory vkBindImageMemory vkQueueBindSparse | NA | NA |
Tobin Ehlis53a1b7c2016-01-06 10:03:38 -0700194| Memory Aliasing | Flag error if image and/or buffer memory binding ranges overlap | INVALID_ALIASING | vkBindBufferMemory vkBindImageMemory | TODO | Implement test |
Tobin Ehlis64686392015-08-27 17:43:11 -0600195| Free Referenced Memory | Checks to see if memory being freed still has current references | FREED_MEM_REF | vmFreeMemory | FreeBoundMemory | NA |
Mike Stroyan2ed39272015-10-15 08:42:32 -0600196| Memory Properly Bound | Validate that the memory object referenced in the call was properly created, is currently valid, and is properly bound to the object | MISSING_MEM_BINDINGS | vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyQueryPoolResults vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | NA | NA |
Courtney Goeltzenleuchter49c73082015-09-17 15:06:17 -0600197| Valid Object | Verifies that the specified Vulkan object was created properly and is currently valid | INVALID_OBJECT | vkCmdBindPipeline vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | NA | NA |
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700198| Bind Invalid Memory | Validate that memory object was correctly created, that the command buffer object was correctly created, and that both are currently valid objects. | MEMORY_BINDING_ERROR | vkQueueBindSparse vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | NA | The 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 |
Tobin Ehlis64686392015-08-27 17:43:11 -0600199| Objects Not Destroyed | Verify all objects destroyed at DestroyDevice time | MEMORY_LEAK | vkDestroyDevice | NA | NA |
200| Memory Mapping State | Verifies that mapped memory is CPU-visible | INVALID_STATE | vkMapMemory | MapMemWithoutHostVisibleBit | NA |
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800201| Command Buffer Synchronization | Command Buffer must be complete before BeginCommandBuffer or ResetCommandBuffer can be called | RESET_CB_WHILE_IN_FLIGHT | vkBeginCommandBuffer vkResetCommandBuffer | CallBeginCommandBufferBeforeCompletion CallBeginCommandBufferBeforeCompletion | NA |
Tobin Ehlisc4f105d2015-09-14 13:25:57 -0600202| Submitted Fence Status | Verifies 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 submitted | INVALID_FENCE_STATE | vkResetFences vkWaitForFences vkQueueSubmit vkGetFenceStatus | SubmitSignaledFence ResetUnsignaledFence | Create test(s) for case where an unsubmitted fence is having its status checked |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600203| Immutable Memory Binding | Validates that non-sparse memory bindings are immutable, so objects are not re-boundt | REBIND_OBJECT | vkBindBufferMemory, vkBindImageMemory | RebindMemory | NA |
Mike Stroyan2ed39272015-10-15 08:42:32 -0600204| Image/Buffer Usage bits | Verify correct USAGE bits set based on how Images and Buffers are used | INVALID_USAGE_FLAG | vkCreateImage, vkCreateBuffer, vkCreateBufferView, vkCmdCopyBuffer, vkCmdCopyQueryPoolResults, vkCmdCopyImage, vkCmdBlitImage, vkCmdCopyBufferToImage, vkCmdCopyImageToBuffer, vkCmdUpdateBuffer, vkCmdFillBuffer | InvalidUsageBits | NA |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600205| Objects Not Destroyed Warning | Warns if any memory objects have not been freed before their objects are destroyed | MEM_OBJ_CLEAR_EMPTY_BINDINGS | vkDestroyDevice | TBD | NA |
Mark Lobodzinski4272e9b2015-11-19 14:13:44 -0700206| Memory Map Range Checks | Validates 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_MAP | vkMapMemory | TBD | NA |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -0600207| NA | Enum used for informational messages | NONE | | NA | None |
208| NA | Enum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer. | INTERNAL_ERROR | | NA | None |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600209
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700210### VK_LAYER_LUNARG_mem_tracker Pending Work
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600211
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700212#### VK_LAYER_LUNARG_mem_tracker Enhancements
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600213
2141. Flag any memory hazards: Validate that the pipeline barriers for buffers are sufficient to avoid hazards
2152. Make sure that the XGL_IMAGE_VIEW_ATTACH_INFO.layout matches the layout of the image as determined by the last IMAGE_MEMORY_BARRIER
Tobin Ehlis64686392015-08-27 17:43:11 -06002163. Verify that the XGL_IMAGE_MEMORY_BARRIER.oldLayout matches the actual previous layout (this one was super important for previous work in dealing with out-of-order command buffer generation). Note that these need to be tracked for each subresource.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -06002174. Update for new Memory Binding Model
2185. Consolidate error messages and make them consistent
2197. Add validation for having mapped objects in a command list - GPU writing to mapped object is warning
2208. Add validation for maximum memory references, maximum object counts, and object leaks
2219. When performing clears on surfaces that have both Depth and Stencil, WARN user if subresource range for depth and stencil are not both set (see blit_tests.cpp VkCmdClearDepthStencilTest test).
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -060022211. Warn on image/buffer deletion if USAGE bits were set that were not needed
22312. Modify INVALID_FENCE_STATE to be WARNINGs instead of ERROR
Mike Stroyaneca48022015-08-28 11:33:32 -060022413. Report destroy or modify of resources in use on queues and not cleared by fence or WaitIdle. Could be fence, semaphore, or objects used by submitted CommandBuffers.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600225
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700226## VK_LAYER_LUNARG_object_tracker
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600227
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700228### VK_LAYER_LUNARG_object_tracker Overview
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600229
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700230The 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.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600231
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700232### VK_LAYER_LUNARG_object_tracker Details Table
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600233
234| Check | Overview | ENUM OBJTRACK_* | Relevant API | Testname | Notes/TODO |
235| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Chia-I Wu28e06912015-10-31 00:31:16 +0800236| Valid Object | Validates that referenced object was properly created and is currently valid. | INVALID_OBJECT | vkAcquireNextImageKHR 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 vkWaitForFences | BindInvalidMemory BindMemoryToDestroyedObject | Every VkObject class of parameter will be run through this check. This check may ultimately supersede UNKNOWN_OBJECT |
Tobin Ehlis64686392015-08-27 17:43:11 -0600237| Object Cleanup | Verify that object properly destroyed | DESTROY_OBJECT_FAILED | vkDestroyInstance, vkDestroyDevice, vkFreeMemory | ? | NA |
238| Objects Leak | When an Instance or Device object is destroyed, validates that all objects belonging to that device/instance have previously been destroyed | OBJECT_LEAK | vkDestroyDevice vkDestroyInstance | ? | NA |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -0600239| Object Count | Flag error if number of objects requested from extenstion functions exceeds max number of actual objects | OBJCOUNT_MAX_EXCEEDED | objTrackGetObjects objTrackGetObjectsOfType | ? | NA |
Chia-I Wu28e06912015-10-31 00:31:16 +0800240| Valid Destroy Object | Validates that an object pass into a destroy function was properly created and is currently valid | NONE | vkDestroyInstance vkDestroyDevice vkDestroyFence vkDestroySemaphore vkDestroyEvent vkDestroyQueryPool vkDestroyBuffer vkDestroyBufferView vkDestroyImage vkDestroyImageView vkDestroyShaderModule vkDestroyPipelineCache vkDestroyPipeline vkDestroyPipelineLayout vkDestroySampler vkDestroyDescriptorSetLayout vkDestroyDescriptorPool vkDestroyCommandPool vkFreeCommandBuffers vkDestroyFramebuffer vkDestroyRenderPass vkDestroySwapchainKHR | TBD | These cases need to be moved to a more appropriate error enum |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -0600241| Unknown object | Internal layer errors when it attempts to update use count for an object that's not in its internal tracking datastructures. | UNKNOWN_OBJECT | | NA | This may be irrelevant due to INVALID_OBJECT error, need to look closely and merge this with that error as appropriate. |
Mark Lobodzinski5f5c0e12015-11-12 16:02:35 -0700242| Correct Command Pool | Validates that command buffers in a FreeCommandBuffers call were all created in the specified commandPool | COMMAND_POOL_MISMATCH | vkFreeCommandBuffers | TBD | NA |
243| Correct Descriptor Pool | Validates that descriptor sets in a FreeDescriptorSets call were all created in the specified descriptorPool | DESCRIPTOR_POOL_MISMATCH | vkFreeDescriptorSets | TBD | NA |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -0600244| NA | Enum used for informational messages | NONE | | NA | None |
245| NA | Enum used for errors in the layer itself. This does not indicate an app issue, but instead a bug in the layer. | INTERNAL_ERROR | | NA | None |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600246
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700247### VK_LAYER_LUNARG_object_tracker Pending Work
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600248
249 4. Verify images have CmdPipelineBarrier layouts matching new layout parameters to Cmd*Image* functions
250 6. For specific object instances that are allowed to be NULL, update object validation to verify that such objects are either NULL or valid
Cass Everitt5a231282015-08-27 05:17:57 -0500251 7. Verify cube array VkImageView objects use subresourceRange.arraySize (or effective arraySize when VK_REMAINING_ARRAY_SLICES is specified) that is a multiple of 6.
Mike Stroyanb4e3adb2015-09-24 10:37:08 -0600252 8. Make object maps specific to instance and device. Objects may only be used with matching instance or device.
253 9. Use reference counting for non-dispatchable objects. Multiple object creation calls may return identical handles.
Tobin Ehlis963a4042015-09-29 08:18:34 -0600254 10. Update codegen for destroy_obj & validate_obj to generate all of the correct signatures and use the generated code
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600255
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700256## VK_LAYER_LUNARG_threading
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600257
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700258### VK_LAYER_LUNARG_threading Overview
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600259
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700260The VK_LAYER_LUNARG_threading layer checks for simultaneous use of objects by calls from multiple threads.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600261Application code is responsible for preventing simultaneous use of the same objects by certain calls that modify objects.
262See [bug 13433](https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13433) and
263<https://cvs.khronos.org/svn/repos/oglc/trunk/nextgen/vulkan/function_properties.csv>
264for threading rules.
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800265Objects that may need a mutex include VkQueue, VkDeviceMemory, VkObject, VkBuffer, VkImage, VkDescriptorSet, VkDescriptorPool, VkCommandBuffer, and VkSemaphore.
266The most common case is that a VkCommandBuffer passed to VkCmd* calls must be used by only one thread at a time.
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600267
268In addition to reporting threading rule violations, the layer will enforce a mutex for those calls.
269That can allow an application to continue running without actually crashing due to the reported threading problem.
270
271The layer can only observe when a mutual exclusion rule is actually violated.
272It cannot insure that there is no latent race condition needing mutual exclusion.
273
274The layer can also catch reentrant use of the same object by calls from a single thread.
275That might happen if Vulkan calls are made from a callback function or a signal handler.
276But the layer cannot prevent such a reentrant use of an object.
277
278The layer can only observe when a mutual exclusion rule is actually violated.
279It cannot insure that there is no latent race condition.
280
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700281### VK_LAYER_LUNARG_threading Details Table
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600282
Tobin Ehlis64686392015-08-27 17:43:11 -0600283| Check | Overview | ENUM THREADING_CHECKER_* | Relevant API | Testname | Notes/TODO |
284| ----- | -------- | ---------------- | ---------------- | -------- | ---------- |
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800285| Thread Collision | Detects and notifies user if multiple threads are modifying thes same object | MULTIPLE_THREADS | vkQueueSubmit 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 |
286| Thread Reentrancy | Detects cases of a single thread calling Vulkan reentrantly | SINGLE_THREAD_REUSE | vkQueueSubmit 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 |
Tobin Ehlis12d4c6a2015-08-31 12:42:38 -0600287| NA | Enum used for informational messages | NONE | | NA | None |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600288
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700289### VK_LAYER_LUNARG_threading Pending Work
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600290Additional work to be done
291
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700292## VK_LAYER_LUNARG_device_limits
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600293
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700294### VK_LAYER_LUNARG_device_limits Overview
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600295
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700296This layer is a work in progress. VK_LAYER_LUNARG_device_limits layer is intended to capture two broad categories of errors:
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -0600297 1. Incorrect use of APIs to query device capabilities
298 2. Attempt to use API functionality beyond the capability of the underlying device
299
300For 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.
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700301For 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.
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -0600302
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700303### VK_LAYER_LUNARG_device_limits Details Table
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -0600304
305| Check | Overview | ENUM DEVLIMITS_* | Relevant API | Testname | Notes/TODO |
306| ----- | -------- | ---------------- | ---------------- | -------- | ---------- |
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700307| Valid instance | If an invalid instance is used, this error will be flagged | INVALID_INSTANCE | vkEnumeratePhysicalDevices | NA | VK_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 |
308| Valid physical device | Enum used for informational messages | INVALID_PHYSICAL_DEVICE | vkEnumeratePhysicalDevices | NA | VK_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 |
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -0600309| Querying array counts | For 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_COUNT | vkEnumeratePhysicalDevices vkGetPhysicalDeviceQueueFamilyProperties | NA | Create focused test |
310| Array count value | For 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_MISMATCH | vkEnumeratePhysicalDevices vkGetPhysicalDeviceQueueFamilyProperties | NA | Create focused test |
311| Queue Creation | When creating/requesting queues, make sure that QueueFamilyPropertiesIndex and index/count within that queue family are valid. | INVALID_QUEUE_CREATE_REQUEST | vkGetDeviceQueue vkCreateDevice | NA | Create focused test |
Mark Lobodzinski6f2274e2015-09-22 09:33:21 -0600312| Query Properties | Before creating an Image, warn if physical device properties have not been queried | MUST_QUERY_PROPERTIES | vkCreateImage | NA | Add validation test |
Tobin Ehlis9da65002015-09-24 15:25:16 -0600313| API Call Sequencing | This 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_SEQUENCE | vkCreateDevice | NA | Add validation test |
314| Feature Request | Attempting to vkCreateDevice with a feature that is not supported by the underlying physical device. | INVALID_FEATURE_REQUESTED | vkCreateDevice | NA | Add validation test |
Mark Lobodzinski6f2274e2015-09-22 09:33:21 -0600315| Valid Image Extents | When creating an Image, ensure that image extents are within device limits for the specified format | LIMITS_VIOLATION | vkCreateImage | CreateImageLimitsViolationWidth | NA |
316| Valid Image Resource Size | When creating an image, ensure the the total image resource size is less than the queried device maximum resource size | LIMITS_VIOLATION | vkCreateImage | CreateImageResourceSizeViolation | NA |
Mike Stroyana3082432015-09-25 13:39:21 -0600317| Alignment | When updating a buffer, data should be aligned on 4 byte boundaries | LIMITS_VIOLATION | vkCmdUpdateBuffer | UpdateBufferAlignment | NA |
318| Alignment | When filling a buffer, data should be aligned on 4 byte boundaries | LIMITS_VIOLATION | vkCmdFillBuffer | UpdateBufferAlignment | NA |
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -0600319| NA | Enum used for informational messages | NONE | | NA | None |
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600320
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700321### VK_LAYER_LUNARG_device_limits Pending Work
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600322
Mark Lobodzinski6f2274e2015-09-22 09:33:21 -0600323 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).
Tobin Ehlis4a7cb5d2015-08-25 09:56:38 -0600324
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700325## VK_LAYER_LUNARG_swapchain
Ian Elliottb0f474c2015-09-25 15:50:55 -0600326
327### Swapchain Overview
328
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700329This layer is a work in progress. VK_LAYER_LUNARG_swapchain layer is intended to ...
Ian Elliottb0f474c2015-09-25 15:50:55 -0600330
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700331### VK_LAYER_LUNARG_swapchain Details Table
Ian Elliottb0f474c2015-09-25 15:50:55 -0600332
333| Check | Overview | ENUM SWAPCHAIN_* | Relevant API | Testname | Notes/TODO |
334| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Ian Elliott1dcd1092015-11-17 17:29:40 -0700335| Valid handle | If an invalid handle is used, this error will be flagged | INVALID_HANDLE | vkDestroyInstance vkEnumeratePhysicalDevices vkCreateDevice vkDestroyDevice vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfacePresentModesKHR vkCreateSwapchainKHR vkDestroySwapchainKHR vkGetSwapchainImagesKHR vkAcquireNextImageKHR vkQueuePresentKHR | NA | None |
336| Extension enabled before use | Validates that a WSI extension is enabled before its functions are used | EXT_NOT_ENABLED_BUT_USED | vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfacePresentModesKHR vkCreateSwapchainKHR vkDestroySwapchainKHR vkGetSwapchainImagesKHR vkAcquireNextImageKHR vkQueuePresentKHR | NA | None |
Ian Elliottb0f474c2015-09-25 15:50:55 -0600337| Swapchains destroyed before devices | Validates that vkDestroySwapchainKHR() is called for all swapchains associated with a device before vkDestroyDevice() is called | DEL_DEVICE_BEFORE_SWAPCHAINS | vkDestroyDevice | NA | None |
Ian Elliott1dcd1092015-11-17 17:29:40 -0700338| Queries occur before swapchain creation | Validates that vkGetPhysicalDeviceSurfaceCapabilitiesKHR(), vkGetPhysicalDeviceSurfaceFormatsKHR() and vkGetPhysicalDeviceSurfacePresentModesKHR() are called before vkCreateSwapchainKHR() | CREATE_SWAP_WITHOUT_QUERY | vkCreateSwapchainKHR | NA | None |
Ian Elliottb0f474c2015-09-25 15:50:55 -0600339| vkCreateSwapchainKHR(pCreateInfo->minImageCount) | Validates vkCreateSwapchainKHR(pCreateInfo->minImageCount) | CREATE_SWAP_BAD_MIN_IMG_COUNT | vkCreateSwapchainKHR | NA | None |
340| vkCreateSwapchainKHR(pCreateInfo->imageExtent) | Validates vkCreateSwapchainKHR(pCreateInfo->imageExtent) when window has no fixed size | CREATE_SWAP_OUT_OF_BOUNDS_EXTENTS | vkCreateSwapchainKHR | NA | None |
341| vkCreateSwapchainKHR(pCreateInfo->imageExtent) | Validates vkCreateSwapchainKHR(pCreateInfo->imageExtent) when window has a fixed size | CREATE_SWAP_EXTENTS_NO_MATCH_WIN | vkCreateSwapchainKHR | NA | None |
342| vkCreateSwapchainKHR(pCreateInfo->preTransform) | Validates vkCreateSwapchainKHR(pCreateInfo->preTransform) | CREATE_SWAP_BAD_PRE_TRANSFORM | vkCreateSwapchainKHR | NA | None |
Ian Elliott9d5ecf92015-12-29 18:00:50 -0700343| vkCreateSwapchainKHR(pCreateInfo->compositeAlpha) | Validates vkCreateSwapchainKHR(pCreateInfo->compositeAlpha) | CREATE_SWAP_BAD_COMPOSITE_ALPHA | vkCreateSwapchainKHR | NA | None |
Ian Elliottb0f474c2015-09-25 15:50:55 -0600344| vkCreateSwapchainKHR(pCreateInfo->imageArraySize) | Validates vkCreateSwapchainKHR(pCreateInfo->imageArraySize) | CREATE_SWAP_BAD_IMG_ARRAY_SIZE | vkCreateSwapchainKHR | NA | None |
345| vkCreateSwapchainKHR(pCreateInfo->imageUsageFlags) | Validates vkCreateSwapchainKHR(pCreateInfo->imageUsageFlags) | CREATE_SWAP_BAD_IMG_USAGE_FLAGS | vkCreateSwapchainKHR | NA | None |
346| vkCreateSwapchainKHR(pCreateInfo->imageColorSpace) | Validates vkCreateSwapchainKHR(pCreateInfo->imageColorSpace) | CREATE_SWAP_BAD_IMG_COLOR_SPACE | vkCreateSwapchainKHR | NA | None |
347| vkCreateSwapchainKHR(pCreateInfo->imageFormat) | Validates vkCreateSwapchainKHR(pCreateInfo->imageFormat) | CREATE_SWAP_BAD_IMG_FORMAT | vkCreateSwapchainKHR | NA | None |
348| vkCreateSwapchainKHR(pCreateInfo->imageFormat and pCreateInfo->imageColorSpace) | Validates vkCreateSwapchainKHR(pCreateInfo->imageFormat and pCreateInfo->imageColorSpace) | CREATE_SWAP_BAD_IMG_FMT_CLR_SP | vkCreateSwapchainKHR | NA | None |
349| vkCreateSwapchainKHR(pCreateInfo->presentMode) | Validates vkCreateSwapchainKHR(pCreateInfo->presentMode) | CREATE_SWAP_BAD_PRESENT_MODE | vkCreateSwapchainKHR | NA | None |
Ian Elliott9d5ecf92015-12-29 18:00:50 -0700350| vkCreateSwapchainKHR(pCreateInfo->imageSharingMode) | Validates vkCreateSwapchainKHR(pCreateInfo->imageSharingMode) | CREATE_SWAP_BAD_SHARING_MODE | vkCreateSwapchainKHR | NA | None |
351| vkCreateSwapchainKHR(pCreateInfo->imageSharingMode) | Validates vkCreateSwapchainKHR(pCreateInfo->imageSharingMode) | CREATE_SWAP_BAD_SHARING_VALUES | vkCreateSwapchainKHR | NA | None |
Ian Elliottb0f474c2015-09-25 15:50:55 -0600352| Use same device for swapchain | Validates that vkDestroySwapchainKHR() called with the same VkDevice as vkCreateSwapchainKHR() | DESTROY_SWAP_DIFF_DEVICE | vkDestroySwapchainKHR | NA | None |
353| Don't use too many images | Validates that app never tries to own too many swapchain images at a time | APP_OWNS_TOO_MANY_IMAGES | vkAcquireNextImageKHR | NA | None |
Ian Elliott66463852015-09-28 11:24:53 -0600354| Index too large | Validates that an image index is within the number of images in a swapchain | INDEX_TOO_LARGE | vkQueuePresentKHR | NA | None |
Ian Elliottb0f474c2015-09-25 15:50:55 -0600355| Can't present a non-owned image | Validates that application only presents images that it owns | INDEX_NOT_IN_USE | vkQueuePresentKHR | NA | None |
Ian Elliott9d5ecf92015-12-29 18:00:50 -0700356| A VkBool32 must have values of VK_TRUE or VK_FALSE | Validates that a VkBool32 must have values of VK_TRUE or VK_FALSE | BAD_BOOL | vkCreateSwapchainKHR | NA | None |
Ian Elliottb0f474c2015-09-25 15:50:55 -0600357
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700358### VK_LAYER_LUNARG_swapchain Pending Work
359Additional checks to be added to VK_LAYER_LUNARG_swapchain
Ian Elliottb0f474c2015-09-25 15:50:55 -0600360
361 1. Check that the queue used for presenting was checked/valid during vkGetPhysicalDeviceSurfaceSupportKHR.
362 2. One issue that has already come up is correct UsageFlags for WSI SwapChains and SurfaceProperties.
363 3. Tons of other stuff including semaphore and synchronization validation.
364
Ian Elliottd552fe22015-09-25 16:19:06 -0600365# Non-validation Layer Details
366
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700367## VK_LAYER_LUNARG_api_dump
Ian Elliottd552fe22015-09-25 16:19:06 -0600368
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700369VK_LAYER_LUNARG_api_dump layer is used for dumping a stream of all the Vulkan API calls that are made, along with details of the parameters to those calls.
Ian Elliottd552fe22015-09-25 16:19:06 -0600370
Mark Lobodzinski0d054fe2015-12-30 08:16:12 -0700371### VK_LAYER_LUNARG_api_dump Pending Work
Ian Elliottd552fe22015-09-25 16:19:06 -0600372
Chia-I Wu3432a0c2015-10-27 18:04:07 +0800373 1. vkAllocateDescriptorSets does not correctly print out all of the created DescriptorSets (no array printing following main API txt)
Ian Elliottd552fe22015-09-25 16:19:06 -0600374
Ian Elliottb0f474c2015-09-25 15:50:55 -0600375
Tobin Ehlisb5fc4fb2015-09-03 09:50:06 -0600376## General Pending Work
377A place to capture general validation work to be done. This includes new checks that don't clearly fit into the above layers.
378
379 1. For Upcoming Dynamic State overhaul (if approved): If dynamic state value that is consumed is never set prior to consumption, flag an error
380 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
David Pinedo8f2d1e12015-12-08 11:52:30 -0700381 3. Need to check VkShaderCreateInfo.stage is being set properly (Issue reported by Dan G)