Non-strip Primitive Topologies Specify an Invalid Index State
Twinklebear opened this issue · 3 comments
When a None
wgpu::PrimitiveState::strip_index_format
is specified to render non-strip primitives, wgpu-rs will change the strip_index_format
to a default of uint16
here: https://github.com/gfx-rs/wgpu-rs/blob/master/src/backend/web.rs#L729-L733 , creating an invalid primitive state. I noticed this on Chrome Canary, where an error is thrown for this configuration, but in the spec about render, it mentions in item 3 that if stripIndexFormat
is not null the primitive topology must be a strip. The fix will likely need a change in web_sys
to add a none index format, since web_sys
doesn't have a none GpuIndexFormat
.
Thanks for reporting the issue!
The WebIDL has changed shape a bit recently, so Chrome and Firefox don’t fully align at the moment. After the WebIDL has been updated in Gecko, I’ll update the bindings in web_sys. I’ll also fix the web backend once a new version of web_sys has been released.
Are you able to run web builds in Firefox Nightly in the meantime?
No worries! Yes this does work in Firefox Nightly when passing None
as the index format and using a TriangleList
primitive topology, I'm not sure at some point FF Nightly will start flagging this config as an error as well, but it does run at the moment (it also works on native).
Closing due to wgpu-rs -> wgpu migration and due to this being old. Please refile if this is still an issue.