[Webkit-unassigned] [Bug 250307] New: "TypeError: Type error" when calling WebGL bufferData with typed array backed by growable SharedArrayBuffer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 8 21:01:07 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=250307

            Bug ID: 250307
           Summary: "TypeError: Type error" when calling WebGL bufferData
                    with typed array backed by growable SharedArrayBuffer
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Mac (Apple Silicon)
                OS: macOS 13
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebGL
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: Ian.kettlewell at gmail.com
                CC: dino at apple.com, kbr at google.com, kkinnunen at apple.com

Created attachment 464415

  --> https://bugs.webkit.org/attachment.cgi?id=464415&action=review

Index.html file with the code to reproduce the issue

As title says. The following code errors in Safari Technical Preview 160:

```
 let gl =
            canvas.getContext('webgl2');


        const sab = new SharedArrayBuffer(1024, {
            maxByteLength: 2048 // This is important, without it the page runs fine
        });

        const data = new Uint8Array(sab, 0, 32);
        let buffer = gl.createBuffer();
        gl.bindBuffer(gl.ARRAY_BUFFER, buffer); // TypeError: Type error
        gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
```

I discovered this in a game jam entry I made (https://ianjk.com/ld52/) that I was testing in the Safari Technology Preview. For some reason the SharedArrayBuffer backing the WebAssembly binary is automatically made 'growable' in Safari Technology Preview 160. In Safari 16.2 that does not happen so both the attached example and my game jam entry run fine.

I'm not versed in where to file WebKit bugs so I've filed this under 'WebGL', but please reclassify if there's a more appropriate 'Component'. :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230109/2eee4db8/attachment-0001.htm>


More information about the webkit-unassigned mailing list