{"record":{"id":"50496294d351e641","repo":"gfx-rs/wgpu","slug":"could-not-find-color-uniform-in-shader-clear-shade","errorCode":null,"errorMessage":"Could not find color uniform in shader clear shader","messagePattern":"Could not find color uniform in shader clear shader","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu-hal/src/gles/adapter.rs","lineNumber":1071,"sourceCode":"                glow::FRAGMENT_SHADER,\n                es,\n            )?\n        };\n        unsafe { gl.attach_shader(program, vertex) };\n        unsafe { gl.attach_shader(program, fragment) };\n        unsafe { gl.link_program(program) };\n\n        let linked_ok = unsafe { gl.get_program_link_status(program) };\n        let msg = unsafe { gl.get_program_info_log(program) };\n        if !msg.is_empty() {\n            log::error!(\"Shader link error: {msg}\");\n        }\n        if !linked_ok {\n            return None;\n        }\n\n        let color_uniform_location = unsafe { gl.get_uniform_location(program, \"color\") }\n            .expect(\"Could not find color uniform in shader clear shader\");\n        unsafe { gl.delete_shader(vertex) };\n        unsafe { gl.delete_shader(fragment) };\n\n        Some(ShaderClearProgram {\n            program,\n            color_uniform_location,\n        })\n    }\n}\n\nimpl crate::Adapter for super::Adapter {\n    type A = super::Api;\n\n    unsafe fn open(\n        &self,\n        features: wgt::Features,\n        _limits: &wgt::Limits,\n        _memory_hints: &wgt::MemoryHints,","sourceCodeStart":1053,"sourceCodeEnd":1089,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu-hal/src/gles/adapter.rs#L1053-L1089","documentation":"Panic in the GLES adapter's shader-clear program setup: after linking the internal clear shader, the 'color' uniform location could not be found, so the clear helper cannot be driven. This indicates the internal shader linked abnormally or the context is degraded.","triggerScenarios":"Thrown at wgpu-hal/src/gles/adapter.rs:1071 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report as a wgpu/driver bug with GL driver details","Retry with a fresh context; treat clear operations as unusable on this driver"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}