Skip to content

Second working port to Rollup #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove comments from bundles. Stub HeadlessGL.
  • Loading branch information
Symbitic committed Sep 21, 2019
commit 51fe268ef371fc1f1b4baa89855c5f24c0e2e1f4
24,979 changes: 11,288 additions & 13,691 deletions dist/gpu-browser-core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gpu-browser-core.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gpu-browser-core.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gpu-browser-core.min.js.map

Large diffs are not rendered by default.

36 changes: 35 additions & 1 deletion dist/gpu-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* GPU Accelerated JavaScript
*
* @version 2.0.0
* @date Thu Sep 19 2019 11:40:19 GMT-0400 (Eastern Daylight Time)
* @date Fri Sep 20 2019 21:34:42 GMT-0400 (Eastern Daylight Time)
*
* @license MIT
* The MIT License
Expand Down Expand Up @@ -19715,12 +19715,46 @@ void main(void) {
}`)();
}

/**
* Stub for HeadlessGL.
*/
class HeadlessGLKernel extends WebGLKernel {
static get isSupported() { return false }
static isContextMatch() { return false }
static getIsTextureFloat() { return false }
static getIsDrawBuffers() { return false }
static getChannelCount() { return 1 }
static get testCanvas() { return null }
static get testContext() { return null }
static get features() { return null }
static setupFeatureChecks() {}
static destroyContext() {}
initCanvas() { return {} }
initContext() { return null }
toString() { return '' }
initExtensions() {}
build() {}
destroyExtensions() {}
setOutput() {}

static getFeatures() {
return Object.freeze({
isFloatRead: false,
isIntegerDivisionAccurate: false,
isTextureFloat: false,
isDrawBuffers: false,
kernelMap: false,
channelCount: 1,
});
}
}
const lib = GPU;
lib.alias = alias;
lib.CPUFunctionNode = CPUFunctionNode;
lib.CPUKernel = CPUKernel;
lib.FunctionBuilder = FunctionBuilder;
lib.FunctionNode = FunctionNode;
lib.HeadlessGLKernel = HeadlessGLKernel;
lib.Input = Input;
lib.input = input;
lib.Texture = Texture;
Expand Down
2 changes: 1 addition & 1 deletion dist/gpu-browser.js.map

Large diffs are not rendered by default.

19,772 changes: 19,771 additions & 1 deletion dist/gpu-browser.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gpu-browser.min.js.map

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions dist/gpu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/gpu.js.map

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions dist/gpu.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* GPU Accelerated JavaScript
*
* @version 2.0.0
* @date Thu Sep 19 2019 11:40:19 GMT-0400 (Eastern Daylight Time)
* @date Fri Sep 20 2019 21:23:08 GMT-0400 (Eastern Daylight Time)
*
* @license MIT
* The MIT License
Expand Down Expand Up @@ -412,6 +412,19 @@ function getAstString(source, ast) {
return result.join('\n');
}

var common = /*#__PURE__*/Object.freeze({
isFunction: isFunction,
getFunctionNameFromString: getFunctionNameFromString,
functionToIFunction: functionToIFunction,
warnDeprecated: warnDeprecated,
isFunctionString: isFunctionString,
getArgumentNamesFromString: getArgumentNamesFromString,
isArray: isArray,
erectMemoryOptimized2DFloat: erectMemoryOptimized2DFloat,
erectMemoryOptimized3DFloat: erectMemoryOptimized3DFloat,
getAstString: getAstString
});

class Input {
constructor(value, size) {
this.value = value;
Expand Down Expand Up @@ -14665,5 +14678,7 @@ function alias(name, source) {
}`)();
}

export { CPUFunctionNode, CPUKernel, FunctionBuilder, FunctionNode, GLKernel, GPU$1 as GPU, HeadlessGLKernel, Input, Kernel, Texture, WebGL2FunctionNode, WebGL2Kernel, WebGLFunctionNode, WebGLKernel, alias, input, utils$1 as utils };
const utils$2 = { ...common, ...utils$1 };

