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
Are there particular glPixelStorei paramaters that you use and are interesting in have work in emscripten? We tend to implement this stuff reactively to get a surface area can captures that things folks actually use in practice.
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?
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 GL_UNPACK_ROW_LENGTH and GR_GL_PACK_ROW_LENGTH, and the length of pixelData is shorter then expected.
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?
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.
Activity
[webgl] Implement GL_UNPACK_ROW_LENGTH
[webgl] Implement GL_UNPACK_ROW_LENGTH
[webgl] Implement GL_UNPACK_ROW_LENGTH (#21980)
seven332 commentedon May 23, 2024
Actually every parameters in glPixelStorei affects the expected length of pixels data, not only GL_UNPACK_ROW_LENGTH. Additionally packing and unpacking are different.
https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glPixelStorei.xhtml
Here is how FireFox calculate the
totalBytesUsed.https://searchfox.org/mozilla-central/source/dom/canvas/WebGLContext.cpp#2741
Maybe we should just ignore the
endin subarray to make life easier. There is no data length in c api after all.sbc100 commentedon May 23, 2024
Are there particular
glPixelStoreiparamaters that you use and are interesting in have work in emscripten? We tend to implement this stuff reactively to get a surface area can captures that things folks actually use in practice.seven332 commentedon May 24, 2024
I use skia in emscripten. It use
GR_GL_UNPACK_ROW_LENGTHGR_GL_UNPACK_ALIGNMENTGR_GL_PACK_ROW_LENGTHGR_GL_PACK_ALIGNMENThttps://github.com/google/skia/blob/main/src/gpu/ganesh/gl/GrGLGpu.cpp
sbc100 commentedon May 24, 2024
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?
seven332 commentedon May 24, 2024
This commit in 3.1.56 break it.
4de9bbb
In webgl2 before this commit:
After this commit, in most cases,
WEBGL_USE_GARBAGE_FREE_APISis disabled.skia still uses 3.1.44.
https://github.com/google/skia/blob/main/bin/activate-emsdk
sbc100 commentedon May 24, 2024
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).
seven332 commentedon May 24, 2024
Yes. In webgl2, skia was always broken when the garbage free APIs are not used. Because skia use
GL_UNPACK_ROW_LENGTHandGR_GL_PACK_ROW_LENGTH, and the length of pixelData is shorter then expected.seven332 commentedon May 24, 2024
The patch for my project is:
sbc100 commentedon May 24, 2024
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?
seven332 commentedon May 25, 2024
It works for me. It passes all my tests. I haven't received any bug reports related to webgl this week.
seven332 commentedon Dec 13, 2024
This patch may cause errors on FireFox
sbc100 commentedon Dec 13, 2024
Are you using a memory larger than 2gb?
seven332 commentedon Dec 13, 2024
Yes
sbc100 commentedon Dec 13, 2024
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.
seven332 commentedon Dec 13, 2024
The user who reported this issue was using Firefox 115. I am trying to reproduce this problem on the latest version.
seven332 commentedon Dec 13, 2024
Here it is. #23151