{"record":{"id":"fd52f95444658b87","repo":"unoplatform/uno","slug":"program-link-failed-infolog-fd52f9","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/IntAttribsBlendGlCanvasElement.cs","lineNumber":247,"sourceCode":"\t\t\tgl.Disable(EnableCap.Blend);\n\t\t\tgl.BlendEquationSeparate(BlendEquationModeEXT.FuncAdd, BlendEquationModeEXT.FuncAdd);\n\t\t\tgl.SampleCoverage(1f, false);\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":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/IntAttribsBlendGlCanvasElement.cs#L229-L265","documentation":"CreateProgram in IntAttribsBlendGlCanvasElement links compiled vertex/fragment shaders and throws the program info log if LinkStatus != True. This instancing+blend sample uses integer vertex attributes, so link failures commonly stem from integer-attribute or instancing feature gaps in the active GLSL profile.","triggerScenarios":"Vertex shader declares integer attributes (`in ivec4`) under a GLSL version that doesn't support them; varying interface mismatch between stages; `layout(location=)` collision; fragment shader reading an integer varying as float; GLSL version below 300 es rejecting integer attributes.","commonSituations":"Sample running on WebGL1/ES2 lacking integer attributes and instancing; refactor that changed a varying type in only one stage; driver link bug for integer varyings.","solutions":["Read the info log for the unresolved symbol or attribute.","Use #version 300 es / GL 330+ for integer attributes and instancing.","Match integer `out`/`in` varyings exactly between vertex and fragment.","Avoid reading an integer varying as float in the fragment stage."],"exampleFix":"// before — integer attribute declared under ES2\n#version 100\nattribute ivec4 aCell; // unsupported → link fail\n\n// after\n#version 300 es\nlayout(location = 1) in ivec4 aCell;","handlingStrategy":"validation","validationCode":"gl.GetInteger(GetPName.MajorVersion, out int major);\nif (major < 3) throw new InvalidOperationException(\"Integer-attribute linking requires GL/ES 3.0+ (WebGL2).\");","typeGuard":null,"tryCatchPattern":"try { return CreateProgram(gl, vert, frag); }\ncatch (Exception ex) { Log.Error($\"IntAttribs link failed: {ex.Message}\"); throw; }","preventionTips":["Declare integer varyings as `flat` on both stages.","Keep #version 300 es / GL 330 for integer attributes and outputs.","Sync attribute layout/location qualifiers between C# (VertexAttribIPointer) and GLSL."],"tags":["opengl","shader","glsl","vertex-attributes","instancing"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}