export { CPUFunctionNode, CPUKernel, FunctionBuilder, FunctionNode, GLKernel, GPU$1 as GPU, HeadlessGLKernel, Input, Kernel, Texture, WebGL2FunctionNode, WebGL2Kernel, WebGLFunctionNode, WebGLKernel, alias, input, utils$2 as utils };
//# sourceMappingURL=gpu.mjs.map
2 changes: 1 addition & 1 deletion dist/gpu.mjs.map

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scripts": {
"build-tests": "node build-tests",
"build": "rollup -c",
"pretest": "npm run build",
"pretest": "npm run build && npm run build-tests",
"prewatch": "npm run build-tests",
"test": "qunit",
"watch": "rollup -c -w"
Expand All @@ -48,6 +48,7 @@
"qunit": "^2.9.1",
"read-dir-deep": "^7.0.1",
"rollup": "^1.21.4",
"rollup-plugin-cleanup": "^3.1.1",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
Expand Down
5 changes: 4 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BrowserSync from 'browser-sync';
import cleanup from 'rollup-plugin-cleanup';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import pkg from './package.json';
Expand Down Expand Up @@ -86,7 +87,8 @@ const browser = {
json(),
resolve(),
commonjs(),
production ? terser(terserOptions) : browsersync(browsersyncOptions)
production && cleanup(),
production ? [ terser(terserOptions) ] : browsersync(browsersyncOptions)
]
}

Expand All @@ -101,6 +103,7 @@ const core = {
json(),
resolve(),
commonjs(),
cleanup(),
terser(terserOptions)
]
}
Expand Down
35 changes: 35 additions & 0 deletions src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,47 @@ import { WebGL2Kernel } from './backend/web-gl2/kernel';
import { GLKernel } from './backend/gl/kernel';
import { Kernel } from './backend/kernel';

/**
* Stub for HeadlessGL.
*/
class HeadlessGLKernel extends WebGLKernel {
static get isSupported() { return false }
static isContextMatch() { return false }
static getIsTextureFloat() { return false }
static getIsDrawBuffers() { return false }
static getChannelCount() { return 1 }
static get testCanvas() { return null }
static get testContext() { return null }
static get features() { return null }
static setupFeatureChecks() {}
static destroyContext() {}
initCanvas() { return {} }
initContext() { return null }
toString() { return '' }
initExtensions() {}
build() {}
destroyExtensions() {}
setOutput() {}

static getFeatures() {
return Object.freeze({
isFloatRead: false,
isIntegerDivisionAccurate: false,
isTextureFloat: false,
isDrawBuffers: false,
kernelMap: false,
channelCount: 1,
});
}
};

const lib = GPU;
lib.alias = alias;
lib.CPUFunctionNode = CPUFunctionNode;
lib.CPUKernel = CPUKernel;
lib.FunctionBuilder = FunctionBuilder;
lib.FunctionNode = FunctionNode;
lib.HeadlessGLKernel = HeadlessGLKernel;
lib.Input = Input;
lib.input = input;
lib.Texture = Texture;
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { GPU } from './gpu';
import { alias } from './alias';
import { utils } from './utils';
import * as common from './common';
import { utils as util } from './utils';
import { Input, input } from './input';
import { Texture } from './texture';
import { FunctionBuilder } from './backend/function-builder';
Expand All @@ -15,6 +16,8 @@ import { WebGL2Kernel } from './backend/web-gl2/kernel';
import { GLKernel } from './backend/gl/kernel';
import { Kernel } from './backend/kernel';

const utils = { ...common, ...util };

export {
alias,
CPUFunctionNode,
Expand Down
5 changes: 2 additions & 3 deletions test/all-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
}
};
window.require = (module) => {
if (module.match(/[.][.]\/src$/)) return { GPU, ...GPU };
if (module.match(/[.][.]\/dist$/)) return { GPU, ...GPU };
if (/\.\.\/(?:dist|src)/g.test(module)) return { GPU, ...GPU };
if (module === 'sinon') return sinon;
if (module === 'qunit') return QUnit;
if (module.match(/[.][.]\/browser-test-utils$/)) return browserTestUtils;
if (/\.\.\/browser-test-utils/g.test(module)) return browserTestUtils;
throw new Error('cannot find ' + module);
};
</script>
Expand Down
5 changes: 2 additions & 3 deletions test/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
}
};
window.require = (module) => {
if (module.match(/[.][.]\/src$/)) return { GPU, ...GPU };
if (module.match(/[.][.]\/dist$/)) return { GPU, ...GPU };
if (/\.\.\/(?:dist|src)/g.test(module)) return { GPU, ...GPU };
if (module === 'sinon') return sinon;
if (module === 'qunit') return QUnit;
if (module.match(/[.][.]\/browser-test-utils$/)) return browserTestUtils;
if (/\.\.\/browser-test-utils/g.test(module)) return browserTestUtils;
throw new Error('cannot find ' + module);
};
</script>
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy