{"record":{"id":"61c49d952df47870","repo":"siyuan-note/siyuan","slug":"webgl2-is-unavailable","errorCode":null,"errorMessage":"WebGL2 is unavailable","messagePattern":"WebGL2 is unavailable","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/src/layout/dock/graph/webglRenderer.ts","lineNumber":223,"sourceCode":"    private highlightLine = new Float32Array([0, 0, 0, 1]);\n    private highlightPoint = new Float32Array([0, 0, 0, 1]);\n    private nodeColors = new Float32Array();\n    private nodeStates = new Float32Array();\n    private positionVersion = -1;\n    private selectionVersion = -1;\n    private styleVersion = -1;\n\n    constructor(canvas: HTMLCanvasElement) {\n        const gl = canvas.getContext(\"webgl2\", {\n            alpha: true,\n            antialias: true,\n            depth: false,\n            premultipliedAlpha: true,\n            preserveDrawingBuffer: false,\n            stencil: false,\n        });\n        if (!gl) {\n            throw new Error(\"WebGL2 is unavailable\");\n        }\n        this.canvas = canvas;\n        this.gl = gl;\n        this.nodeProgram = this.createProgram(NODE_VERTEX_SHADER, NODE_FRAGMENT_SHADER);\n        this.edgeProgram = this.createProgram(EDGE_VERTEX_SHADER, EDGE_FRAGMENT_SHADER);\n        this.arrowProgram = this.createProgram(ARROW_VERTEX_SHADER, ARROW_FRAGMENT_SHADER);\n        this.nodeVao = this.requireValue(gl.createVertexArray());\n        this.edgeVao = this.requireValue(gl.createVertexArray());\n        this.arrowVao = this.requireValue(gl.createVertexArray());\n        this.nodePositionBuffer = this.createBuffer();\n        this.nodeSizeBuffer = this.createBuffer();\n        this.nodeColorBuffer = this.createBuffer();\n        this.nodeStateBuffer = this.createBuffer();\n        this.edgeEndpointBuffer = this.createBuffer();\n        this.edgeColorBuffer = this.createBuffer();\n        this.edgeStateBuffer = this.createBuffer();\n        this.edgeReferenceBuffer = this.createBuffer();\n        this.edgeTargetSizeBuffer = this.createBuffer();","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/app/src/layout/dock/graph/webglRenderer.ts#L205-L241","documentation":"GraphWebGLRenderer constructor guard: canvas.getContext(\"webgl2\", ...) returned null, meaning the browser or GPU driver cannot provide a WebGL2 context for the graph. The primary hardware-accelerated graph renderer cannot start.","triggerScenarios":"Thrown at app/src/layout/dock/graph/webglRenderer.ts:223 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable hardware acceleration in the browser/Electron settings","Update GPU drivers or switch browsers to regain WebGL2 support","Fall back to the canvas 2D graph renderer when WebGL2 is unavailable"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}