MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / set_shader_source

Function set_shader_source

src/renderer.rs:557–559  ·  view source on GitHub ↗

Update a named shader source in the global shader storage. When the source changes, the previously compiled material is evicted and will be recompiled on the next render pass. No-ops if unchanged. Use with [`ShaderAsset::Stored`](crate::shaders::ShaderAsset::Stored) to reference the stored source by name. # Example ```rust,ignore set_shader_source("live_shader", &editor.text); const LIVE: Shad

(name: &str, fragment: &str)

Source from the content-addressed store, hash-verified

555/// .build();
556/// ```
557pub fn set_shader_source(name: &str, fragment: &str) {
558 MATERIAL_MANAGER.lock().unwrap().set_source(name, fragment);
559}
560
561/// Apply shader uniforms to a material, including auto-uniforms.
562fn apply_shader_uniforms(material: &Material, config: &ShaderConfig, bb: &BoundingBox) {

Callers

nothing calls this directly

Calls 1

set_sourceMethod · 0.80

Tested by

no test coverage detected