{"record":{"id":"12d7b3dfc9f47f55","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-buffer-12d7b3","errorCode":null,"errorMessage":"Failed to create WebGL buffer","messagePattern":"Failed to create WebGL buffer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/progressive-pixelate-runtime.ts","lineNumber":197,"sourceCode":"\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\tconst vs = compileShader(gl, gl.VERTEX_SHADER, VERTEX_SHADER);\n\tconst fs = compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);\n\tconst program = linkProgram(gl, vs, fs);\n\tgl.deleteShader(vs);\n\tgl.deleteShader(fs);\n\n\tconst vao = gl.createVertexArray();\n\tif (!vao) {\n\t\tthrow new Error('Failed to create WebGL vertex array');\n\t}\n\n\tgl.bindVertexArray(vao);\n\tconst data = new Float32Array([\n\t\t-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,\n\t]);\n\tconst vbo = gl.createBuffer();\n\tif (!vbo) {\n\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\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\tgl.bindVertexArray(null);\n\n\tconst texture = gl.createTexture();\n\tif (!texture) {\n\t\tthrow new Error('Failed to create WebGL texture');\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, texture);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/progressive-pixelate-runtime.ts#L179-L215","documentation":"Thrown by setupProgressivePixelate when gl.createBuffer() returns null after the VAO was created and bound. The null-check aborts before bindBuffer/bufferData would silently no-op.","triggerScenarios":"setupProgressivePixelate: VAO succeeded, then gl.createBuffer() returns null.","commonSituations":"GPU memory pressure; context loss mid-setup; SwiftShader under load; many effects holding buffers.","solutions":["Check `gl.isContextLost()` and remount on restore.","Reduce concurrent WebGL2 effects and free unused assets.","Increase Lambda function memory.","Render at a lower resolution.","Reproduce locally to isolate environment."],"exampleFix":"// before\nsetupProgressivePixelate(canvas);\n\n// after — probe buffer allocation\nfunction glCanCreateBuffer(gl: WebGL2RenderingContext): boolean {\n  if (gl.isContextLost()) return false;\n  const b = gl.createBuffer();\n  if (b) gl.deleteBuffer(b);\n  return b !== null;\n}","handlingStrategy":"try-catch","validationCode":"function glCanCreateBuffer(gl: WebGL2RenderingContext): boolean {\n  if (gl.isContextLost()) return false;\n  const b = gl.createBuffer();\n  if (b) gl.deleteBuffer(b);\n  return b !== null;\n}","typeGuard":null,"tryCatchPattern":"try {\n  setupProgressivePixelate(canvas);\n} catch (err) {\n  if (/Failed to create WebGL buffer/.test((err as Error).message)) {\n    // reduce GPU load, free assets, retry\n  }\n  throw err;\n}","preventionTips":["Free unused source assets before applying effects.","Keep concurrent WebGL2 effects low.","Render at lower resolution to reduce buffer traffic.","Monitor gl.isContextLost() each pass."],"tags":["webgl","gpu","progressive-pixelate","buffer","memory","environment"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}