{"record":{"id":"aa41fb8ca96071c4","repo":"remotion-dev/remotion","slug":"pattern-shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Pattern shader compile failed: ${log ?? '(no log)'}","messagePattern":"Pattern shader compile failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/pattern.ts","lineNumber":410,"sourceCode":"}\n`;\n\nconst compileShader = (\n\tgl: WebGL2RenderingContext,\n\ttype: number,\n\tsource: string,\n): WebGLShader => {\n\tconst shader = gl.createShader(type);\n\tif (!shader) {\n\t\tthrow new Error('Failed to create WebGL shader');\n\t}\n\n\tgl.shaderSource(shader, source);\n\tgl.compileShader(shader);\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\tconst log = gl.getShaderInfoLog(shader);\n\t\tgl.deleteShader(shader);\n\t\tthrow new Error(`Pattern shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst linkProgram = (\n\tgl: WebGL2RenderingContext,\n\tvs: WebGLShader,\n\tfs: WebGLShader,\n): WebGLProgram => {\n\tconst program = gl.createProgram();\n\tif (!program) {\n\t\tthrow new Error('Failed to create WebGL program');\n\t}\n\n\tgl.attachShader(program, vs);\n\tgl.attachShader(program, fs);\n\tgl.linkProgram(program);","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/pattern.ts#L392-L428","documentation":"After pattern()'s GLSL shader source is submitted and compiled, the driver reports COMPILE_STATUS=false. Because the shader is authored in the library, a real compile failure points to a driver/GPU incompatibility (unsupported GLSL syntax/precision) or a context that is failing operations spuriously due to loss. The info log is interpolated so the driver's diagnostic is visible.","triggerScenarios":"compileShader() calls gl.getShaderParameter(shader, COMPILE_STATUS) which returns false; gl.getShaderInfoLog yields the driver error. Occurs during pattern effect setup on every frame that instantiates it.","commonSituations":"GPU/driver that does not support the GLSL ES 3.00 features the shader uses; corrupted/lost context causing compile to fail; very old mobile GPU drivers; virtualized render environments without real GPU support.","solutions":["Render on a GPU/browser combo with full WebGL2 + GLSL ES 3.00 support (modern Chromium).","In CI/headless, use SwiftShader or a real GPU passthrough rather than a stub GL.","Update GPU drivers.","Report the interpolated info log to the Remotion team if it reproduces on a current Chromium build."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Probe shader compilation capability on this GPU once at startup.\nfunction canCompilePatternShader(gl: WebGL2RenderingContext): boolean {\n  const s = gl.createShader(gl.FRAGMENT_SHADER);\n  if (!s) return false;\n  gl.shaderSource(s, PATTERN_FS);\n  gl.compileShader(s);\n  const ok = gl.getShaderParameter(s, gl.COMPILE_STATUS);\n  gl.deleteShader(s);\n  return Boolean(ok);\n}","typeGuard":null,"tryCatchPattern":"try {\n  initPattern(canvas);\n} catch (err) {\n  if (String(err.message).startsWith('Pattern shader compile failed')) {\n    logShaderIssue(err.message); // report driver incompatibility\n    useNonGpuFallback();\n  } else throw err;\n}","preventionTips":["Render on current Chromium with full WebGL2/GLSL ES 3.00 support.","Use SwiftShader or real GPU passthrough in CI rather than a stub GL.","Update GPU drivers on render machines.","Capture and report the driver info log when this reproduces on supposedly-supported hardware."],"tags":["webgl","gpu","shader","compile","pattern-effect","driver"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}