Replace MESH_BINDGROUP_1
with a ShaderDefVal
#9256
Labels
A-Rendering
Drawing game state to the screen
C-Code-Quality
A section of code that is hard to understand or change
D-Trivial
Nice and easy! A great choice to get started with Bevy
Using
MESH_BINDGROUP_1
as a define results duplicate code. And sometimes nested#ifdef
in bevy shader code.Duplicate code has been a source of programming bumps when developing rendering features. We should aim to reduce it.
What solution would you like?
Use a
ShaderDefVal
instead of a define forMESH_BINDGROUP
.The previous code would become:
@group(#{MESH_BINDGROUP}) @binding(0) var<storage> mesh: array<Mesh>;
The text was updated successfully, but these errors were encountered: