CopyTexSubImage3D should clear the uncleared texture |
|||
Issue descriptionChromium have not implemented this feature yet. This test case can expose the error: https://github.com/KhronosGroup/WebGL/pull/1960.
,
Aug 11 2016
(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?
,
Aug 12 2016
add piman to the cc list
,
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.
,
Aug 16 2016
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/.
,
Aug 16 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Aug 11 2016