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
glPixelStorei does not support PACK_ALIGNMENT #23151
Emscripten restricts the length of pixel data through emscriptenWebGLGetTexPixelData, but this restriction may be shorter than expected after calling glPixelStorei. This results in browser errors.
Chrome and Safari:
WebGL: INVALID_OPERATION: texSubImage2D: ArrayBufferView not big enough for request
FireFox:
WebGL warning: texSubImage: Desired upload requires more bytes (20004) than are available (1440).
The problem with emscriptenWebGLGetTexPixelData is that it does not distinguish between pack and unpack, nor does it handle all possible parameters in glPixelStorei.
Thanks for the repro cases. As far as you are aware have these features always been missing from emscripten or is this a regression? Any ideas for fixes? Would you like to send a PR?
Activity
sbc100 commentedon Dec 13, 2024
Can you share an example of a call to
glPixelStoreiwhereemscriptenWebGLGetTexPixelDatadoesn't do the right thing?Could you perhaps give this bug with something more descriptive? Something like
glPixelStorei does not support xxx[-]More accurate pixel data length[/-][+]glPixelStorei does not support PACK_ALIGNMENT[/+]seven332 commentedon Dec 16, 2024
Here is an example
index.html
main.cpp
Put index.html main.cpp in the same directory. Run
emcc main.cpp. You will get:Use a http server to host these files, for example
python -m http.server.Open the url of the index.html in any browser, and open the console, you will get an error about buffer length.
I ran this example in Emscripten 3.1.74. The js version works fine, but the c++ version doesn't.
Chrome:
FireFox:
seven332 commentedon Dec 18, 2024
If WebGL2 and 4G memory is enable. glPixelStorei does not support GL_PACK_ROW_LENGTH either.
Here is the code.
index.html
main.cpp
The operation process is the same as above, except for the C++ compilation parameters.
emcc main.cpp -sUSE_WEBGL2=1 -sINITIAL_MEMORY=3gbsbc100 commentedon Dec 18, 2024
Thanks for the repro cases. As far as you are aware have these features always been missing from emscripten or is this a regression? Any ideas for fixes? Would you like to send a PR?