forked from gpujs/gpu.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction-node.js
More file actions
40 lines (38 loc) · 1.64 KB
/
function-node.js
File metadata and controls
40 lines (38 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const BaseFunctionNode = require('../function-node-base');
///
/// Class: functionNode
///
/// [INTERNAL] Represents a single function, inside JS, webGL, or openGL.
///
/// This handles all the raw state, converted state, etc. Of a single function.
///
/// Properties:
/// functionName - {String} Name of the function
/// jsFunction - {JS Function} The JS Function the node represents
/// jsFunctionString - {String} jsFunction.toString()
/// paramNames - {[String,...]} Parameter names of the function
/// paramTypes - {[String,...]} Shader land parameters type assumption
/// isRootKernel - {Boolean} Special indicator, for kernel function
/// webglFunctionString - {String} webgl converted function string
/// openglFunctionString - {String} opengl converted function string
/// calledFunctions - {[String,...]} List of all the functions called
/// initVariables - {[String,...]} List of variables initialized in the function
/// readVariables - {[String,...]} List of variables read operations occur
/// writeVariables - {[String,...]} List of variables write operations occur
///
module.exports = class CPUFunctionNode extends BaseFunctionNode {
generate(options) {
this.functionString = this.jsFunctionString;
}
///
/// Function: getFunctionPrototypeString
///
/// Returns the converted webgl shader function equivalent of the JS function
///
/// Returns:
/// {String} webgl function string, result is cached under this.getFunctionPrototypeString
///
getFunctionPrototypeString(options) {
return this.functionString;
}
};