WebGL2.0: glTexStorage2D does not work with DXT compressed textures |
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36 Example URL: Steps to reproduce the problem: Open the attached webgl content: https://oc.unity3d.com/index.php/s/mxJf8twffDkkhyy What is the expected behavior? What went wrong? Nothing, except the UI renders correctly. There are several warnings in the log: WebGL: INVALID_ENUM: texStorage2D: invalid internalformat So, I believe the upload of several textures failed. Does it occur on multiple sites: N/A Is it a problem with a plugin? N/A Did this work before? N/A Does this work in other browsers? N/A Chrome version: 52.0.2713.0 Channel: canary OS Version: 10.0 Flash Version: Shockwave Flash 21.0 r0 To see expected results, run the same content on Chrome, which will use webgl 1.0 on webgl 1.0, we use glTexImage2D. Whereas on webgl2.0 we use glTexStorage2D. The warnings occur for GL_COMPRESSED_RGB_S3TC_DXT1_EXT and GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.
,
Apr 21 2016
I just realized that my colleague submitted this bug here, which is probably identical to the one I just submitted: https://bugs.chromium.org/p/chromium/issues/detail?id=605535 So one can probably be closed as duplicate. The other one has a simple, non-Unity repro case.
,
Apr 21 2016
Issue 605535 has been merged into this issue.
,
Apr 21 2016
Closing other issue as duplicate. The non-unity test case is: http://jsfiddle.net/sao57n60/1/
,
Apr 22 2016
Issue 605387 has been merged into this issue.
,
Apr 22 2016
,
Apr 22 2016
I hadn't realized this bug had been filed, filed Issue 605387 about it and wrote the attached minimized test case for it.
,
Apr 22 2016
The error is produced in WebGL2RenderingContextBase::validateTexStorage at this line if (m_supportedInternalFormatsStorage.find(internalformat) == m_supportedInternalFormatsStorage.end()) {
Adding the S3TC formats to the list of supported formats made the error go away but from what I understand we might still want to give an error in WebGL1 or when some extensions are not supported.
,
Apr 22 2016
We might be able to remove blink side validation and rely command buffer (and in the future MANGLE) to do the validation.
,
Apr 25 2016
I've started work on this. More work is needed than simply treating the compressed texture formats as valid internal formats in WebGL2RenderingContextBase. This is the first time that a compressed texture can require the level clearing code (Texture::ClearLevel), since it was previously required that compressed textures were allocated with CompressedTexImage2D. The level clearing code doesn't support compressed textures yet, and it's not feasible to clear a sub-portion of some of the compressed texture formats since they only work on block boundaries, so the clearing logic will have to be adjusted.
,
Apr 28 2016
https://github.com/KhronosGroup/WebGL/pull/1641 expands the conformance tests and https://codereview.chromium.org/1925093002 makes the new tests pass in Chromium.
,
May 3 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5e216d9b62275101c30f4a5cb2174bb68970ef3c commit 5e216d9b62275101c30f4a5cb2174bb68970ef3c Author: kbr <kbr@chromium.org> Date: Tue May 03 01:15:17 2016 Handle compressed textures allocated via TexStorage2D. Compressed internal formats should be allowed as arguments to TexStorage2D. Textures allocated in this way are also cleared lazily, either just before the first CompressedTexSubImage2D if it does not cover the entire mipmap level, or if they're sampled. https://github.com/KhronosGroup/WebGL/pull/1641 expands the webgl-compressed-texture-s3tc.html conformance test to cover this behavior. BUG= 605129 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel;tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/1925093002 Cr-Commit-Position: refs/heads/master@{#391139} [modify] https://crrev.com/5e216d9b62275101c30f4a5cb2174bb68970ef3c/gpu/command_buffer/service/gles2_cmd_decoder.cc [modify] https://crrev.com/5e216d9b62275101c30f4a5cb2174bb68970ef3c/gpu/command_buffer/service/gles2_cmd_decoder.h [modify] https://crrev.com/5e216d9b62275101c30f4a5cb2174bb68970ef3c/gpu/command_buffer/service/gles2_cmd_decoder_mock.h [modify] https://crrev.com/5e216d9b62275101c30f4a5cb2174bb68970ef3c/gpu/command_buffer/service/texture_manager.cc [modify] https://crrev.com/5e216d9b62275101c30f4a5cb2174bb68970ef3c/gpu/command_buffer/service/texture_manager_unittest.cc [modify] https://crrev.com/5e216d9b62275101c30f4a5cb2174bb68970ef3c/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
,
May 5 2016
There's some other texture-related problem affecting Unity's WebGL 2.0 export path that I'm continuing to look into. Until I'm sure it's not related to compressed textures I'll leave this bug open.
,
May 5 2016
As far as I can tell, the remaining problems with Unity's WebGL 2.0 content being unable to allocate renderable textures are on Unity's side -- possibly with feature detection. There don't seem to be any OpenGL errors being generated on Chrome that aren't also generated on Firefox. Closing this as fixed.
,
May 5 2016
Actually, I'll make one more CL against this bug to make it a little easier to diagnose some of the GL errors that are being generated.
,
May 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a3692c199187bf625e3caffb3bad4789359ff840 commit a3692c199187bf625e3caffb3bad4789359ff840 Author: kbr <kbr@chromium.org> Date: Fri May 06 00:58:25 2016 Improve detail of some texture-related errors. Some of these errors are showing up in the web console for the affected application. Having more detail speeds up debugging on Chrome's side. BUG= 605129 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel;tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/1955723002 Cr-Commit-Position: refs/heads/master@{#391972} [modify] https://crrev.com/a3692c199187bf625e3caffb3bad4789359ff840/gpu/command_buffer/service/gles2_cmd_decoder.cc [modify] https://crrev.com/a3692c199187bf625e3caffb3bad4789359ff840/gpu/command_buffer/service/texture_manager.cc
,
May 6 2016
Calling this fixed at this point.
,
Nov 10 2016
,
Nov 10 2016
,
Nov 10 2016
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by brajkumar@chromium.org
, Apr 21 2016Labels: -OS-Windows M-52 OS-All
Status: Untriaged (was: Unconfirmed)