emscripten-core / emscripten-core/emscripten

WebGL2RenderingContext cannot handle large ArrayBuffer sizes.

オープン
#17,539 コメント 19 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
27.6k
フォーク
3.6k
平均マージ
1日 14時間
マージ済み PR(30日)
125

説明

Please include the following in your bug report:

**Version of emscripten/emsdk:**
Please include the output `emcc -v` here
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.26 (5af6a110ee58ca4a6885fbcad830c92207fefea2)
clang version 13.0.0 (https://github.com/llvm/llvm-project 31e75512174e1bdaa242ee5c7f30fe56e68c3748)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/terop/cvs/emscripten/emsdk/upstream/bin

**Failing command line in full:**
If this is compile or link-time failure please include the full failing command
along with its entire output.

**Full link command and output with `-v` appended:**
Even for runtime issues it helps a lot if you can include the full link command.
Adding `-v` to the link command will show all of the sub-commands run which
can help us diagnose your issue.
[link_command_line.txt](https://github.com/emscripten-core/emscripten/files/9214837/link_command_line.txt)

The Problem:
WebGL2 fails to render large meshes. Especially, if -s MAXIMUM_MEMORY=4096MB -s ALLOW_MEMORY_GROWTH=1 is used. Basically when emscripten resizes the heap to go over 2Gb limit, WebGL2 gives this error message:
RangeError: Failed to execute 'bufferData' on 'WebGL2RenderingContext': The ArrayBuffer/ArrayBufferView size exceeds the supported range.,RangeError: Failed to execute 'bufferData' on 'WebGL2RenderingContext': The ArrayBuffer/ArrayBufferView size exceeds the supported range.

In this use case, we're trying to render large 3d models, i.e. sanmiguel 3d model. The code is loading (via fetch) a large 661Mb binary 3d model file, and it fails to render. You can see the issue in https://meshpage.org/431 The error happened immediately after heap resize went over 2Gb limit.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、提供された link_command_line.txt と emcc -v の出力を確認し、その後 MAXIMUM_MEMORY=4096MB および ALLOW_MEMORY_GROWTH=1 を設定して meshpage.org/431 で失敗を再現します。ヒープが 2 GB を超えて拡大した後も、大規模なメッシュが WebGL2 bufferData RangeError なしでレンダリングされ続ければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
wasm
領域
computer-graphics, web-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。