Created
September 3, 2018 13:39
-
-
Save jt0dd/62bf241758ffc75365b402e1d2ee1c31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const gpu1 = new GPU(); | |
| const createTexture = gpu1.createKernel(function() { | |
| return 55; | |
| }).setOutput([4, 100, 100]).setOutputToTexture(true); | |
| console.time('texture'); | |
| const texture1 = createTexture(); | |
| const texture2 = createTexture(); | |
| const texture3 = createTexture(); | |
| const useTexture = gpu1.createKernel(function() { | |
| var index = 0; | |
| return this.constants.textures[index][0]; | |
| }, { | |
| constants : { | |
| textures : [texture1, texture2, texture3] | |
| } | |
| }).setOutput([4, 100, 100]); | |
| const result = useTexture(); | |
| console.timeEnd('texture'); | |
| console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment