| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| index ceabff8aaa3c69d74399d1b7d302a8c201b7bc25..39e1104729dee81d47fe0b7e84fcdc2b7aec5b50 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -13261,10 +13261,16 @@ void GLES2DecoderImpl::DoCopyTexSubImage3D(
|
| return;
|
| }
|
|
|
| + // For 3D textures, we always clear the entire texture. See the code in
|
| + // TextureManager::ValidateAndDoTexSubImage for TexSubImage3D.
|
| + if (!texture->IsLevelCleared(target, level)) {
|
| + texture_manager()->ClearTextureLevel(this, texture_ref, target, level);
|
| + DCHECK(texture->IsLevelCleared(target, level));
|
| + }
|
| +
|
| // TODO(yunchao): Follow-up CLs are necessary. For instance:
|
| // 1. emulation of unsized formats in core profile
|
| - // 2. clear the 3d textures if it is uncleared.
|
| - // 3. out-of-bounds reading, etc.
|
| + // 2. out-of-bounds reading, etc.
|
|
|
| glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width,
|
| height);
|
|
|