{"record":{"id":"dd315805993da290","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-dd3158","errorCode":null,"errorMessage":"Failed to create WebGL vertex array","messagePattern":"Failed to create WebGL vertex array","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/progressive-pixelate-runtime.ts","lineNumber":188,"sourceCode":"\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('progressive pixelate effect');\n\t}\n\n\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);","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/progressive-pixelate-runtime.ts#L170-L206","documentation":"Thrown by setupProgressivePixelate when gl.createVertexArray() returns null after program link. Same VAO allocation-failure pattern as pixelate, specific to progressive-pixelate setup.","triggerScenarios":"setupProgressivePixelate: program linked, then gl.createVertexArray() returns null.","commonSituations":"Context lost between program link and VAO creation; VAO pool exhausted; SwiftShader under load; integrated GPU with low VAO cap.","solutions":["Check `gl.isContextLost()` and remount on restore.","Reduce concurrent WebGL2 effects.","Increase Lambda function memory.","Reproduce on stable desktop Chrome.","Free other GPU resources before applying the effect."],"exampleFix":"// before\nsetupProgressivePixelate(canvas);\n\n// after — probe VAO allocation\nfunction glCanCreateVao(gl: WebGL2RenderingContext): boolean {\n  if (gl.isContextLost()) return false;\n  const v = gl.createVertexArray();\n  if (v) gl.deleteVertexArray(v);\n  return v !== null;\n}","handlingStrategy":"try-catch","validationCode":"function glCanCreateVao(gl: WebGL2RenderingContext): boolean {\n  if (gl.isContextLost()) return false;\n  const v = gl.createVertexArray();\n  if (v) gl.deleteVertexArray(v);\n  return v !== null;\n}","typeGuard":null,"tryCatchPattern":"try {\n  setupProgressivePixelate(canvas);\n} catch (err) {\n  if (/Failed to create WebGL vertex array/.test((err as Error).message)) {\n    // remount after context restore\n  }\n  throw err;\n}","preventionTips":["Probe VAO allocation in the target environment before mounting.","Handle context loss and remount on restore.","Limit concurrent WebGL2 effects in one composition.","Use adequate Lambda function memory."],"tags":["webgl","gpu","progressive-pixelate","vao","environment"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}