In the generated rust bindings, there's a generated VERTEX_ATTRIBUTES and vertex_buffer_layout for VertexInput, but not for InstanceInput. Also, their _vertex_shader_entrys are the same, even though dummy_instanced_vertex_shader should have 2 inputs instead of one:
If I move dummy_instanced_vertex_shader to be before dummy_vertex_shader in that file, I then get a VERTEX_ATTRIBUTES and vertex_buffer_layout for both VertexInput and InstanceInput. However, now dummy_vertex_shader_entry is incorrect:
I have a file with multiple vertex shaders, like this:
In the generated rust bindings, there's a generated
VERTEX_ATTRIBUTES
andvertex_buffer_layout
forVertexInput
, but not forInstanceInput
. Also, their_vertex_shader_entry
s are the same, even thoughdummy_instanced_vertex_shader
should have 2 inputs instead of one:If I move
dummy_instanced_vertex_shader
to be beforedummy_vertex_shader
in that file, I then get aVERTEX_ATTRIBUTES
andvertex_buffer_layout
for bothVertexInput
andInstanceInput
. However, nowdummy_vertex_shader_entry
is incorrect:So it seems like
wgsl_bindgen
assumes that every vertex shader in a file shares the same input as the first vertex shader.