Skip to content

Commit 34c83d8

Browse files
authored
Run test_subdata in webgl2 mode. (#21398)
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.
1 parent 9e8f698 commit 34c83d8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/library_webgl.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,9 @@ for (/**@suppress{duplicate}*/var i = 0; i < {{{ GL_POOL_TEMP_BUFFERS_SIZE }}};
16631663
if (internalFormat == 0x84f9 /*GL_DEPTH_STENCIL*/) {
16641664
internalFormat = 0x88F0 /*GL_DEPTH24_STENCIL8*/;
16651665
}
1666+
if (internalFormat == 0x1908 /*GL_RGBA*/ && type == 0x1406 /*GL_FLOAT*/) {
1667+
internalFormat = 0x8814 /*GL_RGBA32F*/;
1668+
}
16661669
}
16671670
#endif
16681671
if ({{{ isCurrentContextWebGL2() }}}) {

test/test_browser.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2323,8 +2323,14 @@ def test_float_tex(self):
23232323
self.btest('float_tex.c', reference='float_tex.png', args=['-lGL', '-lglut'])
23242324

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

23292335
@requires_graphics_hardware
23302336
def test_perspective(self):

0 commit comments

Comments
 (0)