eliemichel / LearnWebGPU-Code

The accompanying code of the Learn WebGPU C++ programming guide
https://eliemichel.github.io/LearnWebGPU
MIT License
114 stars 30 forks source link

Step 032 'Unable to end render pass: RenderPassError' 'VertexBeyondLimit' #21

Closed TheFloatingBrain closed 1 year ago

TheFloatingBrain commented 1 year ago

Hello, thanks for all the work you have put into this project its really great!

I have an error I was not able to find anywhere else and I spent a few hours debugging but have not been able to figure out thus far.

I have a feeling something may be wrong with my device since I have 0 features on it? I think request device error reporting is working, but nothing seems to be reported.

When I try to use a vertex attribute I get this error log message:

Device Features {0}:
Swap Chain: <wgpu::SwapChain 000001B39C7BE0A0>
Shader Module <wgpu::ShaderModule 000001B39C7BE480>
thread '<unnamed>' panicked at 'Unable to end render pass: RenderPassError { scope: Draw { indexed: false, indirect: false, pipeline: Some((0, 1, Vulkan)) }, inner: Draw(VertexBeyondLimit { last_vertex: 3, vertex_limit: 0, slot: 0 }) }', src\command.rs:338:10

It looks like it thinks that the limit to the number of vertices I can put in is 0. I checked the RequiredLimits I passed in and confirmed and the closest thing is maxBufferSize which is not zero.

Any thoughts?

Thank you - TFB

TheFloatingBrain commented 1 year ago

Okay, so turns out my issue was that I set maxVertexBufferArrayStride to the wrong value (value of the size of the whole buffer instead of the stride).

I figured this out by copy/pasting step 032 then slowly replacing it with my code until it broke