Phase 4a — full-control material compile. Games that want a translucent / refractive / additive material (or a non-default bucket) call this directly. Plain `compile_material` is a convenience for Opaque + no scene reads. `wants_instancing` adds a per-instance vertex buffer layout at slot 1 (EN-001). Materials compiled with it must be drawn via `submit_material_draw_instanced` + a buffer from `cr
(
&mut self, wgsl_source: &str,
profile: material_pipeline::FragmentProfile,
bucket: material_pipeline::Bucket,
reads_scene: bool,
wants
| 13157 | /// `submit_material_draw_instanced` + a buffer from |
| 13158 | /// `create_instance_buffer`. |
| 13159 | pub fn compile_material_with_options( |
| 13160 | &mut self, wgsl_source: &str, |
| 13161 | profile: material_pipeline::FragmentProfile, |
| 13162 | bucket: material_pipeline::Bucket, |
| 13163 | reads_scene: bool, |
| 13164 | wants_instancing: bool, |
| 13165 | ) -> Result<material_system::MaterialHandle, material_pipeline::MaterialCompileError> { |
| 13166 | self.material_system.compile( |
| 13167 | &self.device, |
| 13168 | wgsl_source, |
| 13169 | profile, |
| 13170 | bucket, |
| 13171 | reads_scene, |
| 13172 | wants_instancing, |
| 13173 | formats::HDR_FORMAT, |
| 13174 | formats::MATERIAL_FORMAT, |
| 13175 | formats::VELOCITY_FORMAT, |
| 13176 | wgpu::TextureFormat::Rgba8Unorm, |
| 13177 | formats::DEPTH_FORMAT, |
| 13178 | ) |
| 13179 | } |
| 13180 | |
| 13181 | /// EN-001 — compile a material that opts into the standard per-instance |
| 13182 | /// vertex layout (Opaque profile + Opaque bucket + wants_instancing). |
no test coverage detected