{"record":{"id":"c6838a63edac5c38","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-framebuffer","errorCode":null,"errorMessage":"Failed to create WebGL framebuffer","messagePattern":"Failed to create WebGL framebuffer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/blur/blur-runtime.ts","lineNumber":157,"sourceCode":"\t\tthrow new Error('Failed to create WebGL buffer');\n\t}\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n\n\tgl.enableVertexAttribArray(0);\n\tgl.vertexAttribPointer(0, 2, gl.FLOAT, false, 16, 0);\n\tgl.enableVertexAttribArray(1);\n\tgl.vertexAttribPointer(1, 2, gl.FLOAT, false, 16, 8);\n\n\tgl.bindVertexArray(null);\n\n\tconst textureSource = createRgbaTexture(gl);\n\tconst textureIntermediate = createRgbaTexture(gl);\n\n\tconst framebuffer = gl.createFramebuffer();\n\tif (!framebuffer) {\n\t\tthrow new Error('Failed to create WebGL framebuffer');\n\t}\n\n\tconst w = Math.max(1, target.width);\n\tconst h = Math.max(1, target.height);\n\tgl.bindTexture(gl.TEXTURE_2D, textureIntermediate);\n\tgl.texImage2D(\n\t\tgl.TEXTURE_2D,\n\t\t0,\n\t\tgl.RGBA,\n\t\tw,\n\t\th,\n\t\t0,\n\t\tgl.RGBA,\n\t\tgl.UNSIGNED_BYTE,\n\t\tnull,\n\t);\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/blur/blur-runtime.ts#L139-L175","documentation":"Thrown by `setupBlur` when `gl.createFramebuffer()` returns `null`. The framebuffer is the render target for the horizontal blur pass (blur renders source -> intermediate texture via FBO, then intermediate -> canvas). A null handle is a resource-allocation/context-loss failure.","triggerScenarios":"Fires at line 155-157, after both textures are created, when `gl.createFramebuffer()` returns null.","commonSituations":"Context loss during setup; framebuffer-object cap reached by many live blur effects; software renderer with low FBO limits; the GL implementation does not expose the framebuffer capability.","solutions":["Guard with `gl.isContextLost()`; reinitialize on restoration.","Free unused blur states via `cleanupBlur` (deletes the framebuffer).","Reduce concurrent blur effects.","Confirm hardware-accelerated WebGL2; update drivers."],"exampleFix":"if (gl.isContextLost()) {\n  // reinitialize after restore\n} else {\n  const state = setupBlur(canvas);\n}","handlingStrategy":"try-catch","validationCode":"if (gl.isContextLost()) { /* skip setupBlur */ }","typeGuard":null,"tryCatchPattern":"try {\n  const state = setupBlur(canvas);\n} catch (err) {\n  if (/Failed to create WebGL framebuffer/.test(err.message)) {\n    // await restore or reduce effects, then retry\n  } else { throw err; }\n}","preventionTips":["Release the framebuffer via cleanupBlur on unused states.","Handle context-loss events.","Cap concurrent blur effects (each holds one FBO)."],"tags":["webgl2","framebuffer","fbo","blur","gpu-memory","context-loss"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}