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/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 3243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3254 { | 3254 { |
3255 ScopedTextureUploadTimer timer(texture_state); | 3255 ScopedTextureUploadTimer timer(texture_state); |
3256 if (args.command_type == DoTexImageArguments::kTexImage3D) { | 3256 if (args.command_type == DoTexImageArguments::kTexImage3D) { |
3257 glTexImage3D( | 3257 glTexImage3D( |
3258 args.target, args.level, | 3258 args.target, args.level, |
3259 AdjustTexInternalFormat(feature_info_.get(), args.internal_format), | 3259 AdjustTexInternalFormat(feature_info_.get(), args.internal_format), |
3260 args.width, args.height, args.depth, args.border, | 3260 args.width, args.height, args.depth, args.border, |
3261 AdjustTexFormat(feature_info_.get(), args.format), args.type, | 3261 AdjustTexFormat(feature_info_.get(), args.format), args.type, |
3262 args.pixels); | 3262 args.pixels); |
3263 } else { | 3263 } else { |
3264 if (feature_info_->workarounds().reset_teximage2d_base_level) { | |
3265 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); | |
Ken Russell (switch to Gerrit)
2017/04/28 19:04:25
Does this have the correct effect in all cases? Th
yizhou.jiang
2017/06/09 07:58:16
No, I have only investigated GL_TEXTURE_2D, I will
| |
3266 } | |
3264 glTexImage2D( | 3267 glTexImage2D( |
3265 args.target, args.level, | 3268 args.target, args.level, |
3266 AdjustTexInternalFormat(feature_info_.get(), args.internal_format), | 3269 AdjustTexInternalFormat(feature_info_.get(), args.internal_format), |
3267 args.width, args.height, args.border, | 3270 args.width, args.height, args.border, |
3268 AdjustTexFormat(feature_info_.get(), args.format), args.type, | 3271 AdjustTexFormat(feature_info_.get(), args.format), args.type, |
3269 args.pixels); | 3272 args.pixels); |
3273 if (feature_info_->workarounds().reset_teximage2d_base_level) { | |
3274 Texture* texture = texture_ref->texture(); | |
3275 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, | |
3276 texture->base_level()); | |
3277 } | |
3270 } | 3278 } |
3271 } | 3279 } |
3272 GLenum error = ERRORSTATE_PEEK_GL_ERROR(error_state, function_name); | 3280 GLenum error = ERRORSTATE_PEEK_GL_ERROR(error_state, function_name); |
3273 if (args.command_type == DoTexImageArguments::kTexImage3D) { | 3281 if (args.command_type == DoTexImageArguments::kTexImage3D) { |
3274 UMA_HISTOGRAM_CUSTOM_ENUMERATION("GPU.Error_TexImage3D", error, | 3282 UMA_HISTOGRAM_CUSTOM_ENUMERATION("GPU.Error_TexImage3D", error, |
3275 GetAllGLErrors()); | 3283 GetAllGLErrors()); |
3276 } else { | 3284 } else { |
3277 UMA_HISTOGRAM_CUSTOM_ENUMERATION("GPU.Error_TexImage2D", error, | 3285 UMA_HISTOGRAM_CUSTOM_ENUMERATION("GPU.Error_TexImage2D", error, |
3278 GetAllGLErrors()); | 3286 GetAllGLErrors()); |
3279 } | 3287 } |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3684 uint32_t TextureManager::GetServiceIdGeneration() const { | 3692 uint32_t TextureManager::GetServiceIdGeneration() const { |
3685 return current_service_id_generation_; | 3693 return current_service_id_generation_; |
3686 } | 3694 } |
3687 | 3695 |
3688 void TextureManager::IncrementServiceIdGeneration() { | 3696 void TextureManager::IncrementServiceIdGeneration() { |
3689 current_service_id_generation_++; | 3697 current_service_id_generation_++; |
3690 } | 3698 } |
3691 | 3699 |
3692 } // namespace gles2 | 3700 } // namespace gles2 |
3693 } // namespace gpu | 3701 } // namespace gpu |
OLD | NEW |