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

Side by Side 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: small revisions 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 unified diff | Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 13284 matching lines...) Expand 10 before | Expand all | Expand 10 after
13295 return; 13295 return;
13296 } 13296 }
13297 13297
13298 if (FormsTextureCopyingFeedbackLoop(texture_ref, level, zoffset)) { 13298 if (FormsTextureCopyingFeedbackLoop(texture_ref, level, zoffset)) {
13299 LOCAL_SET_GL_ERROR( 13299 LOCAL_SET_GL_ERROR(
13300 GL_INVALID_OPERATION, 13300 GL_INVALID_OPERATION,
13301 func_name, "source and destination textures are the same"); 13301 func_name, "source and destination textures are the same");
13302 return; 13302 return;
13303 } 13303 }
13304 13304
13305 // For 3D textures, we always clear the entire texture. See the code in
13306 // TextureManager::ValidateAndDoTexSubImage for TexSubImage3D.
13307 if (!texture->IsLevelCleared(target, level)) {
13308 texture_manager()->ClearTextureLevel(this, texture_ref, target, level);
13309 DCHECK(texture->IsLevelCleared(target, level));
13310 }
13311
13305 // TODO(yunchao): Follow-up CLs are necessary. For instance: 13312 // TODO(yunchao): Follow-up CLs are necessary. For instance:
13306 // 1. emulation of unsized formats in core profile 13313 // 1. emulation of unsized formats in core profile
13307 // 2. clear the 3d textures if it is uncleared. 13314 // 2. out-of-bounds reading, etc.
Zhenyao Mo 2016/08/10 20:27:20 Can you file a bug for this? Comments in the code
13308 // 3. out-of-bounds reading, etc.
13309 13315
13310 glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, 13316 glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width,
13311 height); 13317 height);
13312 13318
13313 // This may be a slow command. Exit command processing to allow for 13319 // This may be a slow command. Exit command processing to allow for
13314 // context preemption and GPU watchdog checks. 13320 // context preemption and GPU watchdog checks.
13315 ExitCommandProcessingEarly(); 13321 ExitCommandProcessingEarly();
13316 } 13322 }
13317 13323
13318 error::Error GLES2DecoderImpl::HandleTexSubImage2D(uint32_t immediate_data_size, 13324 error::Error GLES2DecoderImpl::HandleTexSubImage2D(uint32_t immediate_data_size,
(...skipping 4439 matching lines...) Expand 10 before | Expand all | Expand 10 after
17758 } 17764 }
17759 17765
17760 // Include the auto-generated part of this file. We split this because it means 17766 // Include the auto-generated part of this file. We split this because it means
17761 // we can easily edit the non-auto generated parts right here in this file 17767 // we can easily edit the non-auto generated parts right here in this file
17762 // instead of having to edit some template or the code generator. 17768 // instead of having to edit some template or the code generator.
17763 #include "base/macros.h" 17769 #include "base/macros.h"
17764 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 17770 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
17765 17771
17766 } // namespace gles2 17772 } // namespace gles2
17767 } // namespace gpu 17773 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698