Skip to content

Commit

Permalink
Run test_subdata in webgl2 mode. (emscripten-core#21398)
Browse files Browse the repository at this point in the history
This involved improving the emulation in glTexSubImage2D.

Sadly I needed to disable this new tests in 4gb+ mode since it runs
into a chromium bug.
  • Loading branch information
sbc100 committed Feb 22, 2024
1 parent 9e8f698 commit 34c83d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/library_webgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,9 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
if (internalFormat == 0x84f9 /*GL_DEPTH_STENCIL*/) {
internalFormat = 0x88F0 /*GL_DEPTH24_STENCIL8*/;
}
if (internalFormat == 0x1908 /*GL_RGBA*/ && type == 0x1406 /*GL_FLOAT*/) {
internalFormat = 0x8814 /*GL_RGBA32F*/;
}
}
#endif
if ({{{ isCurrentContextWebGL2() }}}) {
Expand Down
10 changes: 8 additions & 2 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2323,8 +2323,14 @@ def test_float_tex(self):
self.btest('float_tex.c', reference='float_tex.png', args=['-lGL', '-lglut'])

@requires_graphics_hardware
def test_subdata(self):
self.btest('gl_subdata.c', reference='float_tex.png', args=['-lGL', '-lglut'])
@parameterized({
'': ([],),
'es2': (['-sMIN_WEBGL_VERSION=2', '-sFULL_ES2', '-sWEBGL2_BACKWARDS_COMPATIBILITY_EMULATION'],),
})
def test_subdata(self, args):
if self.is_4gb() and args:
self.skipTest('texSubImage2D fails: https://crbug.com/325090165')
self.btest('gl_subdata.c', reference='float_tex.png', args=['-lGL', '-lglut'] + args)

@requires_graphics_hardware
def test_perspective(self):
Expand Down

0 comments on commit 34c83d8

Please sign in to comment.