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

Issue 636626 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 429053
issue 631934



Sign in to add a comment

CopyTexSubImage3D should clear the uncleared texture

Project Member Reported by yunchao...@intel.com, Aug 11 2016

Issue description

Chromium have not implemented this feature yet. This test case can expose the error: https://github.com/KhronosGroup/WebGL/pull/1960. 

 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3972370575795597962787da7449243bd1d5d57b

commit 3972370575795597962787da7449243bd1d5d57b
Author: yunchao.he <yunchao.he@intel.com>
Date: Thu Aug 11 07:32:02 2016

Command buffer: CopyTexSubImage3D should clear the 3D texture if it is uncleared

BUG= 631934 ,  636626 
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/2232743002
Cr-Commit-Position: refs/heads/master@{#411283}

[modify] https://crrev.com/3972370575795597962787da7449243bd1d5d57b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
[modify] https://crrev.com/3972370575795597962787da7449243bd1d5d57b/gpu/command_buffer/service/gles2_cmd_decoder.cc
[modify] https://crrev.com/3972370575795597962787da7449243bd1d5d57b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc

Comment 2 Deleted

(Sorry, wrote comments to a wrong crbug).
Zhenyao and Ken, I have one question about clear the uncleared texture. 

As you know, on command buffer service side, we have a class TextureManager to manage the texture related information. In TextureManager, we have complicated code to set/get the cleared rect for a particular mipmap level for 2D texture. 
But for 3D texture, we just simply clear the entire texture. So I wonder do we also need to upgrade the code to clear a small rect for a specific level/layer for 3D texture? In this CL: https://codereview.chromium.org/2208733002/. I tried to follow the design and add LayerInfo to LevelInfo to clear a small rect for a specific layer of a mipmap level for 3D texture. 
But I am not sure whether this logic is necessary. 
Why it is necessary for 2D/3D texture to clear a small rect? For instance, If a specific level of the texture is 4*4, and we only read a 2*2 rect from fbo by CopyTex{Sub}Image2D to the texture, then we just clear the 2*2 rect. If we read another 2*2 next to the previous rect, we will clear this 2*2 rect, and combine the cleared rect to 2*4. why don't we clear the entire mipmap level (4*4) at the first time, and don't need to care about the cleared rect in following operations? In addition, we don't need so many complicated code to manage the cleared rect.
 
I guess that we can initialize as small part as possible for texture. So we can upload a small bunch of data and save the memory bandwidth and improve the perf for some cases. If this is true, should we clear a small part for 3D texture too, instead of clearing the entire 3D texture? You know, a 3D texture may be very big, need to upload lots of data (zeros).

Any comments?
Cc: piman@chromium.org
add piman to the cc list

Comment 5 by zmo@chromium.org, Aug 15 2016

For 2D textures it's necessary for performance reasons.  For example, compositor might allocate a large texture and gradually fill it up.  So we could avoid the initialization-to-zero if we fill up the entire texture before using it.

This is not a use case for 3D textures. As you mentioned, it's complicated logic (even more complicated for 3D) so we just do simple lazy initialization for 3D textures.  I feel that's enough for now.
OK. Thanks for your explanation, Zhenyao. Then simply clear the entire 3D texture during lazy initialization is OK. We don't need to clear a small rect for a specific layer/level for 3D texture. 

So this crbug is fixed. I will close this change which try to clear a small rect for a particular layer/level for 3D texture at https://codereview.chromium.org/2208733002/. 
Status: Fixed (was: Started)

Sign in to add a comment