MCPcopy Index your code
hub / github.com/processing/p5.js / getOrCreateUniformNode

Function getOrCreateUniformNode

src/strands/strands_api.js:58–77  ·  view source on GitHub ↗
(strandsContext, uniformName, typeInfo, defaultValueFn)

Source from the content-addressed store, hash-verified

56}
57
58function getOrCreateUniformNode(strandsContext, uniformName, typeInfo, defaultValueFn) {
59 const cache = _getBuiltinGlobalsCache(strandsContext);
60
61 const cached = cache.nodes.get(uniformName);
62 if (cached) return cached;
63
64 if (!cache.uniformsAdded.has(uniformName)) {
65 cache.uniformsAdded.add(uniformName);
66 strandsContext.uniforms.push({
67 name: uniformName,
68 typeInfo,
69 defaultValue: defaultValueFn,
70 });
71 }
72
73 const { id, dimension } = build.variableNode(strandsContext, typeInfo, uniformName);
74 const node = createStrandsNode(id, dimension, strandsContext);
75 cache.nodes.set(uniformName, node);
76 return node;
77}
78
79function getBuiltinGlobalNode(strandsContext, name) {
80 const spec = BUILTIN_GLOBAL_SPECS[name];

Callers 2

getBuiltinGlobalNodeFunction · 0.85
initGlobalStrandsAPIFunction · 0.85

Calls 6

createStrandsNodeFunction · 0.90
_getBuiltinGlobalsCacheFunction · 0.85
getMethod · 0.45
addMethod · 0.45
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected