siyuan-note/siyuan · error · Error

Unable to compile graph shader

Error message

Unable to compile graph shader

What it means

GraphWebGLRenderer.createShader reports that gl.compileShader failed the COMPILE_STATUS check for a graph vertex or fragment shader. The shader source was rejected by the driver (syntax error, unsupported construct, or driver bug); the info-log message is preferred and this text is the fallback. Called from createProgram during construction.

Solutions

  1. Read the shader info log to find the failing line
  2. Verify shader source strings are not corrupted or truncated
  3. Test on another GPU/driver to identify driver-specific compile bugs
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/src/layout/dock/graph/webglRenderer.ts:523 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/5c27e652c88e8dca. Report an issue: GitHub.

Appendix: source

Thrown at app/src/layout/dock/graph/webglRenderer.ts:523

        gl.deleteShader(vertex);
        gl.deleteShader(fragment);
        if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
            const message = gl.getProgramInfoLog(program) || "Unable to link graph shader";
            gl.deleteProgram(program);
            throw new Error(message);
        }
        return program;
    }

    private createShader(type: number, source: string) {
        const gl = this.gl;
        const shader = this.requireValue(gl.createShader(type));
        gl.shaderSource(shader, source);
        gl.compileShader(shader);
        if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
            const message = gl.getShaderInfoLog(shader) || "Unable to compile graph shader";
            gl.deleteShader(shader);
            throw new Error(message);
        }
        return shader;
    }

    private getUniform(program: WebGLProgram, name: string) {
        return this.requireValue(this.gl.getUniformLocation(program, name));
    }

    private requireValue<T>(value: T | null): T {
        if (value === null) {
            throw new Error("Unable to allocate graph rendering resource");
        }
        return value;
    }
}

View on GitHub (pinned to 8641553a1f)