This commit is contained in:
Charlotte McElwain 2025-07-11 10:33:12 -07:00
parent a0121e004e
commit e74b5be45d
2 changed files with 14 additions and 22 deletions

View File

@ -459,19 +459,15 @@ impl SpecializedMeshPipeline for MaterialPipelineSpecializer {
.pipeline
.mesh_pipeline
.specialize(key.mesh_key, layout)?;
descriptor.vertex.shader_defs.push(
ShaderDefVal::UInt(
descriptor.vertex.shader_defs.push(ShaderDefVal::UInt(
"MATERIAL_BIND_GROUP".into(),
MATERIAL_BIND_GROUP_INDEX as u32,
));
if let Some(ref mut fragment) = descriptor.fragment {
fragment.shader_defs.push(ShaderDefVal::UInt(
"MATERIAL_BIND_GROUP".into(),
MATERIAL_BIND_GROUP_INDEX as u32,
)
);
if let Some(ref mut fragment) = descriptor.fragment {
fragment.shader_defs.push(
ShaderDefVal::UInt(
"MATERIAL_BIND_GROUP".into(),
MATERIAL_BIND_GROUP_INDEX as u32,
)
);
));
};
if let Some(vertex_shader) = self.properties.get_shader(MaterialVertexShader) {
descriptor.vertex.shader = vertex_shader.clone();

View File

@ -451,19 +451,15 @@ where
layout: &MeshVertexBufferLayoutRef,
) -> Result<RenderPipelineDescriptor, SpecializedMeshPipelineError> {
let mut descriptor = self.mesh2d_pipeline.specialize(key.mesh_key, layout)?;
descriptor.vertex.shader_defs.push(
ShaderDefVal::UInt(
descriptor.vertex.shader_defs.push(ShaderDefVal::UInt(
"MATERIAL_BIND_GROUP".into(),
MATERIAL_2D_BIND_GROUP_INDEX as u32,
));
if let Some(ref mut fragment) = descriptor.fragment {
fragment.shader_defs.push(ShaderDefVal::UInt(
"MATERIAL_BIND_GROUP".into(),
MATERIAL_2D_BIND_GROUP_INDEX as u32,
)
);
if let Some(ref mut fragment) = descriptor.fragment {
fragment.shader_defs.push(
ShaderDefVal::UInt(
"MATERIAL_BIND_GROUP".into(),
MATERIAL_2D_BIND_GROUP_INDEX as u32,
)
);
));
}
if let Some(vertex_shader) = &self.vertex_shader {
descriptor.vertex.shader = vertex_shader.clone();