MCPcopy Index your code
hub / github.com/gpujs/gpu.js / addNativeFunction

Method addNativeFunction

src/backend/kernel.js:339–352  ·  view source on GitHub ↗

* * @param {string} name * @param {string} source * @param {IGPUFunctionSettings} [settings]

(name, source, settings = {})

Source from the content-addressed store, hash-verified

337 * @param {IGPUFunctionSettings} [settings]
338 */
339 addNativeFunction(name, source, settings = {}) {
340 const { argumentTypes, argumentNames } = settings.argumentTypes ?
341 splitArgumentTypes(settings.argumentTypes) :
342 this.constructor.nativeFunctionArguments(source) || {};
343 this.nativeFunctions.push({
344 name,
345 source,
346 settings,
347 argumentTypes,
348 argumentNames,
349 returnType: settings.returnType || this.constructor.nativeFunctionReturnType(source)
350 });
351 return this;
352 }
353
354 /**
355 * @desc Setup the parameter types for the parameters

Callers 2

mergeSettingsMethod · 0.95
setNativeFunctionsMethod · 0.95

Calls 3

splitArgumentTypesFunction · 0.85

Tested by

no test coverage detected