Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the validation layer #80

Open
dati91 opened this issue Feb 26, 2018 · 14 comments · Fixed by #250
Open

Check the validation layer #80

dati91 opened this issue Feb 26, 2018 · 14 comments · Fixed by #250

Comments

@dati91
Copy link
Member

dati91 commented Feb 26, 2018

Now that most of the major components are in place, we should pay more attention to the validation layer.

We can collect the issues here and identify the corresponding code, then fix it.

@dati91
Copy link
Member Author

dati91 commented Feb 26, 2018

The following errors are from this revision.
I ran the basic and blob examples and picked the common errors for starter.

There are other errors, but we can start with these first.

@kvark
Copy link

kvark commented Feb 26, 2018

@dati91
Copy link
Member Author

dati91 commented Feb 27, 2018

More errors:

From basic:

From blob:

From both:

  • ERROR:: [DS] Cannot submit cmd buffer using image (0x4) [sub-resource: aspectMask 0x1 array layer 0, mip level 0], with layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR when first use is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.
    • Issue: N/A

@dati91
Copy link
Member Author

dati91 commented Feb 28, 2018

vkCreateSampler() already addressed in gfx-rs/gfx@e302712

The issue

ERROR:: [ParameterValidation] vkCreateSampler(): The samplerAnisotropy feature was not enabled at device-creation time, so the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0 but is 0.000000.

is still exist because the default value here is set to 0.0 instead of 1.0 as the error states.

cc @kvark

@kvark
Copy link

kvark commented Feb 28, 2018

argh, sorry

@zakorgy
Copy link

zakorgy commented Mar 5, 2018

Another error:

@dati91
Copy link
Member Author

dati91 commented Mar 7, 2018

@dati91
Copy link
Member Author

dati91 commented Mar 29, 2018

The remaining issues:

  • ERROR:: [DS] Object: 0x105a | Descriptor set 0x105a encountered the following validation error at vkCmdDraw() time: Descriptor in binding [meta] Support the drawing with Gfx_rs #1 at global descriptor index 1 is being used in draw but has not been updated.
  • ERROR:: [DS] Object: 0x7f2b421a6400 | You are adding vkQueueSubmit() to command buffer 0x7f2b421a6400 that is invalid because bound DescriptorSet 0x1602 was destroyed or updated.
  • ERROR:: [DS] Object: 0x7f2b421a6e00 | vkCmdSetBlendConstants(): pipeline was created without VK_DYNAMIC_STATE_BLEND_CONSTANTS flag. The spec valid usage text states 'The currently bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_BLEND_CONSTANTS dynamic state enabled' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetBlendConstants-None-00612).
  • ERROR:: [DS] Object: 0x8 | vkCmdDraw(): RenderPasses incompatible between active render pass w/ renderPass 0x8 and pipeline state object w/ renderPass 0x6 Attachment 0 is not compatible with 0: They have different formats.. The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-renderPass-00435)

We need to fix the barriers #99

  • ERROR:: [DS] Object: 0x7f2b421a6e00 | vkCmdPipelineBarrier(): pImageMemBarriers[0].srcAccessMask (0x800) is not supported by srcStageMask (0x1). The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184)
  • ERROR:: [DS] Object: 0x7f2b46618000 | vkCmdPipelineBarrier(): pImageMemBarriers[0].dstAccessMask (0x180) is not supported by dstStageMask (0x2000). The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its dstAccessMask member if that bit is not supported by any of the pipeline stages in dstStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01185)
  • ERROR:: [DS] Object: 0x7f2b46618000 | vkCmdPipelineBarrier(): pImageMemBarriers[1].dstAccessMask (0x180) is not supported by dstStageMask (0x2000). The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its dstAccessMask member if that bit is not supported by any of the pipeline stages in dstStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01185)
  • ERROR:: [DS] Object: 0x7f2b46618000 | vkCmdPipelineBarrier(): pImageMemBarriers[1].srcAccessMask (0x180) is not supported by srcStageMask (0x1). The spec valid usage text states 'Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the table of supported access types.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184)

The cache clip shaders don't use the aData input attributes.

  • ERROR:: [SC] Object: 0x0 | Vertex shader consumes input at location 4 but not provided
  • ERROR:: [SC] Object: 0x0 | Vertex shader consumes input at location 5 but not provided

We are not releasing the resources correctly

@dati91
Copy link
Member Author

dati91 commented Apr 12, 2018

  • ERROR:: [DS] Object: 0x163b | CmdBindPipeline: vkPipeline (0x163b) attachment[0] has a dual-source blend factor but this device feature is not enabled.

@dati91
Copy link
Member Author

dati91 commented May 10, 2018

It seems like I missed something in the latest rebase.
It most probably related to the new DashAndDot Vertex array kind.

  • ERROR [SC] Object: 0x0 | fragment shader consumes input location 6.0 which is not written by vertex shader
  • ERROR [SC] Object: 0x0 | fragment shader consumes input location 7.0 which is not written by vertex shader
  • ERROR [DS] Object: 0x6 | vkCmdDraw(): RenderPasses incompatible between active render pass w/ renderPass 0x6 and pipeline state object w/ renderPass 0x8 Attachment 0 is not compatible with 0: They have different formats.. The spec valid usage text states 'The current render pass must be compatible with the renderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline currently bound to VK_PIPELINE_BIND_POINT_GRAPHICS.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdDraw-renderPass-00435)

@dati91
Copy link
Member Author

dati91 commented Jun 26, 2018

  • ERROR gfx_backend_vulkan: [Validation] [ VUID-VkMappedMemoryRange-offset-00687 ] Object: 0xaf (Type = 8) | vkFlushMappedMemoryRanges: Offset in pMemRanges[0] is 0x260, which is not a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize (0x40). The spec valid usage text states 'offset must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkMappedMemoryRange-offset-00687)
    • This one occurs when we use a mapping writer for the instance buffer. We allocate a large buffer and only write into a smaller chunk. And the offset + size is not a multiple of nonCoherentAtomSize (64).

