-
Notifications
You must be signed in to change notification settings - Fork 655
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
Input Array becomes zeros on iOS devices #585
Comments
Looking at this now. |
Does using |
No, I think it breaks during evaluation without error. Nothing is being returned. |
Actually, I lied. It returns something, but it's little off |
I'm still investigating. |
Can I be of any help? |
It seems to be a bug with packing/unpacking floats on ios. Related code is that of "dragons": gpu.js/src/backend/web-gl/fragment-shader.js Line 246 in 1955ad3
|
Which floats? User end floats or backend? |
Can a strongly typed function fix this error? |
Its complicated, but it has to do with how a 32 bit float array is:
iOS and OSX are notoriously difficult to work with. Their driver's are buggy and they leave things half implemented. Boo Apple! |
But the bug occurs even if I don't take any input array.
```js
gpu.createKernel(function() {
return this.thread.x;
}, {output: [25]})
```
This ^^^ also returns a weird output.
…On Tue, 24 Mar, 2020, 11:23 PM Robert Plummer, ***@***.***> wrote:
Which floats? User end floats or backend?
Its complicated, but it has to do with how a 32 bit float array is:
1. uploaded (Float32Array to UInt8Array)
2. reconstituted/unpacked (8 bit vec4 -> 32 bit float)
3. packed (32 bit float -> 8 bit float)
4. and then downloaded (UInt8Array to Float32Array)
iOS and OSX are notoriously difficult to work with. Their driver's are
buggy and they leave things half implemented. Boo Apple!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#585 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIJI5H74K5EVMXMVTHX2Y6DRJDXR7ANCNFSM4LSNZKEQ>
.
|
I don't get a bug, per-say, I get a low precision: |
glitch rather than a bug. |
? |
Can we not work with integers instead of floats? |
They are already strong types, no.
|
Why is the output float and not int? |
Lets discuss implementation details on gitter, and here focus on the findings we come up with when they are found. |
Okay.
…On Wed, 25 Mar, 2020, 12:02 AM Robert Plummer, ***@***.***> wrote:
Why is the output float and not int?
Lets discuss implementation details on gitter, and here focus on the
findings we come up with when they are found.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#585 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIJI5HYRIIKKABNITENDTJDRJD4EBANCNFSM4LSNZKEQ>
.
|
It seems that you must use |
Still investigating that as well. |
Released https://github.com/gpujs/gpu.js/releases/tag/2.9.2 which addresses the inaccurate lookup. My suspicion for values like |
What is wrong?
When I pass an array to kernel, all of entries becomes 0 on iOS devices (Chrome and Safari)
Where does it happen?
Confirmed on at least three devices (my iPad, iPhone and friend's iPhone)
How do we replicate the issue?
Here is minimum working example : https://jsfiddle.net/yzpaefuo/5/
How important is this (1-5)?
5 if I'm not messing something up
Expected behavior (i.e. solution)
I should get same results on both all devices.
Other Comments
I've tested this on android devices and it works fine, and it works on my Mac and PC as well.
It also seems to work properly with older version of gpu.js. Specifically one that worked was 1.10.1
The text was updated successfully, but these errors were encountered: