Skip to content
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

Texture reuse between recompiled kernels is incorrect #590

Closed
robertleeplummerjr opened this issue Mar 31, 2020 · 0 comments
Closed

Texture reuse between recompiled kernels is incorrect #590

robertleeplummerjr opened this issue Mar 31, 2020 · 0 comments
Assignees

Comments

@robertleeplummerjr
Copy link
Member

A GIF or MEME to give some spice of the internet

What is wrong?

Kernels that are recompiled that share the same recycled output texture doesn't update correctly.

Where does it happen?

General use, just after recompile and deletion of a texture.

How do we replicate the issue?

const { GPU } = require('./src');
const gpu = new GPU({ mode: 'gpu' });

const kernel = gpu.createKernel(function (value) {
  return value[this.thread.x] + 1;
}, { output: [1], pipeline: true, immutable: true });

const result1 = kernel([1]);
console.log(result1.toArray());
const result2 = kernel(result1);
result1.delete();
console.log(result2.toArray());
result2.delete();
const result3 = kernel([3]);
console.log(result3.toArray()); // 
const result4 = kernel(result3);
result3.delete();
console.log(result4.toArray());

Outputs:

Float32Array [ 2 ]
Float32Array [ 3 ]
Float32Array [ 3 ]
Float32Array [ 5 ]

How important is this (1-5)?

4

Expected behavior (i.e. solution)

Should output:

Float32Array [ 2 ]
Float32Array [ 3 ]
Float32Array [ 4 ]
Float32Array [ 5 ]

Other Comments

@robertleeplummerjr robertleeplummerjr self-assigned this Mar 31, 2020
@robertleeplummerjr robertleeplummerjr changed the title Texture reuse between recompiled kernels is lost Texture reuse between recompiled kernels is incorrect Mar 31, 2020
ammyk9 pushed a commit to ammyk9/gpu.js that referenced this issue Aug 8, 2024
- which is called after gpu.js switches kernels based off need
fix: Consistent error message for values that are not defined
fix: Add recompiled kernels to gpu.js kernels property and test
fix: Move texture deleting to within the GLKernel Texture implementation
fix: Add Texture.clear as an abstract method on the base Texture
fix: Bump and build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant