Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2232743002: Command buffer: CopyTexSubImage3D should clear the 3D texture if it is uncleared (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update webgl 2 expectation Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698