{"record":{"id":"760d67e62f5a758c","repo":"unoplatform/uno","slug":"program-link-failed-infolog-760d67","errorCode":null,"errorMessage":"Program link failed: {infoLog}","messagePattern":"Program link failed: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/IntegerTexturesGlCanvasElement.cs","lineNumber":251,"sourceCode":"\t\t\tgl.BindVertexArray(_quadVao);\n\t\t\tgl.DrawArrays(PrimitiveType.Triangles, 0, 6);\n\t\t\tgl.ActiveTexture(TextureUnit.Texture0);\n\n\t\t\tInvalidate();\n\t\t}\n\n\t\tprivate static uint CreateProgram(GL gl, string vertexSource, string fragmentSource)\n\t\t{\n\t\t\tvar vs = CompileShader(gl, ShaderType.VertexShader, vertexSource);\n\t\t\tvar fs = CompileShader(gl, ShaderType.FragmentShader, fragmentSource);\n\t\t\tvar prog = gl.CreateProgram();\n\t\t\tgl.AttachShader(prog, vs);\n\t\t\tgl.AttachShader(prog, fs);\n\t\t\tgl.LinkProgram(prog);\n\t\t\tgl.GetProgram(prog, ProgramPropertyARB.LinkStatus, out int linkStatus);\n\t\t\tif (linkStatus != (int)GLEnum.True)\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Program link failed: \" + gl.GetProgramInfoLog(prog));\n\t\t\t}\n\t\t\tgl.DetachShader(prog, vs);\n\t\t\tgl.DetachShader(prog, fs);\n\t\t\tgl.DeleteShader(vs);\n\t\t\tgl.DeleteShader(fs);\n\t\t\treturn prog;\n\t\t}\n\n\t\tprivate static uint CompileShader(GL gl, ShaderType type, string source)\n\t\t{\n\t\t\tvar sh = gl.CreateShader(type);\n\t\t\tgl.ShaderSource(sh, source);\n\t\t\tgl.CompileShader(sh);\n\t\t\tgl.GetShader(sh, ShaderParameterName.CompileStatus, out int status);\n\t\t\tif (status != (int)GLEnum.True)\n\t\t\t{\n\t\t\t\tthrow new Exception($\"{type} compile failed: \" + gl.GetShaderInfoLog(sh));\n\t\t\t}","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/IntegerTexturesGlCanvasElement.cs#L233-L269","documentation":"CreateProgram in IntegerTexturesGlCanvasElement links the integer-texture sample's shaders and throws the info log on link failure. Because the fragment shader writes to integer render targets (`layout(location=0) out uvec4`), link failures often come from integer-output or integer-sampler interface mismatches.","triggerScenarios":"Fragment output declared `uvec4`/`ivec4` but the framebuffer attachment is a float texture (or vice-versa); usampler2D declared but the bound texture isn't integer format; varying mismatch between stages; #version too low for integer fragment outputs.","commonSituations":"Mixing integer fragment outputs with a non-integer FBO; ES2/WebGL1 context lacking integer render targets; sampler type (sampler2D vs usampler2D) not matching the texture's internal format.","solutions":["Read the info log for the offending output/sampler.","Match fragment output types to the framebuffer's integer color attachment types.","Use usampler2D/isampler2D only with integer-format textures, and sampler2D only with normalized formats.","Target #version 300 es / GL 330+ for integer fragment outputs."],"exampleFix":"// before — integer output to a float FBO, or float sampler on integer tex\nout vec4 fragColor;          // mismatched with RGBA32UI attachment\nuniform sampler2D uTex;       // mismatched with RGBA32UI texture\n\n// after\nlayout(location=0) out uvec4 fragColor;\nuniform usampler2D uTex;","handlingStrategy":"validation","validationCode":"// Ensure fragment output types match the integer framebuffer attachment\nif (!fragmentSource.Contains(\"uvec4\") && !fragmentSource.Contains(\"ivec4\"))\n    throw new InvalidOperationException(\"Integer FBO requires integer fragment outputs (uvec4/ivec4).\");","typeGuard":null,"tryCatchPattern":"try { return CreateProgram(gl, vert, frag); }\ncatch (Exception ex) { Log.Error($\"IntegerTextures link failed: {ex.Message}\"); throw; }","preventionTips":["Match fragment output types (uvec4/ivec4) to the integer color attachment format.","Use usampler2D/isampler2D only with integer-format textures.","Keep #version 300 es / GL 330 for integer fragment outputs."],"tags":["opengl","shader","glsl","integer-textures","framebuffer"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}