mirror of
https://github.com/gpujs/gpu.js.git
synced 2026-01-25 16:08:02 +00:00
22 lines
428 B
JavaScript
22 lines
428 B
JavaScript
const gpu = new GPU();
|
|
const createTexture = gpu
|
|
.createKernel(function() {
|
|
return 255;
|
|
})
|
|
.setOutput([512])
|
|
.setOutputToTexture(true);
|
|
const texture = createTexture();
|
|
console.log(texture);
|
|
const useTexture = gpu
|
|
.createKernel(
|
|
function() {
|
|
return constants.texture[this.thread.x];
|
|
},
|
|
{
|
|
constants: { texture }
|
|
}
|
|
)
|
|
.setOutput([512]);
|
|
const proof = useTexture();
|
|
console.log(proof);
|