{"record":{"id":"6adb592d5323328f","repo":"stride3d/stride","slug":"member-memberaccess-member-not-found","errorCode":null,"errorMessage":"Member {memberAccess.Member} not found","messagePattern":"Member (.+?) not found","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Compilers/SDSL/ShaderMixer.cs","lineNumber":1073,"sourceCode":"                                selectedMethod = methodGroupEntry.Methods[j];\n                                baseMethodFound = true;\n                                break;\n                            }\n                        }\n\n                        if (!baseMethodFound)\n                            throw new InvalidOperationException($\"Can't find a base method for {methodGroupEntry.Name}\");\n                    }\n\n                    if ((selectedMethod.Flags & FunctionFlagsMask.Abstract) != 0)\n                        throw new InvalidOperationException($\"Trying to call an abstract method {selectedMethod.Shader.ShaderName}.{methodGroupEntry.Name}\");\n                    functionId = selectedMethod.MethodId;\n\n                    memberAccesses.Add(memberAccess.ResultId, functionId);\n                }\n                else\n                {\n                    throw new InvalidOperationException($\"Member {memberAccess.Member} not found\");\n                }\n\n                SetOpNop(i.Data.Memory.Span);\n            }\n            else if (i.Data.Op == Op.OpFunction && (OpFunction)i is { } function && temp[index + 1].Op == Op.OpFunctionMetadataSDSL && (OpFunctionMetadataSDSL)temp[index + 1] is { } functionInfo)\n            {\n                if (!mixinNode.MethodGroups.TryGetValue(function.ResultId, out var methodGroupEntry))\n                    throw new InvalidOperationException($\"Can't find method group info for {context.Names[function.ResultId]}\");\n            }\n            else if (i.Data.Op == Op.OpFunctionEnd)\n            {\n                memberAccesses.Clear();\n            }\n\n            SpirvBuilder.RemapIds(memberAccesses, ref i.Data);\n        }\n    }\n","sourceCodeStart":1055,"sourceCodeEnd":1091,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Compilers/SDSL/ShaderMixer.cs#L1055-L1091","documentation":"The mixer resolves OpMemberAccess instructions to variables, functions, or method groups. If the member name is not found in globalContext.ExternalVariables or globalContext.ExternalFunctions (i.e. it is neither a known external variable nor a known external function), there is no way to bind the member access and mixing fails.","triggerScenarios":"ShaderMixer constructor reaches the final else branch of member-access handling: memberAccess.Member is absent from both globalContext.ExternalVariables and globalContext.ExternalFunctions.","commonSituations":"Accessing a member that was never declared/registered in any shader of the composition; typos in member names; accessing a field of a composed shader that is not exposed as external; stale compiled shader modules after renaming members.","solutions":["Declare the member as an external variable or function in the shader that owns it.","Correct the member name at the access site.","Verify the shader declaring the member is included in globalContext (ExternalShaders/composition).","Recompile shaders so the external symbol tables are regenerated."],"exampleFix":"// before: accessing undeclared member\nvar v = SomeMember;\n// after: declare it in the owning shader\nextern float4 SomeMember; // then access via proper composition","handlingStrategy":"validation","validationCode":"// Only access members registered as external variables or functions\nbool memberKnown = globalContext.ExternalVariables.ContainsKey(memberName)\n    || globalContext.ExternalFunctions.ContainsKey(memberName);\nif (!memberKnown)\n    throw new InvalidOperationException($\"Member '{memberName}' must be declared as an external variable or function in a composed shader\");","typeGuard":null,"tryCatchPattern":"try { var mixed = mixer.Process(...); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"Member\") && ex.Message.Contains(\"not found\"))\n{\n    log.Error(ex, \"Unresolved member access; declare it extern in the owning shader or fix the name\");\n    throw;\n}","preventionTips":["Declare every cross-shader member as extern variable/function in its owning shader.","Verify the owning shader is registered in the composition/global context.","Recompile after renaming members so external symbol tables refresh.","Grep SDSL sources for member names when removing declarations to find remaining access sites."],"tags":["shader","sdsl","member-access","symbol-resolution"],"backgroundTag":"resource-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}