{"record":{"id":"f369a44af9b47a78","repo":"remotion-dev/remotion","slug":"failed-to-create-levels-vertex-buffer","errorCode":null,"errorMessage":"Failed to create levels vertex buffer","messagePattern":"Failed to create levels vertex buffer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/levels.ts","lineNumber":233,"sourceCode":"\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('levels 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 levels vertex array');\n\t}\n\n\tconst vbo = gl.createBuffer();\n\tif (!vbo) {\n\t\tthrow new Error('Failed to create levels 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\n\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');\n\tgl.enableVertexAttribArray(aPos);\n\tgl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);\n\tgl.enableVertexAttribArray(aUv);\n\tgl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);\n\tgl.bindVertexArray(null);\n","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/levels.ts#L215-L251","documentation":"Thrown by `setupLevels()` when `gl.createBuffer()` returns `null`. The vertex buffer (holding the fullscreen-quad UV/position data) could not be allocated, meaning the context is lost or GPU buffer memory/object slots are exhausted.","triggerScenarios":"Context loss before buffer creation; many concurrent buffer allocations; VRAM exhaustion.","commonSituations":"Highly concurrent or long-running renders leaking GL buffers; memory-constrained CI/Lambda; backgrounded tabs with lost contexts.","solutions":["Reduce concurrency and dispose unused GL buffers.","Handle context loss and recreate the effect.","Restart the GPU/Chrome process to reclaim leaked buffer objects.","Use a render environment with adequate video memory."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  levels({...})(...);\n} catch (err) {\n  if (/Failed to create levels vertex buffer/.test(String(err))) {\n    console.warn('levels() VBO unavailable', err);\n  } else {\n    throw err;\n  }\n}","preventionTips":["Dispose GL buffers between renders to prevent leaks.","Reduce concurrency on memory-constrained renderers.","Handle context-loss events before retrying."],"tags":["levels","webgl2","gpu","vbo","context-loss","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}