-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Error after setting GL_UNPACK_ROW_LENGTH #21968
Comments
Actually every parameters in glPixelStorei affects the expected length of pixels data, not only GL_UNPACK_ROW_LENGTH. Additionally packing and unpacking are different. Here is how FireFox calculate the Maybe we should just ignore the |
Are there particular
|
I use skia in emscripten. It use
|
Interesting.. IIUC there are many folks using Skia built with emscripten (CanvasKit is basically that isn't it?). Do you know why nobody else has run into this over the years? Is this usage optional in some way? |
This commit in 3.1.56 break it. In webgl2 before this commit:
After this commit, in most cases,
skia still uses 3.1.44. |
So are you saying that skia was always broken when the garbage free APIs are not used? IIUC the garbage-free APIs didn't always exist, so presumably skia was also broken before that point? (I'm not sure just how long ago it was that they were added but maybe its worth doing some history spelunking here). |
Yes. In webgl2, skia was always broken when the garbage free APIs are not used. Because skia use |
The patch for my project is:
|
I see, so you just take a subarray from the start to the very end of the memory. Does that solve all of these issue? Seems like a fairly reasonable approach since the cost of the subarray is constant regardless, right? |
It works for me. It passes all my tests. I haven't received any bug reports related to webgl this week. |
This patch may cause errors on FireFox
|
Are you using a memory larger than 2gb? |
Yes |
Might be worth filing a bug with FF to see if we can get that limit increased. Would you mind opening a bug here? We can of course try to come up with other ideas here at the same time. |
The user who reported this issue was using Firefox 115. I am trying to reproduce this problem on the latest version. |
Here it is. #23151 |
3.1.59
The function
emscriptenWebGLGetTexPixelData
doesn't checkGL_UNPACK_ROW_LENGTH
.https://github.com/emscripten-core/emscripten/blob/3.1.59/src/library_webgl.js#L1600
For example in glTexSubImage:
The length of subarray should be
39 * 512 + 36 = 20004
at least, but it's36 * 40 = 1440
Chrome and Safari:
FireFox:
The text was updated successfully, but these errors were encountered: