You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
webgl: lot of functions fail when pointers go above 2GB #20533
I'm running into this issue as well. Some examples (from Firefox:)
TypeError: WebGL2RenderingContext.uniform4fv: Float32Array branch of (Float32Array or sequence) can't be an ArrayBuffer or an ArrayBufferView larger than 2 GB
TypeError: WebGL2RenderingContext.compressedTexSubImage2D: Argument 8 can't be an ArrayBuffer or an ArrayBufferView larger than 2 GB
TypeError: WebGL2RenderingContext.bufferSubData: Argument 3 can't be an ArrayBuffer or an ArrayBufferView larger than 2 GB
This is from some C++ code compiled to WASM with Emscripten.
None of my buffers in my C++ code are greater than 2 GB in size, they are individually quite small.
Yup. That seems about correct. None of the buffers were bigger than 2GB. We ran into this issue when there were so many small buffers that memory addresses beyond 2GB were passed into gl functions.
Data structures like transform matrices which maybe allocated and passed to glUniform at a later frame were the most hit by this issue.
I believe all the issues in emscripten related to these function have now been fixed. See #21268 and #21334.
What remain and browser implementation limits. I wonder if there is already an open firefox bug for the ...can't be an ArrayBuffer or an ArrayBufferView larger than 2 GB issue?
@Ono-Sendai would you mind opening a new issue for the ...can't be an ArrayBuffer or an ArrayBufferView larger than 2 GB firefox issue here in emscripten so we can close this one?
Activity
kripken commentedon Oct 25, 2023
@juj I think you had a PR for that?
Ono-Sendai commentedon Feb 16, 2024
I'm running into this issue as well. Some examples (from Firefox:)
TypeError: WebGL2RenderingContext.uniform4fv: Float32Array branch of (Float32Array or sequence) can't be an ArrayBuffer or an ArrayBufferView larger than 2 GB
TypeError: WebGL2RenderingContext.compressedTexSubImage2D: Argument 8 can't be an ArrayBuffer or an ArrayBufferView larger than 2 GB
TypeError: WebGL2RenderingContext.bufferSubData: Argument 3 can't be an ArrayBuffer or an ArrayBufferView larger than 2 GB
This is from some C++ code compiled to WASM with Emscripten.
None of my buffers in my C++ code are greater than 2 GB in size, they are individually quite small.
jspanchu commentedon Feb 16, 2024
Yup. That seems about correct. None of the buffers were bigger than 2GB. We ran into this issue when there were so many small buffers that memory addresses beyond 2GB were passed into gl functions.
Data structures like transform matrices which maybe allocated and passed to glUniform at a later frame were the most hit by this issue.
sbc100 commentedon Feb 16, 2024
I believe all the issues in emscripten related to these function have now been fixed. See #21268 and #21334.
What remain and browser implementation limits. I wonder if there is already an open firefox bug for the
...can't be an ArrayBuffer or an ArrayBufferView larger than 2 GBissue?@Ono-Sendai would you mind opening a new issue for the
...can't be an ArrayBuffer or an ArrayBufferView larger than 2 GBfirefox issue here in emscripten so we can close this one?Ono-Sendai commentedon Feb 17, 2024
It looks like there is an open issue for Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1838218
Emscripten could work around this by copying or making new buffer views that are smaller than 2GB, to work around this Firefox limitation.
sbc100 commentedon Feb 20, 2024
@Ono-Sendai do you know if we can pass a smaller view of larger 2Gb+ array buffer?
Avoid garbage-free WebGL APIs when memory size is over 2gb.
Avoid garbage-free WebGL APIs when memory size is over 2gb.
Avoid garbage-free WebGL APIs when memory size is over 2gb.
Avoid garbage-free WebGL APIs when memory size is over 2gb.
Avoid garbage-free WebGL APIs when memory size is over 2gb.
Avoid garbage-free WebGL APIs when memory size is over 2gb.
Avoid garbage-free WebGL APIs when memory size is over 2gb.
Avoid garbage-free WebGL APIs when memory size is over 2gb.
Avoid garbage-free WebGL APIs when memory size is over 2gb. (#21445)
Merge upstream 3.1.56 (#64)