New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 605129 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
OOO until 2019-01-24
Closed: May 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 663960



Sign in to add a comment

WebGL2.0: glTexStorage2D does not work with DXT compressed textures

Project Member Reported by mar...@unity3d.com, Apr 20 2016

Issue description

UserAgent: 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.
 
Components: Blink>WebGL
Labels: -OS-Windows M-52 OS-All
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Windows 7, Ubuntu 14.04 and Mac OS 10.11.4 using chrome latest canary M52-52.0.2713. Observed the UI renders correctly and no content is played.

Note: This issue is working fine on firefox.

This is a non-regression issue in chrome seen from past M35-35.0.1851.0, Hence marking it as untriaged.

Comment 2 by jo...@unity3d.com, 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.
 Issue 605535  has been merged into this issue.
Closing other issue as duplicate. The non-unity test case is: http://jsfiddle.net/sao57n60/1/

Comment 5 by kbr@chromium.org, Apr 22 2016

 Issue 605387  has been merged into this issue.

Comment 6 by kbr@chromium.org, Apr 22 2016

Labels: -Type-Compat Type-Bug

Comment 7 by kbr@chromium.org, 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.

compressed-tex-storage-2d.html
406 bytes View Download
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.

Comment 9 by zmo@chromium.org, 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.

Comment 10 by kbr@chromium.org, Apr 25 2016

Owner: kbr@chromium.org
Status: Started (was: Untriaged)
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.

Comment 11 by kbr@chromium.org, 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.

Project Member

Comment 12 by bugdroid1@chromium.org, 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

Comment 13 by kbr@chromium.org, 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.

Comment 14 by kbr@chromium.org, May 5 2016

Status: Fixed (was: Started)
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.

Comment 15 by kbr@chromium.org, May 5 2016

Status: Started (was: Fixed)
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.

Project Member

Comment 16 by bugdroid1@chromium.org, 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

Comment 17 by kbr@chromium.org, May 6 2016

Status: Fixed (was: Started)
Calling this fixed at this point.

Comment 18 by zmo@chromium.org, Nov 10 2016

Blocking: 663280

Comment 19 by kbr@chromium.org, Nov 10 2016

Blocking: 663960

Comment 20 by kbr@chromium.org, Nov 10 2016

Blocking: -663280

Sign in to add a comment