{"record":{"id":"c9d23c11ec2f566d","repo":"remotion-dev/remotion","slug":"noise-displacement-program-link-failed-log","errorCode":null,"errorMessage":"Noise displacement program link failed: ${log ?? '(no log)'}","messagePattern":"Noise displacement program link failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/noise-displacement.ts","lineNumber":437,"sourceCode":"};\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);\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst log = gl.getProgramInfoLog(program);\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(\n\t\t\t`Noise displacement program link failed: ${log ?? '(no log)'}`,\n\t\t);\n\t}\n\n\treturn program;\n};\n\nconst setupNoiseDisplacement = (\n\ttarget: HTMLCanvasElement,\n): NoiseDisplacementState => {\n\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('noise displacement effect');\n\t}","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/noise-displacement.ts#L419-L455","documentation":"The noiseDisplacement effect's compiled vertex and fragment shaders failed to link into a complete WebGL program. gl.getProgramParameter(program, gl.LINK_STATUS) returned false and the linker log is included. This indicates a mismatch between shader stages or a driver-specific linker bug — the shader pair is static and library-controlled.","triggerScenarios":"During setupNoiseDisplacement, linkProgram attaches both compiled shaders, calls gl.linkProgram, and LINK_STATUS is false. The fragment shader uses many uniforms (12+) and an int loop bound, which some drivers handle incorrectly during linking.","commonSituations":"GPU driver linker bugs; exceeding driver-specific uniform or varying limits; mismatched varying declarations on certain drivers; software rasterizers with incomplete linkers. Rarely caused by user input.","solutions":["Report the linker log and GPU/driver info to the Remotion team — the shaders are library-controlled.","Update GPU drivers.","Test on SwiftShader or a different GPU to isolate driver-specific linker failures.","Ensure CI headless browser has adequate WebGL2 linking support."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Program link failures are driver/library bugs — catch and report\ntry {\n  // render with noiseDisplacement effect\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Noise displacement program link failed')) {\n    console.error('Noise displacement program link failed:', e.message);\n    // Fallback: render without the effect\n  } else {\n    throw e;\n  }\n}","preventionTips":["Report program linker logs and GPU/driver info to the Remotion team.","Update GPU drivers to avoid linker bugs.","Test on SwiftShader or a different GPU to isolate driver-specific linker failures."],"tags":["webgl","gpu","glsl","shader","noise-displacement","driver-compat"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}