mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-01-25 16:08:02 +00:00
Added silent failure, for calling pre-existing math function
This commit is contained in:
parent
21377d9485
commit
5a3bb50057
@ -97,7 +97,10 @@ var functionBuilder = (function() {
|
||||
function webglString_fromFunctionNames(functionList) {
|
||||
var ret = [];
|
||||
for(var i=0; i<functionList.length; ++i) {
|
||||
ret.push( this.nodeMap[functionList[i]].getWebglFunctionString() );
|
||||
var node = this.nodeMap[functionList[i]];
|
||||
if(node) {
|
||||
ret.push( this.nodeMap[functionList[i]].getWebglFunctionString() );
|
||||
}
|
||||
}
|
||||
return ret.join("\n");
|
||||
}
|
||||
@ -120,5 +123,24 @@ var functionBuilder = (function() {
|
||||
}
|
||||
functionBuilder.prototype.webglString = webglString;
|
||||
|
||||
//---------------------------------------------------------
|
||||
//
|
||||
// Polyfill stuff
|
||||
//
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Round function used in polyfill
|
||||
function round(a) { return Math.floor( a + 0.5 ); }
|
||||
|
||||
///
|
||||
/// Function: polyfillStandardFunctions
|
||||
///
|
||||
/// Polyfill in the missing Math funcitons (round)
|
||||
///
|
||||
function polyfillStandardFunctions() {
|
||||
this.addFunction(null, round);
|
||||
}
|
||||
functionBuilder.prototype.polyfillStandardFunctions = polyfillStandardFunctions;
|
||||
|
||||
return functionBuilder;
|
||||
})();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user