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

geometry do not render anymore in wgpu 0.14.0 #3079

Closed
pwouik opened this issue Oct 7, 2022 · 17 comments · Fixed by #3370
Closed

geometry do not render anymore in wgpu 0.14.0 #3079

pwouik opened this issue Oct 7, 2022 · 17 comments · Fixed by #3370
Labels
api: vulkan Issues with Vulkan type: bug Something isn't working

Comments

@pwouik
Copy link

pwouik commented Oct 7, 2022

Description
My project: https://github.com/pwouik/rust_voxel_engine/tree/d54bdaf7a1d1585f8d72e97e2f605d8e284234ca was working in wgpu 0.13.2 but just by updating wgpu to 0.14.0 and adding alpha_mode: CompositeAlphaMode:Auto, it doesn't draw anything anymore, just the clear color

The call to draw_indirect_count in chunk_renderer.rs should render the terrain, but look like it doesn't do anything with wgpu 0.14.0

Repro steps
clone my project, create save/region folder, it run, upgrade to wgpu 0.14.0, add alpha_mode, it break

Platform
Ubuntu 22.04.1 LTS x86_64

@pwouik
Copy link
Author

pwouik commented Oct 7, 2022

It broke in commit c519901d575bd6d61711e5cf9c3c1b047e7d3cf7

@cwfitzgerald
Copy link
Member

What hardware/driver?

@pwouik
Copy link
Author

pwouik commented Oct 7, 2022

Intel TigerLake-LP GT2 [Iris Xe Graphics]
Mesa Intel(R) Xe Graphics (TGL GT2) (0x9a49)

@pwouik
Copy link
Author

pwouik commented Oct 7, 2022

I tried upgrading to mesa 22.2.0 but it still doesn't work

@cwfitzgerald
Copy link
Member

I would recommend looking in renderdoc to see if you see anything funky - I would also double check if there are any issues with vulkan validation.

@pwouik
Copy link
Author

pwouik commented Oct 9, 2022

51 API High Miscellaneous 786497355 Validation Error: [ VUID-vkCmdDrawIndexedIndirectCount-stride-03142 ] Object 0: handle = Command Buffer 476, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x2ee0ff4b | stride 16 is invalid or less than sizeof(VkDrawIndexedIndirectCommand) 20. The Vulkan spec states: stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawIndexedIndirectCommand) (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCount-stride-03142)
51 API High Miscellaneous 2479366321 Validation Error: [ VUID-vkCmdDrawIndexedIndirectCount-maxDrawCount-03143 ] Object 0: handle = Command Buffer 476, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x93c820b1 | stride[16] * (drawCount[12138] - 1) + offset[0] + sizeof(VkDrawIndexedIndirectCommand)[20] = 2f6a4 is greater than the size[2f6a0] of VkBuffer Buffer 403. The Vulkan spec states: If maxDrawCount is greater than or equal to 1, (stride {times} (maxDrawCount - 1) + offset + sizeof(VkDrawIndexedIndirectCommand)) must be less than or equal to the size of buffer (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCount-maxDrawCount-03143)
51 API High Miscellaneous 419123623 Validation Error: [ VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-02701 ] Object 0: handle = Command Buffer 476, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x18fb51a7 | VkCommandBuffer Command Buffer 476: Index buffer object not bound to this command buffer when Indexed Draw attempted. The Vulkan spec states: If the VkPipeline object bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set or inherited (if the VK_NV_inherited_viewport_scissor extension is enabled) for commandBuffer, and done so after any previously bound pipeline with the corresponding state not specified as dynamic (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdDrawIndexedIndirectCount-commandBuffer-02701)

drawindexedindirect is called instead of drawindirect
rust_test_2022.10.09_23..zip

@pwouik
Copy link
Author

pwouik commented Oct 9, 2022

also shouldn't wgpu forward validation errors?

@cwfitzgerald
Copy link
Member

wgpu should call log::error on any backend validation errors.

@cwfitzgerald
Copy link
Member

I don't see anything immediately wrong with our drawindexedindirect call https://github.com/cwfitzgerald/wgpu/blob/9a77471b5a0c281b6982e8787a35813cac5c3504/wgpu-hal/src/vulkan/command.rs#L705

@pwouik
Copy link
Author

pwouik commented Oct 12, 2022

the problem is that I use drawindirectcount and not drawindexedindirectcount
https://github.com/pwouik/rust_voxel_engine/blob/d54bdaf7a1d1585f8d72e97e2f605d8e284234ca/src/chunk_renderer.rs#L585

@teoxoy
Copy link
Member

teoxoy commented Dec 5, 2022

Looking at #2936, nothings seems off. @i509VCB any ideas?

@teoxoy teoxoy added type: bug Something isn't working api: vulkan Issues with Vulkan labels Dec 5, 2022
@i509VCB
Copy link
Contributor

i509VCB commented Dec 5, 2022

@teoxoy
Copy link
Member

teoxoy commented Dec 6, 2022

features.set(
F::MULTI_DRAW_INDIRECT_COUNT,
caps.supports_extension(khr::DrawIndirectCount::name()),
);

Looks like it was (and still is)?

@pwouik
Copy link
Author

pwouik commented Dec 21, 2022

its ash: https://github.com/ash-rs/ash/blob/master/ash/src/extensions/khr/draw_indirect_count.rs#L54

@teoxoy
Copy link
Member

teoxoy commented Dec 21, 2022

@pwouik thanks for the pointer! Opened ash-rs/ash#695.

@pwouik
Copy link
Author

pwouik commented Dec 21, 2022

thanks!

@MarijnS95
Copy link
Contributor

Fix released in Ash 0.37.2: https://github.com/ash-rs/ash/releases/tag/0.37.2

@teoxoy teoxoy mentioned this issue Jan 11, 2023
3 tasks
cwfitzgerald pushed a commit that referenced this issue Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vulkan Issues with Vulkan type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants