{"record":{"id":"40b19d74ed62270e","repo":"unoplatform/uno","slug":"type-compile-failed-infolog-40b19d","errorCode":null,"errorMessage":"{type} compile failed: {infoLog}","messagePattern":"(.+?) compile failed: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/IntAttribsBlendGlCanvasElement.cs","lineNumber":264,"sourceCode":"\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}\n\t\t\treturn sh;\n\t\t}\n\t}\n}\n#endif\n","sourceCodeStart":246,"sourceCodeEnd":271,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/IntAttribsBlendGlCanvasElement.cs#L246-L271","documentation":"CompileShader in IntAttribsBlendGlCanvasElement throws the shader info log when glCompileShader reports failure. Given this sample uses integer attributes and instancing, compile failures are usually an integer/instancing GLSL construct the current shader version rejects.","triggerScenarios":"`in ivec4` or `gl_VertexID`/`gl_InstanceID` under #version 100; `layout(location=)` qualifier unsupported in the declared version; `flat` interpolation qualifier missing on an integer varying; precision qualifier missing in fragment.","commonSituations":"Sample auto-targeting WebGL1 where ES 1.00 has no integer attributes; shader copied from a desktop sample into an ES context; missing `flat` on integer varying causing a strict-driver compile error.","solutions":["Read the info log line/column and fix the flagged construct.","Target #version 300 es for integer attributes, instancing, and `flat`.","Add `flat out`/`flat in` for integer varyings.","Add precision qualifiers for fragment-stage ints/floats."],"exampleFix":"// before — integer varying without flat interpolation qualifier\nout ivec4 vCell;\n\n// after\nflat out ivec4 vCell;   // integer varyings must be 'flat'","handlingStrategy":"try-catch","validationCode":"if (source.Contains(\"in ivec\") && !source.Contains(\"#version 300\"))\n    throw new InvalidOperationException(\"Integer attributes require #version 300 es / GL 330.\");","typeGuard":null,"tryCatchPattern":"try { return CompileShader(gl, type, source); }\ncatch (Exception ex) { throw new InvalidOperationException($\"{type} compile failed: {ex.Message}\\n{source}\", ex); }","preventionTips":["Use `flat` interpolation for all integer varyings.","Pin #version 300 es / GL 330 for integer-attribute shaders.","Echo source into the exception to speed up triage."],"tags":["opengl","shader","glsl","vertex-attributes"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}