Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Texture reuse between recompiled kernels is incorrect #590

@robertleeplummerjr

Description

@robertleeplummerjr

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions