conformance/textures/image_bitmap_from_canvas fails in WebGL2 on Win/Mac |
|||||||
Issue descriptionOpen chrome browser with --enable-unsafe-es3-apis goto https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html?version=2.0.0 run the conformance/textures/image_bitmap_from_canvas tests, they all fail with an INVALID_OPERATION generated in command buffer. However, if you run conformance2/textures/image_bitmap_from_canvas, these tests all pass. Such failures are only seen on Windows and Mac, but not on Linux. The reason is Linux does not GPU accelerate 2D canvas.
,
Jul 18 2016
That's because we mark the tests as expected to fail. You can just open chrome browser with --enable-unsafe-es3-apis and see them fail in WebGL 2.
,
Jul 18 2016
,
Jul 18 2016
reproducible on Linux as well, we just need to enable the "Accelerated 2D canvas" on chrome://flags
,
Jul 19 2016
updates:
In those tests, it is testing multiple cases like this:
cases = [
{sub: false, ...},
{sub: true, ...},
...
];
where sub is true indicating use of texSubImage2D. I found that by commenting out either one of these two, the entire tests pass, but running both fails. It is strange...
,
Jul 19 2016
When running both, the error happens when sub is true, and the error message is: [142990:142990:0719/093315:ERROR:texture_manager.cc(2203)] [.Offscreen-For-WebGL-0x1ed4b21aac00]GL ERROR :GL_INVALID_OPERATION : glTexSubImage2D: invalid internalformat/format/type combination [142990:142990:0719/093315:ERROR:vertex_attrib_manager.cc(202)] [.Offscreen-For-WebGL-0x1ed4b21aac00]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 0 I did a fprintf on internalformat/format/type, and the internalformat for texSubImage2D is always 0, the format/type combinations are: 6408 5121 6408 32819 6408 32820 6407 5121 6407 33635
,
Jul 19 2016
Just an extra info: The bug can be reproducible on linux by running the conformance tests using the following command line: content/test/gpu/run_gpu_test.py webgl_conformance --show-stdout --browser=default -v '--extra-browser-args=--ignore-gpu-blacklist --enable-unsafe-es3-apis' '--webgl-conformance-version=2.0.0' --story-filter=conformance_textures_image_bitmap_from_canvas*
,
Jul 19 2016
Here is what I have found:
The tests will call the function canUseTexImageByGPU() to determine whether to use GPU-GPU texture copy or not. This function has this line:
if (functionID == TexSubImage2D && (isWebGL2OrHigher() ||...)
return false;
So basically when doing TexSubImage2D with WebGL2, it always does a GPU memory readback, that somehow fails. If I make it a special case for ImageBitmap, and asking it to do GPU-GPU texture copy for conformance1 tests, they will pass.
Is there a good way to test whether a combination of format+type is a conformance1 test?
,
Jul 19 2016
It seems to me the code path is confused about whether it's using readback path or GPU-GPU path somewhere. Even if we return false in canUseTexImageByGPU() and fall back to readback path. It should just work (and it works on Linux when the canvas is not hardware accelerated). So there must be a bug somewhere it's confused about whether it's readback path or GPU-GPU path.
,
Jul 19 2016
In each html test file, it includes multiple test cases like this:
cases = [
{sub: false, ...},
{sub: true, ...},
...
];
Using fprintf I can see that it does GPU-GPU path when sub=false, and using readback path when sub=true, the problem is that it gives the error when doing the readback path, which makes no sense...
,
Jul 19 2016
I suggest you compare the code paths on Linux between when you enable accelerated 2d canvas and when you disable it. You should have a feeling where things go run when the path begin to differ.
In WebGL 2, they should both go down the the readback path (until we fix the copy{Sub}TextureCHROMIUM to work for all formats).
,
Jul 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f5c988930b7a2f2aacd7cabf2573caeed2770b69 commit f5c988930b7a2f2aacd7cabf2573caeed2770b69 Author: xidachen <xidachen@chromium.org> Date: Wed Jul 20 20:48:31 2016 Invalidate m_image after GPU-GPU texture copy The image_bitmap_from_canvas conformance1 tests are failing with WebGL 2.0. It fails in this case: Call texImage2D(ImageBitmap), which does GPU-GPU texture copy. Then call texSubImage2D(ImageBitmap), which does GPU readback. In the call to texSubImage2D, there is a error says glTexSubImage2D: invalid internalformat/format/type combination, which doesn't make sense. The solution here is to set m_image to be null after GPU-GPU texture copy. So next time when m_image is needed, it has to use a new context provider to consume the mailbox to get a new m_image. To make sure this CL does the right thing, I have tested the following: conformance1 tests with WebGL 1.0 and 2.0 (with GPU accelerated canvas) conformance2 tests (with GPU accelerated canvas, WebGL 2.0 only) layout tests: fast/canvas/, virtual/gpu/fast/canvas, virtual/display_list_2d_canvas/fast/canvas. All the above tests pass. When committing this CL, we should add the optional GPU bots to make sure they are green. BUG= 628954 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2165913003 Cr-Commit-Position: refs/heads/master@{#406660} [modify] https://crrev.com/f5c988930b7a2f2aacd7cabf2573caeed2770b69/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py [modify] https://crrev.com/f5c988930b7a2f2aacd7cabf2573caeed2770b69/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp [modify] https://crrev.com/f5c988930b7a2f2aacd7cabf2573caeed2770b69/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
,
Jul 21 2016
Just double checked on windows with canary: With --enable-unsafe-es3-apis, there are still 3 formats failed on windows which are unsigned_short_5_6_5, unsigned_short_4_4_4_4, unsigned_short_5_5_5_1 With --enable-unsafe-es3-apis --use-gl=desktop, these three formats passes.
,
Jul 21 2016
jmadill said he will look into ANGLE.
,
Jul 22 2016
Looking.
,
Jul 22 2016
This is actually a duplicate of the same issue with CopyTexImage validation and unsized formats. Will look at fixing this today.
,
Jul 23 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dd5bcd3ee0e38d0622de580545fdfe43f4131395 commit dd5bcd3ee0e38d0622de580545fdfe43f4131395 Author: jmadill <jmadill@chromium.org> Date: Sat Jul 23 18:33:17 2016 WebGL 2: Update expectations. BUG= 628954 , 483282 , 478572 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel TBR=zmo@chromium.org NOTRY=true Review-Url: https://codereview.chromium.org/2177763002 Cr-Commit-Position: refs/heads/master@{#407371} [modify] https://crrev.com/dd5bcd3ee0e38d0622de580545fdfe43f4131395/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
,
Aug 1 2016
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by xidac...@chromium.org
, Jul 18 2016