{"record":{"id":"b1c10bd7114bf1fc","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-buffer-b1c10b","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/corner-pin/corner-pin-runtime.ts","lineNumber":120,"sourceCode":"\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl, CORNER_PIN_VS, CORNER_PIN_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\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\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\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\n\treturn {\n\t\tgl,\n\t\tprogram,\n\t\tvao,","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/corner-pin/corner-pin-runtime.ts#L102-L138","documentation":"Thrown in setupCornerPin when gl.createBuffer() returns null. The WebGL2 context was acquired but could not allocate a buffer object for the fullscreen-quad vertex data. This is a GPU resource exhaustion or context-loss issue, not a user parameter problem.","triggerScenarios":"During corner-pin effect initialization, after VAO creation, gl.createBuffer() returns null when allocating the vertex buffer.","commonSituations":"GPU resource exhaustion from many simultaneous effects; context lost between VAO and buffer creation; constrained software WebGL in headless/CI/VM environments.","solutions":["Reduce the number of simultaneously active WebGL effects.","Check gl.isContextLost() before and during setup.","Use a rendering environment with adequate GPU resources.","Implement webglcontextlost handling to reinitialize."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify WebGL2 context health before corner pin setup\nconst gl = target.getContext('webgl2');\nif (gl?.isContextLost()) {\n  // defer or skip\n}","typeGuard":null,"tryCatchPattern":"try {\n  cornerPin({...})(source, target);\n} catch (e) {\n  if (e instanceof Error && e.message === 'Failed to create WebGL buffer') {\n    // GPU resource issue — reduce concurrent effects\n  }\n  throw e;\n}","preventionTips":["Reduce the number of simultaneously active WebGL effects.","Check gl.isContextLost() during setup.","Use a rendering environment with adequate GPU resources.","Handle webglcontextlost to reinitialize."],"tags":["webgl","effects","corner-pin","gpu","resource-exhaustion","buffer"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}