{"record":{"id":"67f3b0aa7d693fe3","repo":"remotion-dev/remotion","slug":"failed-to-create-lut-vertex-buffer","errorCode":null,"errorMessage":"Failed to create LUT vertex buffer","messagePattern":"Failed to create LUT vertex buffer","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/effects/src/lut/lut-runtime.ts","lineNumber":123,"sourceCode":"\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('LUT effect');\n\t}\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\n\tconst program = createProgram(gl);\n\tconst vao = gl.createVertexArray();\n\tif (!vao) {\n\t\tthrow new Error('Failed to create LUT vertex array');\n\t}\n\n\tconst vbo = gl.createBuffer();\n\tif (!vbo) {\n\t\tthrow new Error('Failed to create LUT vertex buffer');\n\t}\n\n\tgl.bindVertexArray(vao);\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(\n\t\tgl.ARRAY_BUFFER,\n\t\tnew Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1]),\n\t\tgl.STATIC_DRAW,\n\t);\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\treturn {\n\t\tgl,\n\t\tprogram,","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/effects/src/lut/lut-runtime.ts#L105-L141","documentation":"setupLut() calls gl.createBuffer() to allocate the VBO holding the fullscreen-quad vertex positions. A null return means the context could not allocate a buffer object, and this Error is thrown. This typically accompanies general WebGL context failure rather than a LUT-specific problem.","triggerScenarios":"setupLut runs on a lost WebGL2 context; GPU memory/object limits are exhausted; a mocked GL object returns null from createBuffer.","commonSituations":"GPU resets during long renders; memory pressure on mobile; many concurrent effects leaking GL buffers; headless browsers without a functioning GL backend.","solutions":["Reinitialize the effect after 'webglcontextrestored' fires","Check gl.isContextLost() and recreate the context if true","Audit for GL buffer leaks (buffers not deleted when effects unmount)","Retry in a fresh browser context / after reducing GPU memory pressure"],"exampleFix":"// before: unbounded effect creation leaking buffers\neffects.forEach((e) => setupLut(e));\n// after: cleanup old state before re-creating\nif (state) cleanupLut(state);\nstate = setupLut({ gl, width, height, lutContent });","handlingStrategy":"try-catch","validationCode":"if (gl.isContextLost()) {\n  throw new Error('WebGL context lost; cannot create LUT buffer');\n}","typeGuard":null,"tryCatchPattern":"try {\n  state = setupLut({ gl, width, height, lutContent });\n} catch (e) {\n  if (e.message === 'Failed to create LUT vertex buffer') {\n    // cleanup old GL state, recreate context or skip the effect\n  }\n}","preventionTips":["Delete old buffers/VAOs when re-creating effects to avoid resource exhaustion","Guard renders with gl.isContextLost() checks","Recover via 'webglcontextrestored' rather than retrying on the dead context","Watch GPU memory on mobile devices"],"tags":["webgl","buffer","context-lost","lut"],"backgroundTag":"module-init-failed","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}