{"record":{"id":"d053c080b4507917","repo":"unoplatform/uno","slug":"type-compile-failed-infolog-d053c0","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/MRTBlitGlCanvasElement.cs","lineNumber":310,"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":292,"sourceCodeEnd":317,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SamplesApp/SamplesApp.Samples/Windows_UI_Composition/MRTBlitGlCanvasElement.cs#L292-L317","documentation":"CompileShader in MRTBlitGlCanvasElement throws the shader info log when glCompileShader fails. For this MRT/MSAA sample, compile errors are usually the multi-output or blit-related GLSL constructs under a too-low shader version.","triggerScenarios":"`layout(location=0) out vec4` under #version 100 (ES2); gl_FragData indexing on a context with one slot; missing precision qualifier; unknown built-in used in the blit/resolve shader.","commonSituations":"Sample on WebGL1 where explicit output locations are unsupported; shader copied from desktop GL into ES; truncated source string.","solutions":["Read the info log line/column and fix the flagged construct.","Target #version 300 es / GL 330 for explicit MRT output locations.","Add precision qualifiers and ES built-ins.","Verify the shader source constant is complete."],"exampleFix":"// before — ES2 single output, MRT needs explicit locations\n#version 100\ngl_FragData[0] = vec4(1);\n\n// after\n#version 300 es\nprecision mediump float;\nlayout(location=0) out vec4 fragColor0;\nlayout(location=1) out vec4 fragColor1;","handlingStrategy":"try-catch","validationCode":"if (fragmentSource.Contains(\"layout(location=\") && !fragmentSource.Contains(\"#version 300\"))\n    throw new InvalidOperationException(\"Explicit MRT output locations 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 #version 300 es / GL 330 for explicit MRT output locations.","Replace gl_FragData usage with explicit `layout(location=N) out` for ES3.","Echo source into the exception for faster triage."],"tags":["opengl","shader","glsl","mrt"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}