FyroxEngine/Fyrox · error

{error}

Error message

{error}

What it means

In Renderer::get_shader (via the cache get call), if the shader fails to compile/link on the GPU, the error is only logged with Log::err and the renderer silently falls back to None (no shader set rendered). This means geometry using that shader will not draw; the cause is reported in the log message.

Solutions

  1. Check the log output above this message for the actual shader compile/load error and fix the shader source
  2. Verify the shader resource path/name passed to the material or ShaderManager resolves to an existing .shader file
  3. Test the shader on the target GPU/driver; remove unsupported features or add fallbacks
  4. Update the engine/assets if the shader format changed between engine versions

Example fix

// before: shader silently absent, object invisible
let material = MaterialResource::new(Material::from_shader(ShaderResource::load_from_memory("invalid glsl")));
// after: pre-validate shader loads before using it in a material
let shader = ShaderResource::load("data/shaders/my.shader")?; // check ResourceState for Err
if matches!(shader.state(), ResourceState::Ok(_)) {
    let material = MaterialResource::new(Material::from_shader(shader));
}
Defensive patterns

Strategy: fallback

Validate before calling

// Check shader resource state before using it in a material
let shader = resource_manager.request::<ShaderResource>(path);
if let ResourceState::Err(e) = shader.state() {
    panic!("Shader failed to load: {:?}", e);
}

Type guard

fn is_shader_loaded(shader: &ShaderResource) -> bool {
    matches!(shader.state(), ResourceState::Ok(_))
}

Prevention

When it happens

Trigger: Calling renderer code that resolves a shader from ShaderManager while the shader resource has a load/compile error: shader file missing or failed to load, GLSL syntax errors, unsupported shader features on the current GPU/driver, or a shader registered under a name that cannot be fetched.

Common situations: Typos in shader file paths, custom material shaders that fail compilation on certain GPUs (e.g. missing precision qualifiers, unsupported extensions), shaders referencing includes that don't exist, or engine version changes that broke old built-in shader sources.

Related errors


AI-assisted analysis of FyroxEngine/Fyrox@76c91aad8e (2026-09-10). Data as JSON: /api/errors/90005c30d92ae6af. Report an issue: GitHub.

Appendix: source

Thrown at fyrox-impl/src/renderer/cache/shader.rs:402

        }
    }

    pub fn get(
        &mut self,
        server: &dyn GraphicsServer,
        shader: &ShaderResource,
    ) -> Option<&RenderPassContainer> {
        let mut shader_state = shader.state();

        if let Some(shader_state) = shader_state.data() {
            match self.cache.get_or_insert_with(
                &shader_state.cache_index,
                Default::default(),
                || RenderPassContainer::new(server, shader_state),
            ) {
                Ok(shader_set) => Some(shader_set),
                Err(error) => {
                    Log::err(format!("{error}"));
                    None
                }
            }
        } else {
            None
        }
    }

    pub fn update(&mut self, dt: f32) {
        self.cache.update(dt)
    }

    pub fn clear(&mut self) {
        self.cache.clear();
    }

    pub fn alive_count(&self) -> usize {
        self.cache.alive_count()

View on GitHub (pinned to 76c91aad8e)