gpujs / gpu.js

GPU Accelerated JavaScript
https://gpu.rocks
MIT License
15.04k stars 646 forks source link

Impossible to use `Int16Array` or `Int8Array` as argument or constant of kernel #741

Open stity opened 2 years ago

stity commented 2 years ago

Confused number

What is wrong?

Some TypedArray are not supported when passed as constants or as arguments and fail silently.

Where does it happen?

According to the Readme, Int16Array can be passed as inputs but they seems to be misinterpreted.

How do we replicate the issue?

I have created a JS fiddle to demonstrate issue. It uses a large choice of different TypedArray. All the resuts should be identical but it is not the case. https://jsfiddle.net/qz9824dy/7/

How important is this (1-5)?

4

Expected behavior (i.e. solution)

All the canvases should display a similar image of noise. The Uint8Array and Uint16Array results are the expected results.

Other Comments

@ludovenet

passariello commented 2 years ago

Also Float64Array is not totally flat but probably same problem... I don't know if help

Float64Array