{"record":{"id":"bdc2499495434352","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-texture-bdc249","errorCode":null,"errorMessage":"Failed to create WebGL texture","messagePattern":"Failed to create WebGL texture","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/dot-grid.ts","lineNumber":251,"sourceCode":"\t\tif (!vbo) {\n\t\t\tthrow new Error('Failed to create WebGL buffer');\n\t\t}\n\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n\n\t\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\t\tconst aUv = gl.getAttribLocation(program, 'aUv');\n\t\tgl.enableVertexAttribArray(aPos);\n\t\tgl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);\n\t\tgl.enableVertexAttribArray(aUv);\n\t\tgl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);\n\n\t\tgl.bindVertexArray(null);\n\n\t\tconst texture = gl.createTexture();\n\t\tif (!texture) {\n\t\t\tthrow new Error('Failed to create WebGL texture');\n\t\t}\n\n\t\tgl.bindTexture(gl.TEXTURE_2D, texture);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\t\tgl.bindTexture(gl.TEXTURE_2D, null);\n\n\t\treturn {\n\t\t\tgl,\n\t\t\tprogram,\n\t\t\tvao,\n\t\t\tvbo,\n\t\t\ttexture,\n\t\t\tuSource: gl.getUniformLocation(program, 'uSource'),\n\t\t\tuResolution: gl.getUniformLocation(program, 'uResolution'),\n\t\t\tuDotSize: gl.getUniformLocation(program, 'uDotSize'),","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/dot-grid.ts#L233-L269","documentation":"Thrown by dot-grid's setup() when gl.createTexture() returns null. A null texture indicates a lost or resource-exhausted WebGL2 context. Reached after the VAO/VBO are built, while allocating the source texture that will receive each frame's image.","triggerScenarios":"Lost WebGL2 context, exceeded texture object limit, or GPU memory exhaustion. Triggered in dotGrid().setup() during texture allocation.","commonSituations":"Texture leaks from effects whose cleanup was skipped; rendering very large frames on low-memory GPUs; many effects mounted at once; headless rendering under memory pressure; GPU reset.","solutions":["Confirm cleanup runs so gl.deleteTexture reclaims the texture on unmount.","Lower the number of simultaneous WebGL2 effects or reduce composition resolution.","Reload the page to free leaked textures.","For headless/CI, use SwiftShader with sufficient memory and avoid excessive concurrency.","Update GPU drivers."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const supportsWebGL2 = () => {\n  try {\n    return !!document.createElement('canvas').getContext('webgl2');\n  } catch {\n    return false;\n  }\n};","typeGuard":null,"tryCatchPattern":"try {\n  state = dotGrid().setup(canvas);\n} catch (err) {\n  if (err instanceof Error && /WebGL texture/i.test(err.message)) {\n    console.error('Texture allocation failed:', err.message);\n    // fall back to a non-WebGL layer\n  } else {\n    throw err;\n  }\n}","preventionTips":["Confirm cleanup runs (gl.deleteTexture) on unmount to avoid texture leaks.","Reduce composition resolution or simultaneous effect count on low-memory GPUs.","Reload to reclaim leaked textures; use SwiftShader with adequate memory for headless runs."],"tags":["webgl2","dot-grid","texture","gpu","runtime","memory"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}