Use ShaderDefVal to avoid redundant code#9408
Conversation
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
|
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
|
You need to update the CPU-side code as well. Replace all instance of: shader_defs.push("MESH_BINDGROUP_1".into());with shader_defs.push(ShaderDefVal::UInt("MESH_BINDGROUP".into(), 1));You'll also need to add shader_defs.push(ShaderDefVal::UInt("MESH_BINDGROUP".into(), 2));to existing pipelines that do not add the Also, could you add a "closes #9256" to your PR description? So that it automatically closes the linked issue when this gets merged. A summary on writing the migration guide lines: |
|
Thank you very much for these details. I have a quick question about the pipelines. Should I add the code for the |
|
I'm not 100%, try only SpecializedMeshPipeline. Run |
|
Can we please have a default of 2 for when the def is not specified. It used to be necessary to specify for every pipeline and it was very annoying, I would prefer not to go back to that situation again. |
|
Ooops my bad, my instructions mentioned a default of |
|
So how would we setup a default? Maybe passing the |
Only on |
I was thinking the shader could branch on #ifdef as it does currently (I didn’t look at the code yet though) |
|
MESH_BIND_GROUP_1 was removed #10485 |
Objective
The purpose of this pull request is to complete this issue (closes #9256)
Migration guide
The
MESH_BINDGROUP_1shader def has been replaced by theMESH_BINDGROUPShaderDefVal.If in your shader you previously used:
You can now write it:
Other important change: You should now add the
MESH_BINDGROUPdefine even if the binding group is 0.Add this line to your shader specialization pipeline: