RESOLVED FIXED 212277
[ANGLE - iOS] webgl/1.0.3/conformance/extensions/ext-sRGB.html is failing
https://bugs.webkit.org/show_bug.cgi?id=212277
Summary [ANGLE - iOS] webgl/1.0.3/conformance/extensions/ext-sRGB.html is failing
Justin Fan
Reported 2020-05-22 13:53:02 PDT
on iOS/Simulator, webgl/1.0.3/conformance/extensions/ext-sRGB.html is failing with the console message *** Error loading shader '[object WebGLShader]':INVALID_ENUM. Doing some digging to find exactly where in ANGLE the error is registered.
Attachments
Patch (5.20 KB, patch)
2020-05-22 18:21 PDT, Kenneth Russell
no flags
Radar WebKit Bug Importer
Comment 1 2020-05-22 13:53:18 PDT
Justin Fan
Comment 2 2020-05-22 16:04:28 PDT
It appears a context error is being generated in rx::TextureGL::setImageHelper during texImage2D: an rx::CheckError call is handling an "Unexpected driver error." and bailing. Still not able to find what that error IS, though, and my breakpoints in WebKit and ANGLE's error generation functions aren't being hit before this point.
Justin Fan
Comment 3 2020-05-22 16:10:50 PDT
I think some sort of setup code for ANGLE's FunctionsGL is reporting an INVALID_ENUM error before texImage2D is called; the validation path for texImage2D is just stumbling upon it and bailing as a result.
Kenneth Russell
Comment 4 2020-05-22 16:49:58 PDT
I'll investigate this - already set up to do so.
Kenneth Russell
Comment 5 2020-05-22 17:08:49 PDT
Current output of the test: Canvas.getContext PASS context exists Checking sRGB texture support with extension disabled Checking texture formats Checking valid formats PASS not able to create invalid format: ext.SRGB_EXT PASS not able to create invalid format: ext.SRGB_ALPHA_EXT Checking invalid formats PASS not able to create invalid format: ext.SRGB8_ALPHA8_EXT Checking renderbuffer formats Checking valid formats PASS not able to create invalid format: ext.SRGB8_ALPHA8_EXT Checking invalid formats PASS not able to create invalid format: ext.SRGB_EXT PASS not able to create invalid format: ext.SRGB_ALPHA_EXT Checking sRGB texture support PASS Successfully enabled EXT_sRGB extension PASS EXT_sRGB listed as supported and getExtension succeeded Checking extension constants values PASS Value of SRGB_EXT was expected value: 35904 PASS Value of SRGB_ALPHA_EXT was expected value: 35906 PASS Value of SRGB8_ALPHA8_EXT was expected value: 35907 PASS Value of FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT was expected value: 33296 Checking texture formats Checking valid formats FAIL getError expected: NO_ERROR. Was INVALID_ENUM : was able to create type ext.SRGB_EXT FAIL getError expected: NO_ERROR. Was INVALID_ENUM : was able to create type ext.SRGB_ALPHA_EXT Checking invalid formats PASS not able to create invalid format: ext.SRGB8_ALPHA8_EXT Checking renderbuffer formats Checking valid formats PASS getError was expected value: NO_ERROR : was able to create type ext.SRGB8_ALPHA8_EXT Checking invalid formats PASS not able to create invalid format: ext.SRGB_EXT PASS not able to create invalid format: ext.SRGB_ALPHA_EXT Test the conversion of colors from sRGB to linear on texture read PASS should be 0 PASS should be 13 PASS should be 54 PASS should be 133 PASS should be 255 Test sRGB framebuffer attachments. (Invalid) FAIL getError expected: NO_ERROR. Was INVALID_ENUM : FAIL gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT) should be 35904. Was 0. PASS gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT FAIL getError expected: INVALID_FRAMEBUFFER_OPERATION. Was INVALID_VALUE : Test sRGB_ALPHA framebuffer attachments. FAIL getError expected: NO_ERROR. Was INVALID_ENUM : FAIL gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT) should be 35904. Was 0. FAIL gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be 36053. Was 36054. Test the conversion of colors from linear to sRGB_ALPHA on framebuffer (texture) write FAIL getError expected: NO_ERROR. Was INVALID_VALUE : PASS should be 0 FAIL getError expected: NO_ERROR. Was INVALID_FRAMEBUFFER_OPERATION : PASS should be 63 FAIL getError expected: NO_ERROR. Was INVALID_VALUE : PASS should be 127 FAIL getError expected: NO_ERROR. Was INVALID_FRAMEBUFFER_OPERATION : PASS should be 191 FAIL getError expected: NO_ERROR. Was INVALID_VALUE : PASS should be 255 Test the conversion of colors from linear to sRGB on framebuffer (renderbuffer) write PASS getError was expected value: NO_ERROR : PASS getError was expected value: NO_ERROR : PASS gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT) is ext.SRGB_EXT PASS gl.checkFramebufferStatus(gl.FRAMEBUFFER) is gl.FRAMEBUFFER_COMPLETE PASS should be 0 PASS should be 63 PASS should be 127 PASS should be 191 PASS should be 255 PASS successfullyParsed is true TEST COMPLETE
Kenneth Russell
Comment 6 2020-05-22 17:23:35 PDT
Justin, your analysis is 100% correct. The error's caught by rx::CheckError in renderergl_utils.cpp. It's 0x0500 - GL_INVALID_ENUM - coming from the call to the driver: glTexImage2D(GL_TEXTURE_2D, /* level */ 0, GL_SRGB_EXT, 16, 16, 0, GL_SRGB_EXT, GL_UNSIGNED_BYTE, nullptr); ANGLE needs to translate these constants when running on an ES 3.0 driver that doesn't support GL_EXT_sRGB. Per other investigations on iOS in https://bugs.chromium.org/p/angleproject/issues/detail?id=4591 , these are the extensions the driver supports: GL_OES_standard_derivatives GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_texture_filter_anisotropic GL_APPLE_clip_distance GL_APPLE_color_buffer_packed_float GL_APPLE_copy_texture_levels GL_APPLE_rgb_422 GL_APPLE_texture_format_BGRA8888 GL_IMG_read_format GL_IMG_texture_compression_pvrtc
Kenneth Russell
Comment 7 2020-05-22 17:25:39 PDT
Note that GL_SRGB_EXT == GL_SRGB in ES 3.0 == 0x8C40.
Kenneth Russell
Comment 8 2020-05-22 18:01:43 PDT
Translating the call to: glTexImage2D(GL_TEXTURE_2D, /* level */ 0, GL_SRGB8, 16, 16, 0, GL_SRGB, GL_UNSIGNED_BYTE, nullptr); is still generating a GL_INVALID_OPERATION in the driver. Still investigating.
Kenneth Russell
Comment 9 2020-05-22 18:07:12 PDT
Have to translate the format to a non-sRGB format, too.
Kenneth Russell
Comment 10 2020-05-22 18:21:10 PDT
EWS Watchlist
Comment 11 2020-05-22 18:21:39 PDT
Note that there are important steps to take when updating ANGLE. See http://trac.webkit.org/wiki/UpdatingANGLE
Kenneth Russell
Comment 12 2020-05-22 18:22:07 PDT
Patch is up for review. This makes ext-sRGB.html pass locally on the iOS Simulator. Since the CQ doesn't seem to wait for the ios-wk2 bot to finish, I'd like to set the CQ bit on this myself after review, once all the EWS bots have passed.
Kenneth Russell
Comment 13 2020-05-22 18:41:50 PDT
Actually - in case I'm out, Dean, would you mind CQ+'ing this if it passes all the bots? Thanks.
Dean Jackson
Comment 14 2020-05-22 19:09:51 PDT
windows test failure is unrelated (imported/blink/fast/css/fixed-overlaps-absolute-in-clip.html)
EWS
Comment 15 2020-05-22 19:26:33 PDT
Committed r262091: <https://trac.webkit.org/changeset/262091> All reviewed patches have been landed. Closing bug and clearing flags on attachment 400098 [details].
Note You need to log in before you can comment on or make changes to this bug.