| OLD | NEW |
| 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 13243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13254 return; | 13254 return; |
| 13255 } | 13255 } |
| 13256 | 13256 |
| 13257 if (FormsTextureCopyingFeedbackLoop(texture_ref, level, zoffset)) { | 13257 if (FormsTextureCopyingFeedbackLoop(texture_ref, level, zoffset)) { |
| 13258 LOCAL_SET_GL_ERROR( | 13258 LOCAL_SET_GL_ERROR( |
| 13259 GL_INVALID_OPERATION, | 13259 GL_INVALID_OPERATION, |
| 13260 func_name, "source and destination textures are the same"); | 13260 func_name, "source and destination textures are the same"); |
| 13261 return; | 13261 return; |
| 13262 } | 13262 } |
| 13263 | 13263 |
| 13264 // For 3D textures, we always clear the entire texture. See the code in |
| 13265 // TextureManager::ValidateAndDoTexSubImage for TexSubImage3D. |
| 13266 if (!texture->IsLevelCleared(target, level)) { |
| 13267 texture_manager()->ClearTextureLevel(this, texture_ref, target, level); |
| 13268 DCHECK(texture->IsLevelCleared(target, level)); |
| 13269 } |
| 13270 |
| 13264 // TODO(yunchao): Follow-up CLs are necessary. For instance: | 13271 // TODO(yunchao): Follow-up CLs are necessary. For instance: |
| 13265 // 1. emulation of unsized formats in core profile | 13272 // 1. emulation of unsized formats in core profile |
| 13266 // 2. clear the 3d textures if it is uncleared. | 13273 // 2. out-of-bounds reading, etc. |
| 13267 // 3. out-of-bounds reading, etc. | |
| 13268 | 13274 |
| 13269 glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, | 13275 glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, |
| 13270 height); | 13276 height); |
| 13271 | 13277 |
| 13272 // This may be a slow command. Exit command processing to allow for | 13278 // This may be a slow command. Exit command processing to allow for |
| 13273 // context preemption and GPU watchdog checks. | 13279 // context preemption and GPU watchdog checks. |
| 13274 ExitCommandProcessingEarly(); | 13280 ExitCommandProcessingEarly(); |
| 13275 } | 13281 } |
| 13276 | 13282 |
| 13277 error::Error GLES2DecoderImpl::HandleTexSubImage2D(uint32_t immediate_data_size, | 13283 error::Error GLES2DecoderImpl::HandleTexSubImage2D(uint32_t immediate_data_size, |
| (...skipping 4447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17725 } | 17731 } |
| 17726 | 17732 |
| 17727 // Include the auto-generated part of this file. We split this because it means | 17733 // Include the auto-generated part of this file. We split this because it means |
| 17728 // we can easily edit the non-auto generated parts right here in this file | 17734 // we can easily edit the non-auto generated parts right here in this file |
| 17729 // instead of having to edit some template or the code generator. | 17735 // instead of having to edit some template or the code generator. |
| 17730 #include "base/macros.h" | 17736 #include "base/macros.h" |
| 17731 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 17737 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 17732 | 17738 |
| 17733 } // namespace gles2 | 17739 } // namespace gles2 |
| 17734 } // namespace gpu | 17740 } // namespace gpu |
| OLD | NEW |