{"record":{"id":"952c5e56e112078a","repo":"unoplatform/uno","slug":"type-compile-failed-infolog-952c5e","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/IntegerTexturesGlCanvasElement.cs","lineNumber":268,"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":250,"sourceCodeEnd":275,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/IntegerTexturesGlCanvasElement.cs#L250-L275","documentation":"CompileShader in IntegerTexturesGlCanvasElement throws the shader info log on compile failure. Integer-texture GLSL constructs (usampler2D, uvec4 outputs, integer built-in conversions) require ES 3.00 / GL 330+, so compile errors here are almost always version-related.","triggerScenarios":"`uvec4`/`usampler2D`/`uint` used under #version 100 or 110; integer output declaration syntax invalid for the version; `imageStore`/`imageLoad` without the matching extension; missing precision on integer types in fragment.","commonSituations":"Sample auto-selected on a WebGL1 canvas; shader written for GL 330 desktop run on ES; missing `#extension` for image load/store.","solutions":["Read the info log and fix the flagged token/line.","Declare #version 300 es (or 330) for unsigned integer types and samplers.","Add required #extension directives for image load/store if used.","Add precision qualifiers (highp) for integer fragment types where required."],"exampleFix":"// before — unsigned types under old version\n#version 120\nuniform usampler2D uTex; out uvec4 frag; // unsupported\n\n// after\n#version 300 es\nprecision highp int;\nuniform usampler2D uTex; layout(location=0) out uvec4 frag;","handlingStrategy":"try-catch","validationCode":"if ((source.Contains(\"usampler\") || source.Contains(\"uvec\")) && !source.Contains(\"#version 300\"))\n    throw new InvalidOperationException(\"Unsigned integer GLSL requires #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":["Pin #version 300 es / GL 330 for unsigned integer types and samplers.","Add required #extension directives for image load/store.","Add precision qualifiers (highp int) where the version requires them."],"tags":["opengl","shader","glsl","integer-textures"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}