blob: fe3c50c36b7bab68f3f457288120f963e0d5f9c9 [file] [log] [blame] [view]
Tobin Ehlisa77845b2015-08-25 09:56:38 -06001[TOC]
2
Jens Owenef5b8ed2015-08-25 12:29:34 -04003# Validation Layer Details
Tobin Ehlisa77845b2015-08-25 09:56:38 -06004
Jens Owenef5b8ed2015-08-25 12:29:34 -04005## DrawState
Tobin Ehlisa77845b2015-08-25 09:56:38 -06006
Jens Owenef5b8ed2015-08-25 12:29:34 -04007### DrawState Overview
Tobin Ehlisa77845b2015-08-25 09:56:38 -06008
9The DrawState layer tracks state leading into Draw cmds. This includes the Pipeline state, dynamic state, and descriptor set state. DrawState validates the consistency and correctness between and within these states.
10
Jens Owenef5b8ed2015-08-25 12:29:34 -040011### DrawState Details Table
Tobin Ehlisa77845b2015-08-25 09:56:38 -060012
13| Check | Overview | ENUM DRAWSTATE_* | Relevant API | Testname | Notes/TODO |
14| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
15| Valid Pipeline Layouts | Validates that pipeline layout from bound descriptor set matches the current pipeline layout | PIPELINE_LAYOUT_MISMATCH | vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | TBD | None |
Tobin Ehlis236717c2015-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 Ehlisa77845b2015-08-25 09:56:38 -060017| Valid BeginCommandBuffer level-related parameters | 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 | PrimaryCmdBufferFramebufferAndRenderpass SecondaryCmdBufferFramebufferAndRenderpass | None |
18| PSO Bound | Verify that a properly created and valid pipeline object is bound to the CmdBuffer specified in these calls | NO_PIPELINE_BOUND | vkCmdBindDescriptorSets vkCmdBindVertexBuffers | PipelineNotBound | This check is currently more related to DrawState 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. |
Tobin Ehlis236717c2015-08-31 12:42:38 -060019| Valid DescriptorPool | Verifies that the descriptor set pool object was properly created and is valid | INVALID_POOL | vkResetDescriptorPool vkAllocDescriptorSets | None | This is just an internal layer data structure check. ParamChecker or ObjectTracker should really catch bad DSPool |
Tobin Ehlisa77845b2015-08-25 09:56:38 -060020| 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) |
21| Valid DescriptorSetLayout | Flag DescriptorSetLayout object that was not properly created | INVALID_LAYOUT | vkAllocDescriptorSets | None | Anywhere else to check this? |
22| Valid Pipeline | Flag VkPipeline object that was not properly created | INVALID_PIPELINE | vkCmdBindPipeline | InvalidPipeline | NA |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -060023| 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 is set as IA topology for tessellation pipelines, that VK_PRIMITIVE_TOPOLOGY_PATCH primitive topology is only set for tessellation pipelines, and that Vtx Shader specified | INVALID_PIPELINE_CREATE_STATE | vkCreateGraphicsPipelines | InvalidPipelineCreateState | NA |
Cody Northrope4bc6942015-08-26 10:01:32 -060024| Valid CmdBuffer | Validates that the command buffer object was properly created and is currently valid | INVALID_CMD_BUFFER | vkQueueSubmit vkBeginCommandBuffer vkEndCommandBuffer vkCmdBindPipeline vkCmdBindDynamicViewportState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicBlendState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorAttachment vkCmdClearDepthStencilAttachment vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdBeginRenderPass vkCmdNextSubpass vkCmdEndRenderPass vkCmdExecuteCommands vkCmdDbgMarkerBegin vkCmdDbgMarkerEnd vkCreateCommandBuffer | None | NA |
25| Valid Dynamic State | Validates that each of the 4 DSOs are valid, properly constructed objects of the correct type | INVALID_DYNAMIC_STATE_OBJECT | vkCmdBindDynamicViewportState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicBlendState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState | None | NA |
Tobin Ehlisa77845b2015-08-25 09:56:38 -060026| 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 |
27| Cmd Buffer End | Verifies that EndCommandBuffer was called for this cmdBuffer at QueueSubmit time | NO_END_CMD_BUFFER | vkQueueSubmit | NoEndCmdBuffer | NA |
Cody Northrope4bc6942015-08-26 10:01:32 -060028| Cmd Buffer Begin | Check that BeginCommandBuffer was called for this command buffer when binding commands or calling end | NO_BEGIN_CMD_BUFFER | vkEndCommandBuffer vkCmdBindPipeline vkCmdBindDynamicViewportState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicBlendState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorAttachment vkCmdClearDepthStencilAttachment vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp | NoBeginCmdBuffer | NA |
Tobin Ehlis236717c2015-08-31 12:42:38 -060029| Cmd Buffer Submit Count | Verify that ONE_TIME submit cmdbuffer is not submitted multiple times | CMD_BUFFER_SINGLE_SUBMIT_VIOLATION | vkBeginCommandBuffer, vkQueueSubmit | CmdBufferTwoSubmits | NA |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -060030| Descriptor Type | Verify Descriptor type in bound descriptor set layout matches descriptor type specified in update | DESCRIPTOR_TYPE_MISMATCH | vkUpdateDescriptorSets | DSTypeMismatch | With various DS API updates, need to revisit this code |
31| DS Update Size | DS update out of bounds for given layout section | DESCRIPTOR_UPDATE_OUT_OF_BOUNDS | vkUpdateDescriptorSets | DSUpdateOutOfBounds | NA |
32| DS Update Index | DS update binding too large for layout count | INVALID_UPDATE_INDEX | vkUpdateDescriptorSets | InvalidDSUpdateIndex | NA |
33| 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 Ehlisa77845b2015-08-25 09:56:38 -060034| MSAA Sample Count | Verifies that Pipeline, RenderPass, and Subpass sample counts are consistent | NUM_SAMPLES_MISMATCH | vkCmdBindPipeline vkCmdBeginRenderPass vkCmdNextSubpass | NumSamplesMismatch | NA |
Tobin Ehlis236717c2015-08-31 12:42:38 -060035| 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 |
36| 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 |
37| 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 |
38| 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 |
39| 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 |
40| 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 |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -060041| RenderPass misuse | Tests for the following: that BeginRenderPass, ResolveImage, ClearColorImage, ClearDepthStencilImage are not called during an active Renderpass, and that binding compute descriptior sets or pipelines does not take place during an active | INVALID_RENDERPASS_CMD | vkCmdBindPipeline vkCmdBindDescriptorSets vkCmdBlitImage vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage vkCmdBeginRenderPass | RenderPassWithinRenderPass | NA |
Tobin Ehlis236717c2015-08-31 12:42:38 -060042| Correct use of RenderPass | Validates that rendering commands are issued inside an active RenderPass | NO_ACTIVE_RENDERPASS | vkCmdBindPipeline vkCmdBindDynamicViewportState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicBlendState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdClearColorAttachment vkCmdClearDepthStencilAttachment vkCmdNextSubpass vkCmdEndRenderPass vkCmdExecuteCommands vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect | BindPipelineNoRenderPass VtxBufferNoRenderPass | NA |
43| 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 Ehlis2235fbc2015-08-27 17:43:11 -060044| DescriptorSet Updated | Warn user if DescriptorSet bound that was never updated | DESCRIPTOR_SET_NOT_UPDATED | vkCmdBindDescriptorSets | DescriptorSetNotUpdated | NA |
45| 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 Ehlis236717c2015-08-31 12:42:38 -060046| 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 |
47| NA | Enum used for informational messages | NONE | | NA | None |
48| 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 |
49| NA | Enum used when Drawstate attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | NA | None |
50| NA | Enum used when Drawstate attempts to allocate memory for its own internal use and is unable to. | OUT_OF_MEMORY | | NA | None |
Tobin Ehlisa77845b2015-08-25 09:56:38 -060051
Jens Owenef5b8ed2015-08-25 12:29:34 -040052### DrawState Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -060053Additional checks to be added to DrawState
54
55 5. dynamicOffsetCount lists how many entries are present in pDynamicOffsets - account for this (not certain of what needs to be done here but we don't have any test cases for dynamicOffsets, so keeping this task around until we do)
56 7. Lifetime validation (See [bug 13383](https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13383))
57 8. XGL_DESCRIPTOR_SET
58 9. Cannot be deleted until no longer in use on GPU, or referenced in any pending command.
59 10. Sets in XGL_DESCRIPTOR_REGION_USAGE_ONE_SHOT regions can never be deleted. Instead the xglClearDescriptorRegion() deletes all sets.
60 11. Sets in XGL_DESCRIPTOR_REGION_USAGE_DYNAMIC regions can be deleted.
61 12. XGL_DESCRIPTOR_SET_LAYOUT
62 13. What do IHVs want here?
63 14. Option 1 (assuming this one): Must not be deleted until all sets and layout chains referencing the set layout are deleted.
64 15. Option 2: Can be freely deleted after usage.
65 19. XGL_DESCRIPTOR_REGION
66 20. Cannot be deleted until no longer in use on the GPU, or referenced in any pending command.
67 21. XGL_BUFFER_VIEW, XGL_IMAGE_VIEW, etc
68 22. Cannot be deleted until the descriptors referencing the objects are deleted.
69 23. For ClearColorAttachment function, verify that the index of referenced attachment actually exists
70 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.
71 26. vkFreeDescriptorSets must not be called for sets created on top of one-shot pool
72 27. If Cmd Buffer one-time submit flag is set, then verify that cmd buffer is only submitted once
73 28. Verify that all relevent dynamic state objects are bound (See https://cvs.khronos.org/bugzilla/show_bug.cgi?id=14323)
74 29. Flag an error if CmdBuffer has Begin called while it's being constructed - this is not a reset, this is a violation
75 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)
76 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.
77
Jens Owenef5b8ed2015-08-25 12:29:34 -040078## ParamChecker
Tobin Ehlisa77845b2015-08-25 09:56:38 -060079
Jens Owenef5b8ed2015-08-25 12:29:34 -040080### ParamChecker Overview
Tobin Ehlisa77845b2015-08-25 09:56:38 -060081
82The ParamChecker layer validates parameter values and flags errors for any values that are outside of acceptable values for the given parameter.
83
Jens Owenef5b8ed2015-08-25 12:29:34 -040084### ParamChecker Details Table
Tobin Ehlisa77845b2015-08-25 09:56:38 -060085
86| Check | Overview | ENUM | Relevant API | Testname | Notes/TODO |
87| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Cody Northrope4bc6942015-08-26 10:01:32 -060088| 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 vkAllocMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkQueueBindSparseBufferMemory vkQueueBindSparseImageOpaqueMemory vkQueueBindSparseImageMemory vkCreateFence vkResetFences vkWaitForFences vkCreateSemaphore vkCreateEvent vkCreateQueryPool vkCreateBuffer vkCreateBufferView vkCreateImage vkGetImageSubresourceLayout vkCreateImageView vkCreateAttachmentView vkCreateShader vkCreatePipelineCache vkMergePipelineCaches vkCreateGraphicsPipelines vkCreateComputePipelines vkCreatePipelineLayout vkCreateSampler vkCreateDescriptorSetLayout( vkCreateDescriptorPool vkAllocDescriptorSets vkFreeDescriptorSets vkUpdateDescriptorSets vkCreateDynamicViewportState vkCreateDynamicLineWidthState vkCreateDynamicDepthBiasState vkCreateDynamicBlendState vkCreateDynamicDepthBoundsState vkCreateDynamicStencilState vkCreateFramebuffer vkCreateRenderPass vkCreateCommandPool vkCreateCommandBuffer vkBeginCommandBuffer vkCmdBindDescriptorSets vkCmdBindVertexBuffers vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearColorAttachment vkCmdClearDepthStencilAttachment vkCmdResolveImage vkCmdWaitEvents vkCmdPipelineBarrier vkCmdPushConstants vkCmdBeginRenderPass vkCmdExecuteCommands | TBD | NA |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -060089| 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 vkAllocMemory vkFreeMemory vkMapMemory vkUnmapMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkGetDeviceMemoryCommitment vkBindBufferMemory vkBindImageMemory vkGetBufferMemoryRequirements vkGetImageMemoryRequirements vkGetImageSparseMemoryRequirements vkGetPhysicalDeviceSparseImageFormatProperties vkQueueBindSparseBufferMemory vkQueueBindSparseImageOpaqueMemory vkQueueBindSparseImageMemory vkCreateFence vkDestroyFence vkResetFences vkGetFenceStatus vkWaitForFences vkCreateSemaphore vkDestroySemaphore vkQueueSignalSemaphore vkQueueWaitSemaphore vkCreateEvent vkDestroyEvent vkGetEventStatus vkSetEvent vkResetEvent vkCreateQueryPool vkDestroyQueryPool vkGetQueryPoolResults vkCreateBuffer vkDestroyBuffer vkCreateBufferView vkDestroyBufferView vkCreateImage vkDestroyImage vkGetImageSubresourceLayout vkCreateImageView vkDestroyImageView vkCreateAttachmentView vkDestroyAttachmentView vkDestroyShaderModule vkCreateShader vkDestroyShader vkCreatePipelineCache vkDestroyPipelineCache vkGetPipelineCacheSize vkGetPipelineCacheData vkMergePipelineCaches vkCreateGraphicsPipelines vkCreateComputePipelines vkDestroyPipeline vkCreatePipelineLayout vkDestroyPipelineLayout vkCreateSampler vkDestroySampler vkCreateDescriptorSetLayout vkDestroyDescriptorSetLayout vkCreateDescriptorPool vkDestroyDescriptorPool vkResetDescriptorPool vkAllocDescriptorSets vkFreeDescriptorSets vkUpdateDescriptorSets vkCreateDynamicViewportState vkDestroyDynamicViewportState vkCreateDynamicLineWidthState vkDestroyDynamicLineWidthState vkCreateDynamicDepthBiasState vkDestroyDynamicDepthBiasState vkCreateDynamicBlendState vkDestroyDynamicBlendState vkCreateDynamicDepthBiasState vkDestroyDynamicDepthBiasState vkCreateDynamicStencilState vkDestroyDynamicStencilState vkCreateFramebuffer vkDestroyFramebuffer vkCreateRenderPass vkDestroyRenderPass vkGetRenderAreaGranularity vkCreateCommandPool vkDestroyCommandPool vkResetCommandPool vkCreateCommandBuffer vkDestroyCommandBuffer vkBeginCommandBuffer vkEndCommandBuffer vkResetCommandBuffer vkCmdBindPipeline vkCmdBindDynamicViewportState vkCmdBindDynamicBlendState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearColorAttachment vkCmdClearDepthStencilAttachment vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdCopyQueryPoolResults vkCmdPushConstants vkCmdBeginRenderPass vkCmdNextSubpass vkCmdEndRenderPass vkCmdExecuteCommands | TBD | NA |
Tobin Ehlis236717c2015-08-31 12:42:38 -060090| NA | Enum used for informational messages | NONE | | NA | None |
Tobin Ehlisa77845b2015-08-25 09:56:38 -060091
Jens Owenef5b8ed2015-08-25 12:29:34 -040092### ParamChecker Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -060093Additional work to be done
94
95 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.
96 2. From AMD: we were using an image view with a swizzle of VK_CHANNEL_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.
97 3. When querying VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PROPERTIES must provide enough memory for a all the queues on the device (not just 1 when device has multiple queues).
98 4. INT & FLOAT bordercolors. Border color int/float selection must match associated texture format.
99 5. Flag error on VkBufferCreateInfo if buffer size is 0
100 6. VkAttachmentViewCreateInfo.format must be set
101
Jens Owenef5b8ed2015-08-25 12:29:34 -0400102## Image
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600103
Jens Owenef5b8ed2015-08-25 12:29:34 -0400104### Image Overview
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600105
106The Image layer is responsible for validating format-related information and enforcing format restrictions.
107
Jens Owenef5b8ed2015-08-25 12:29:34 -0400108### Image Details Table
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600109
110DETAILS TABLE PENDING
111
112| Check | Overview | ENUM | Relevant API | Testname | Notes/TODO |
113| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
114| Image Format | Verifies returned format to ensure that it is a supported Vulkan format | NA | vkCreateImage vkCreateRenderPass | TBD | NA |
115| Image Format | Validates that attachment image layouts, loadOps, and storeOps are valid Vulkan values; Verifies that if there is no depth attachment then the subpass attachment is set to VK_ATTACHMENT_UNUSED | NA | vkCreateRenderPass | TBD | NA |
116
Jens Owenef5b8ed2015-08-25 12:29:34 -0400117### Image Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600118Additional work to be done
119
Jens Owenef5b8ed2015-08-25 12:29:34 -0400120## MemTracker
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600121
Jens Owenef5b8ed2015-08-25 12:29:34 -0400122### MemTracker Overview
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600123
124The MemTracker 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.. MemTracker validates several other hazard-related issues related to command buffers, fences, and memory mapping.
125
Jens Owenef5b8ed2015-08-25 12:29:34 -0400126### MemTracker Details Table
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600127
128| Check | Overview | ENUM MEMTRACK_* | Relevant API | Testname | Notes/TODO |
129| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Cody Northrope4bc6942015-08-26 10:01:32 -0600130| Valid Command Buffer | Verifies that the command buffer was properly created and is currently valid | INVALID_CB | vkCmdBindPipeline vkCmdBindDynamicViewportState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicBlendState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState vkBeginCommandBuffer vkResetCommandBuffer vkDestroyDevice vkFreeMemory | NA | NA |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -0600131| 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 vkQueueBindSparseImageOpaqueMemory vkQueueBindSparseImageMemory vkQueueBindSparseBufferMemory | NA | NA |
132| Free Referenced Memory | Checks to see if memory being freed still has current references | FREED_MEM_REF | vmFreeMemory | FreeBoundMemory | NA |
133| 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 vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | NA | NA |
Cody Northrope4bc6942015-08-26 10:01:32 -0600134| Valid Object | Verifies that the specified Vulkan object was created properly and is currently valid | INVALID_OBJECT | vkCmdBindPipeline vkCmdBindDynamicViewportState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicBlendState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | NA | NA |
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600135| 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 | vkQueueBindSparseImageOpaqueMemory vkQueueBindSparseImageMemory vkQueueBindSparseBufferMemory vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdResolveImage | BindInvalidMemory BindMemoryToDestroyedObject | This is probably redundant, as these checks are performed at a lower level. |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -0600136| Objects Not Destroyed | Verify all objects destroyed at DestroyDevice time | MEMORY_LEAK | vkDestroyDevice | NA | NA |
137| Memory Mapping State | Verifies that mapped memory is CPU-visible | INVALID_STATE | vkMapMemory | MapMemWithoutHostVisibleBit | NA |
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600138| Command Buffer Synchronization | Command Buffer must be complete before BeginCommandBuffer or ResetCommandBuffer can be called | RESET_CB_WHILE_IN_FLIGHT | vkBeginCommandBuffer vkResetCommandBuffer | CallBeginCmdBufferBeforeCompletion CallBeginCmdBufferBeforeCompletion | NA |
139| Submitted Fence Status | Verifies that: The fence is not submitted in an already signaled state, and that ResetFences is not called with a fence in an unsignaled state | INVALID_FENCE_STATE | vkResetFences vkWaitForFences vkQueueSubmit | SubmitSignaledFence ResetUnsignaledFence | NA |
140| Immutable Memory Binding | Validates that non-sparse memory bindings are immutable, so objects are not re-boundt | REBIND_OBJECT | vkBindBufferMemory, vkBindImageMemory | RebindMemory | NA |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -0600141| Image/Buffer Usage bits | Verify correct USAGE bits set based on how Images and Buffers are used | INVALID_USAGE_FLAG | vkCreateImage, vkCreateAttachmentView, vkCreateBuffer, vkCreateBufferView, vkCmdCopyBuffer, vkCmdCopyImage, vkCmdBlitImage, vkCmdCopyBufferToImage, vkCmdCopyImageToBuffer, vkCmdUpdateBuffer, vkCmdFillBuffer | InvalidUsageBits | NA |
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600142| 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 |
Tobin Ehlis236717c2015-08-31 12:42:38 -0600143| NA | Enum used for informational messages | NONE | | NA | None |
144| 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 Ehlisa77845b2015-08-25 09:56:38 -0600145
Jens Owenef5b8ed2015-08-25 12:29:34 -0400146### MemTracker Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600147
Jens Owenef5b8ed2015-08-25 12:29:34 -0400148#### MemTracker Enhancements
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600149
1501. Flag any memory hazards: Validate that the pipeline barriers for buffers are sufficient to avoid hazards
1512. 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 Ehlis2235fbc2015-08-27 17:43:11 -06001523. 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 Ehlisa77845b2015-08-25 09:56:38 -06001534. Update for new Memory Binding Model
1545. Consolidate error messages and make them consistent
1557. Add validation for having mapped objects in a command list - GPU writing to mapped object is warning
1568. Add validation for maximum memory references, maximum object counts, and object leaks
1579. 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).
15810. Re-enable INFO messages that were disabled during v138 integration
15911. Warn on image/buffer deletion if USAGE bits were set that were not needed
16012. Modify INVALID_FENCE_STATE to be WARNINGs instead of ERROR
Mike Stroyan70fd0852015-08-28 11:33:32 -060016113. 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 Ehlisa77845b2015-08-25 09:56:38 -0600162
163
Jens Owenef5b8ed2015-08-25 12:29:34 -0400164## ShaderChecker
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600165
Jens Owenef5b8ed2015-08-25 12:29:34 -0400166### ShaderChecker Overview
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600167
168The ShaderChecker layer inspects the SPIR-V shader images and fixed function pipeline stages at PSO creation time.
169It flags errors when inconsistencies are found across interfaces between shader stages. The exact behavior of the checks
170depends on the pair of pipeline stages involved.
171
Jens Owenef5b8ed2015-08-25 12:29:34 -0400172### ShaderChecker Details Table
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600173
174| Check | Overview | ENUM SHADER_CHECKER_* | Relevant API | Testname | Notes/TODO |
175| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -0600176| Not consumed | Flag warning if a location is not consumed (useless work) | OUTPUT_NOT_CONSUMED | vkCreateGraphicsPipelines | CreatePipeline*NotConsumed | NA |
177| Not produced | Flag error if a location is not produced (consumer reads garbage) | INPUT_NOT_PRODUCED | vkCreateGraphicsPipelines | CreatePipeline*NotProvided | NA |
178| 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. |
179| 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. |
180| Non-SPIRV shader | Flag warning if a non-SPIR-V shader image is detected. This can occur if early drivers are ingesting GLSL. ShaderChecker cannot analyze non-SPIRV shaders, so this suppresses most other checks. | NON_SPIRV_SHADER | vkCreateGraphicsPipelines | TODO | NA |
181| 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 |
182| VI Binding Descriptions | Validate that there is a single vertex input binding description for each binding | INCONSISTENT_VI | vkCreateGraphicsPipelines | CreatePipelineAttribBindingConflict | NA |
183| Shader Stage Check | Warns if shader stage is unsupported | UNKNOWN_STAGE | vkCreateGraphicsPipelines | TBD | NA |
Tobin Ehlis236717c2015-08-31 12:42:38 -0600184| NA | Enum used for informational messages | NONE | | NA | None |
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600185
Jens Owenef5b8ed2015-08-25 12:29:34 -0400186### ShaderChecker Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600187- Additional test cases for variously broken SPIRV images
188- Validation of a single SPIRV image in isolation (the spec describes many constraints)
189- Validation of SPIRV use of descriptors against the declared descriptor set layout
190
Jens Owenef5b8ed2015-08-25 12:29:34 -0400191## ObjectTracker
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600192
Jens Owenef5b8ed2015-08-25 12:29:34 -0400193### ObjectTracker Overview
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600194
195The ObjectTracker 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.
196
Jens Owenef5b8ed2015-08-25 12:29:34 -0400197### ObjectTracker Details Table
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600198
199| Check | Overview | ENUM OBJTRACK_* | Relevant API | Testname | Notes/TODO |
200| ----- | -------- | ---------------- | ------------ | -------- | ---------- |
Tobin Ehlis236717c2015-08-31 12:42:38 -0600201| Valid Object | Validates that referenced object was properly created and is currently valid. | INVALID_OBJECT | vkAcquireNextImageWSI vkAllocDescriptorSets vkAllocMemory vkBeginCommandBuffer vkBindBufferMemory vkBindImageMemory vkCmdBeginQuery vkCmdBeginRenderPass vkCmdBindDescriptorSets vkCmdBindDynamicViewportState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicBlendState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState vkCmdBindIndexBuffer vkCmdBindPipeline vkCmdBindVertexBuffers vkCmdBlitImage vkCmdClearColorAttachment vkCmdClearColorImage vkCmdClearDepthStencilAttachment 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 vkCreateAttachmentView vkCreateBuffer vkCreateBufferView vkCreateCommandBuffer vkCreateCommandPool vkCreateComputePipelines vkCreateDescriptorPool vkCreateDescriptorSetLayout vkCreateDynamicViewportState vkCreateDynamicLineWidthState vkCreateDynamicDepthBiasState vkCreateDynamicBlendState vkCreateDynamicDepthBoundsState vkCreateDynamicStencilState vkCreateEvent vkCreateFence vkCreateFramebuffer vkCreateGraphicsPipelines vkCreateImage vkCreateImageView vkCreatePipelineCache vkCreatePipelineLayout vkCreateQueryPool vkCreateRenderPass vkCreateSampler vkCreateSemaphore vkCreateShader vkCreateShaderModule vkCreateSwapChainWSI vkDestroyAttachmentView vkDestroyBuffer vkDestroyBufferView vkDestroyCommandBuffer vkDestroyCommandPool vkDestroyDescriptorPool vkDestroyDescriptorSetLayout vkDestroyDynamicBlendState vkDestroyDynamicLineWidthState vkDestroyDynamicDepthBiasState vkDestroyDynamicDepthBoundsState vkDestroyDynamicStencilState vkDestroyDynamicViewportState vkDestroyEvent vkDestroyFence vkDestroyFramebuffer vkDestroyImage vkDestroyImageView vkDestroyPipeline vkDestroyPipelineCache vkDestroyPipelineLayout vkDestroyQueryPool vkDestroyRenderPass vkDestroySampler vkDestroySemaphore vkDestroyShader vkDestroyShaderModule vkDestroySwapChainWSI vkDeviceWaitIdle vkEndCommandBuffer vkEnumeratePhysicalDevices vkFreeDescriptorSets vkFreeMemory vkFreeMemory vkGetBufferMemoryRequirements vkGetDeviceMemoryCommitment vkGetDeviceQueue vkGetEventStatus vkGetFenceStatus vkGetImageMemoryRequirements vkGetImageSparseMemoryRequirements vkGetImageSubresourceLayout vkGetPhysicalDeviceSurfaceSupportWSI vkGetPipelineCacheData vkGetPipelineCacheSize vkGetQueryPoolResults vkGetRenderAreaGranularity vkInvalidateMappedMemoryRanges vkMapMemory vkMergePipelineCaches vkQueueBindSparseBufferMemory vkQueueSignalSemaphore vkQueueWaitSemaphore vkResetCommandBuffer vkResetCommandPool vkResetDescriptorPool vkResetEvent vkResetFences vkSetEvent vkUnmapMemory vkUpdateDescriptorSets vkWaitForFences | ? | Every VkObject class of parameter will be run through this check. This check may ultimately supersede UNKNOWN_OBJECT |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -0600202| Object Cleanup | Verify that object properly destroyed | DESTROY_OBJECT_FAILED | vkDestroyInstance, vkDestroyDevice, vkFreeMemory | ? | NA |
203| 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 Ehlis236717c2015-08-31 12:42:38 -0600204| Object Count | Flag error if number of objects requested from extenstion functions exceeds max number of actual objects | OBJCOUNT_MAX_EXCEEDED | objTrackGetObjects objTrackGetObjectsOfType | ? | NA |
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600205| Valid Fence for Wait | Flag error if waiting on unsubmitted fence object | INVALID_FENCE | vkGetFenceStatus | WaitForUnsubmittedFence | NA |
Tobin Ehlis2235fbc2015-08-27 17:43:11 -0600206| 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 vkDestroyAttachmentView vkDestroyShaderModule vkDestroyShader vkDestroyPipelineCache vkDestroyPipeline vkDestroyPipelineLayout vkDestroySampler vkDestroyDescriptorSetLayout vkDestroyDescriptorPool vkDestroyDynamicViewportState vkDestroyDynamicBlendState vkDestroyDynamicLineWidthState vkDestroyDynamicDepthBiasState vkDestroyDynamicDepthBoundsState vkDestroyDynamicStencilState vkDestroyCommandPool vkDestroyCommandBuffer vkDestroyFramebuffer vkDestroyRenderPass vkDestroySwapChainWSI | TBD | These cases need to be moved to a more appropriate error enum |
Tobin Ehlis236717c2015-08-31 12:42:38 -0600207| 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. |
208| NA | Enum used for informational messages | NONE | | NA | None |
209| 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 Ehlisa77845b2015-08-25 09:56:38 -0600210
Jens Owenef5b8ed2015-08-25 12:29:34 -0400211### ObjectTracker Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600212
213 4. Verify images have CmdPipelineBarrier layouts matching new layout parameters to Cmd*Image* functions
214 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 Everitt5addc5e2015-08-27 05:17:57 -0500215 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.
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600216
Jens Owenef5b8ed2015-08-25 12:29:34 -0400217## Threading
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600218
Jens Owenef5b8ed2015-08-25 12:29:34 -0400219### Threading Overview
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600220
221The Threading layer checks for simultaneous use of objects by calls from multiple threads.
222Application code is responsible for preventing simultaneous use of the same objects by certain calls that modify objects.
223See [bug 13433](https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13433) and
224<https://cvs.khronos.org/svn/repos/oglc/trunk/nextgen/vulkan/function_properties.csv>
225for threading rules.
226Objects that may need a mutex include VkQueue, VkDeviceMemory, VkObject, VkBuffer, VkImage, VkDescriptorSet, VkDescriptorPool, VkCmdBuffer, and VkSemaphore.
227The most common case is that a VkCmdBuffer passed to VkCmd* calls must be used by only one thread at a time.
228
229In addition to reporting threading rule violations, the layer will enforce a mutex for those calls.
230That can allow an application to continue running without actually crashing due to the reported threading problem.
231
232The layer can only observe when a mutual exclusion rule is actually violated.
233It cannot insure that there is no latent race condition needing mutual exclusion.
234
235The layer can also catch reentrant use of the same object by calls from a single thread.
236That might happen if Vulkan calls are made from a callback function or a signal handler.
237But the layer cannot prevent such a reentrant use of an object.
238
239The layer can only observe when a mutual exclusion rule is actually violated.
240It cannot insure that there is no latent race condition.
241
Jens Owenef5b8ed2015-08-25 12:29:34 -0400242### Threading Details Table
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600243
Tobin Ehlis2235fbc2015-08-27 17:43:11 -0600244| Check | Overview | ENUM THREADING_CHECKER_* | Relevant API | Testname | Notes/TODO |
245| ----- | -------- | ---------------- | ---------------- | -------- | ---------- |
246| Thread Collision | Detects and notifies user if multiple threads are modifying thes same object | MULTIPLE_THREADS | vkQueueSubmit vkFreeMemory vkMapMemory vkUnmapMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkBindBufferMemory vkBindImageMemory vkQueueBindSparseBufferMemory vkQueueBindSparseImageOpaqueMemory vkQueueBindSparseImageMemory vkDestroySemaphore vkQueueSignalSemaphore vkDestroyBuffer vkDestroyImage vkDestroyDescriptorPool vkResetDescriptorPool vkAllocDescriptorSets vkFreeDescriptorSets vkDestroyCommandBuffer vkBeginCommandBuffer vkEndCommandBuffer vkResetCommandBuffer vkCmdBindPipeline vkCmdBindDynamicViewportState vkCmdBindDynamicBlendState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearColorAttachment vkCmdClearDepthStencilAttachment vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdCopyQueryPoolResults vkCmdBeginRenderPass vkCmdNextSubpass vkCmdPushConstants vkCmdEndRenderPass vkCmdExecuteCommands | ??? | NA |
247| Thread Reentrancy | Detects cases of a single thread calling Vulkan reentrantly | SINGLE_THREAD_REUSE | vkQueueSubmit vkFreeMemory vkMapMemory vkUnmapMemory vkFlushMappedMemoryRanges vkInvalidateMappedMemoryRanges vkBindBufferMemory vkBindImageMemory vkQueueBindSparseBufferMemory vkQueueBindSparseImageOpaqueMemory vkQueueBindSparseImageMemory vkDestroySemaphore vkQueueSignalSemaphore vkDestroyBuffer vkDestroyImage vkDestroyDescriptorPool vkResetDescriptorPool vkAllocDescriptorSets vkFreeDescriptorSets vkDestroyCommandBuffer vkBeginCommandBuffer vkEndCommandBuffer vkResetCommandBuffer vkCmdBindPipeline vkCmdBindDynamicViewportState vkCmdBindDynamicBlendState vkCmdBindDynamicLineWidthState vkCmdBindDynamicDepthBiasState vkCmdBindDynamicDepthBoundsState vkCmdBindDynamicStencilState vkCmdBindDescriptorSets vkCmdBindIndexBuffer vkCmdBindVertexBuffers vkCmdDraw vkCmdDrawIndexed vkCmdDrawIndirect vkCmdDrawIndexedIndirect vkCmdDispatch vkCmdDispatchIndirect vkCmdCopyBuffer vkCmdCopyImage vkCmdBlitImage vkCmdCopyBufferToImage vkCmdCopyImageToBuffer vkCmdUpdateBuffer vkCmdFillBuffer vkCmdClearColorImage vkCmdClearDepthStencilImage vkCmdClearColorAttachment vkCmdClearDepthStencilAttachment vkCmdResolveImage vkCmdSetEvent vkCmdResetEvent vkCmdWaitEvents vkCmdPipelineBarrier vkCmdBeginQuery vkCmdEndQuery vkCmdResetQueryPool vkCmdWriteTimestamp vkCmdCopyQueryPoolResults vkCmdBeginRenderPass vkCmdNextSubpass vkCmdPushConstants vkCmdEndRenderPass vkCmdExecuteCommands | ??? | NA |
Tobin Ehlis236717c2015-08-31 12:42:38 -0600248| NA | Enum used for informational messages | NONE | | NA | None |
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600249
Jens Owenef5b8ed2015-08-25 12:29:34 -0400250### Threading Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600251Additional work to be done
252
Jens Owenef5b8ed2015-08-25 12:29:34 -0400253## General Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600254A place to capture general validation work to be done. This includes new checks that don't clearly fit into the above layers.
255
Tobin Ehlis2235fbc2015-08-27 17:43:11 -0600256 1. For Upcoming Dynamic State overhaul (if approved): If dynamic state value that is consumed is never set prior to consumption, flag an error
257 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
258 3. Need a WSI validation layer(s) to validate correct usage of WSI API. One issue that has already come up is correct UsageFlags for WSI SwapChains and SurfaceProperties. Tons of other stuff including semaphore and synchronization validation.
259
Jens Owenef5b8ed2015-08-25 12:29:34 -0400260## Device Limitations
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600261
Jens Owenef5b8ed2015-08-25 12:29:34 -0400262### Device Limitations Overview
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600263
264This layer does not yet exist. The general idea is that at the beginning of time this layer would query device limitations in terms of memory size, format and feature support, and so on. This entails making a complete set of vkGetPhysicalDevice* calls and storing the results. If, later on, the app violates these limitations, then this layer would flag those violations.
265
Jens Owenef5b8ed2015-08-25 12:29:34 -0400266### Device Limitations Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600267
268 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.
269
Jens Owenef5b8ed2015-08-25 12:29:34 -0400270# Non-validation Layer Details
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600271
Jens Owenef5b8ed2015-08-25 12:29:34 -0400272## APIDump
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600273
274APIDump 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.
275
Jens Owenef5b8ed2015-08-25 12:29:34 -0400276### APIDump Pending Work
Tobin Ehlisa77845b2015-08-25 09:56:38 -0600277
Cody Northrope4bc6942015-08-26 10:01:32 -0600278 1. vkAllocDescriptorSets does not correctly print out all of the created DescriptorSets (no array printing following main API txt)