@zakorgy
Copy link

zakorgy commented May 2, 2019

After updating the VulkanSDK we have new validation layer error(s), which we should take care:

Descriptor set related:

  • VALIDATION [UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer (0)] : You are adding vkQueueSubmit() to command buffer 0x55932df42c80 that is invalid because bound DescriptorSet 0x47 was destroyed or updated.
    object info: (type: COMMAND_BUFFER, hndl: 94090619530368)

  • VALIDATION [VUID-VkWriteDescriptorSet-descriptorType-01403 (0)] : vkUpdateDescriptorSets() failed write update validation for Descriptor Set 0x2d with error: Write update to VkDescriptorSet 0x2d allocated with VkDescriptorSetLayout 0x2c binding Concatenate shaders from WebRender #2 failed with error message: Attempted write update to image descriptor failed due to: Descriptor update with descriptorType VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE is being updated with invalid imageLayout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL. Allowed layouts are: VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL. The Vulkan spec states: If descriptorType is VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the imageLayout member of each element of pImageInfo must be a member of the list given in Sampled Image or Combined Image Sampler, corresponding to its type (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkWriteDescriptorSet-descriptorType-01403)
    object info: (type: DESCRIPTOR_SET, hndl: 45)

These are happening after window resize:

  • ERROR 2019-05-02T11:30:08Z: gfx_backend_vulkan:
    VALIDATION [UNASSIGNED-CoreValidation-DrawState-InvalidRenderArea (0)] : Cannot execute a render pass with renderArea not within the bound of the framebuffer. RenderArea: x 0, y 0, width 1920, height 1107. Framebuffer: width 1440, height 1080.
    object info: (type: UNKNOWN, hndl: 0)

  • ERROR 2019-05-02T11:30:08Z: gfx_backend_vulkan:
    VALIDATION [VUID-VkImageBlit-dstOffset-00248 (0)] : vkCmdBlitImage: region [0] dstOffset[].x values (1392, 1904) exceed dstSubresource width extent (1440). The Vulkan spec states: dstOffset[0].x and dstOffset[1].x must both be greater than or equal to 0 and less than or equal to the destination image subresource width (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkImageBlit-dstOffset-00248)
    object info: (type: COMMAND_BUFFER, hndl: 94821767681360)

These are related for examples:

image_resize example:

  • ERROR 2019-05-03T13:15:15Z: gfx_backend_vulkan:
    VALIDATION [UNASSIGNED-CoreValidation-DrawState-DescriptorSetNotUpdated (0)] : Descriptor set 0x20 bound as set #0 encountered the following validation error at vkCmdDraw() time: Descriptor in binding [meta] Support the drawing with Gfx_rs #1 index 0 requires an image view of type VK_IMAGE_VIEW_TYPE_2D_ARRAY but got VK_IMAGE_VIEW_TYPE_2D.
    object info: (type: DESCRIPTOR_SET, hndl: 32)

document example:

  • ERROR 2019-05-03T13:16:58Z: gfx_backend_vulkan:
    VALIDATION [UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout (0)] : Submitted command buffer expects image 0x80 (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
    object info: (type: COMMAND_BUFFER, hndl: 94595987603872)

  • ERROR 2019-05-03T13:16:58Z: gfx_backend_vulkan:
    VALIDATION [UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout (0)] : Submitted command buffer expects image 0x7f (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_PRESENT_SRC_KHR.
    object info: (type: COMMAND_BUFFER, hndl: 94595988562848)

  • ERROR 2019-05-03T13:16:58Z: gfx_backend_vulkan:
    VALIDATION [UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout (0)] : Submitted command buffer expects image 0x7f (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR--instead, current layout is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.
    object info: (type: COMMAND_BUFFER, hndl: 94595989385136)


And there is a D3D12 error:

  • D3D12 ERROR: ID3D12CommandQueue::ExecuteCommandLists: Using ResourceBarrier on Command List (0x403890B8:'Unnamed ID3D12GraphicsCommandList Object'): Before state (0x4: D3D12_RESOURCE_STATE_RENDER_TARGET) of resource (0x181BDB60:'Unnamed ID3D12Resource Object') (subresource: 0) specified by transition barrier does not match with the state (0x0: D3D12_RESOURCESTATE[COMMON|PRESENT]) specified in the previous call to ResourceBarrier [ RESOURCE_MANIPULATION ERROR # 527: RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH]

@zakorgy
Copy link

zakorgy commented May 13, 2019

We encountered the following issue with an Nvidia card:

@zakorgy
Copy link

zakorgy commented May 14, 2019

These are Gecko related:

  • UNASSIGNED-CoreValidation-DrawState-InvalidRenderpass(ERROR / SPEC): msgNum: 0 - You cannot start a render pass using a framebuffer with a different number of attachments.
    Objects: 1
    [0] 0xec4ca40, type: 6, name: NULL
  • VUID-VkRenderPassBeginInfo-renderPass-00904(ERROR / SPEC): msgNum: 0 - vkCmdBeginRenderPass(): RenderPasses incompatible between render pass w/ renderPass 0x7 and framebuffer w/ renderPass 0x8 Attachment 4294967295 is not compatible with 1: The first is unused while the second is not.. The Vulkan spec states: renderPass must be compatible with the renderPass member of the VkFramebufferCreateInfo structure specified when creating framebuffer. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkRenderPassBeginInfo-renderPass-00904)
    Objects: 1
    [0] 0x7, type: 18, name: NULL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants