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

Vulkan Validation Errors when clearing the Screen (hello-windows example) #1906

Closed
sotrh opened this issue Sep 4, 2021 · 3 comments
Closed

Comments

@sotrh
Copy link

sotrh commented Sep 4, 2021

Description
Running a render pass just to clear the screen causes a bunch of validation errors every frame. I found this while migrating my tutorial to 0.10, but I'm seeing this on the hello-windows example found on this repo.

Repro steps
You can find my code at https://github.com/sotrh/learn-wgpu/tree/0.10/code/beginner/tutorial2-swapchain, but running the hello-windows example works as well.

Expected vs observed behavior
Creating a render pass to clear the screen, then dropping it shouldn't cause these validation errors.

Extra materials
Validation errors in question:

Validation Error: [ VUID-vkResetCommandPool-commandPool-00040 ] Object 0: handle = 0x55f389d886f8, name = Render Encoder, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xb53e2331 | Attempt to reset command pool with VkCommandBuffer 0x55f389d886f8[Render Encoder] which is in use. The Vulkan spec states: All VkCommandBuffer objects allocated from commandPool must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.2.148.0/linux/1.2-extensions/vkspec.html#VUID-vkResetCommandPool-commandPool-00040)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] 	objects: (type: COMMAND_BUFFER, hndl: 0x55f389d886f8, name: Render Encoder)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkResetCommandPool-commandPool-00040 (0xb53e2331)]
    	Validation Error: [ VUID-vkResetCommandPool-commandPool-00040 ] Object 0: handle = 0x55f389d873a8, name = _Transit, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xb53e2331 | Attempt to reset command pool with VkCommandBuffer 0x55f389d873a8[_Transit] which is in use. The Vulkan spec states: All VkCommandBuffer objects allocated from commandPool must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.2.148.0/linux/1.2-extensions/vkspec.html#VUID-vkResetCommandPool-commandPool-00040)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] 	objects: (type: COMMAND_BUFFER, hndl: 0x55f389d873a8, name: _Transit)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkFreeCommandBuffers-pCommandBuffers-00047 (0x1ab902fc)]
    	Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x55f389dbc428, name = _Transit, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x1ab902fc | Attempt to free VkCommandBuffer 0x55f389dbc428[_Transit] which is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.2.148.0/linux/1.2-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] 	objects: (type: COMMAND_BUFFER, hndl: 0x55f389dbc428, name: _Transit)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkFreeCommandBuffers-pCommandBuffers-00047 (0x1ab902fc)]
    	Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x55f389db8a38, name = Render Encoder, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x1ab902fc | Attempt to free VkCommandBuffer 0x55f389db8a38[Render Encoder] which is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.2.148.0/linux/1.2-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] 	objects: (type: COMMAND_BUFFER, hndl: 0x55f389db8a38, name: Render Encoder)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkFreeCommandBuffers-pCommandBuffers-00047 (0x1ab902fc)]
    	Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x55f389db9d88, name = Render Pass, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x1ab902fc | Attempt to free VkCommandBuffer 0x55f389db9d88[Render Pass] which is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.2.148.0/linux/1.2-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] 	objects: (type: COMMAND_BUFFER, hndl: 0x55f389db9d88, name: Render Pass)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkFreeCommandBuffers-pCommandBuffers-00047 (0x1ab902fc)]
    	Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x55f389dbb0d8, name = _Present, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x1ab902fc | Attempt to free VkCommandBuffer 0x55f389dbb0d8[_Present] which is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.2.148.0/linux/1.2-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] 	objects: (type: COMMAND_BUFFER, hndl: 0x55f389dbb0d8, name: _Present)
[2021-09-04T20:10:29Z ERROR wgpu_hal::vulkan::instance] VALIDATION [VUID-vkDestroyRenderPass-renderPass-00873 (0x473619ad)]
    	Validation Error: [ VUID-vkDestroyRenderPass-renderPass-00873 ] Object 0: handle = 0x55f388e0b208, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x473619ad | Cannot call vkDestroyRenderPass on VkRenderPass 0x120000000012[] that is currently in use by a command buffer. The Vulkan spec states: All submitted commands that refer to renderPass must have completed execution (https://vulkan.lunarg.com/doc/view/1.2.148.0/linux/1.2-extensions/vkspec.html#VUID-vkDestroyRenderPass-renderPass-00873)

Platform
wgpu = { git = "https://github.com/gfx-rs/wgpu/", rev = "d5ba0b4", features=["trace"]}
rustc 1.51.0 (2fd73fabe 2021-03-23)
cargo 1.51.0 (43b129a20 2021-03-16)

@cwfitzgerald
Copy link
Member

From the links, you're using sdk 1.2.148 (latest is 1.2.182 iirc), wgpu 0.10 needs recent validation layers to not have false positives, so hopefully updating will fix this.

@sotrh
Copy link
Author

sotrh commented Sep 7, 2021

Ok I'll try that

@sotrh
Copy link
Author

sotrh commented Sep 7, 2021

That's working for me. I'll add that to my tutorial.

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

No branches or pull requests

2 participants