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 16627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16638 depth); | 16638 depth); |
16639 } | 16639 } |
16640 if (workarounds().reset_base_mipmap_level_before_texstorage && | 16640 if (workarounds().reset_base_mipmap_level_before_texstorage && |
16641 texture->base_level() > 0) | 16641 texture->base_level() > 0) |
16642 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); | 16642 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); |
16643 | 16643 |
16644 { | 16644 { |
16645 GLsizei level_width = width; | 16645 GLsizei level_width = width; |
16646 GLsizei level_height = height; | 16646 GLsizei level_height = height; |
16647 GLsizei level_depth = depth; | 16647 GLsizei level_depth = depth; |
16648 GLenum adjusted_format = internal_format; | 16648 GLenum adjusted_internal_format = |
16649 #if defined(OS_MACOSX) | 16649 feature_info_->context_type() == CONTEXT_TYPE_OPENGLES2 ? |
16650 // TODO(dshwang): remove it after fixing the root cause. crbug.com/657532 | 16650 format : internal_format; |
16651 adjusted_format = feature_info_->IsES3Enabled() ? internal_format : format; | |
16652 #endif | |
Zhenyao Mo
2016/10/31 18:14:40
I agree with Dongseong. Now you found the root pro
| |
16653 | |
16654 for (int ii = 0; ii < levels; ++ii) { | 16651 for (int ii = 0; ii < levels; ++ii) { |
16655 if (target == GL_TEXTURE_CUBE_MAP) { | 16652 if (target == GL_TEXTURE_CUBE_MAP) { |
16656 for (int jj = 0; jj < 6; ++jj) { | 16653 for (int jj = 0; jj < 6; ++jj) { |
16657 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; | 16654 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; |
16658 texture_manager()->SetLevelInfo( | 16655 texture_manager()->SetLevelInfo( |
16659 texture_ref, face, ii, adjusted_format, level_width, level_height, | 16656 texture_ref, face, ii, adjusted_internal_format, level_width, |
16660 1, 0, format, type, gfx::Rect()); | 16657 level_height, 1, 0, format, type, gfx::Rect()); |
16661 } | 16658 } |
16662 } else { | 16659 } else { |
16663 texture_manager()->SetLevelInfo( | 16660 texture_manager()->SetLevelInfo( |
16664 texture_ref, target, ii, adjusted_format, level_width, level_height, | 16661 texture_ref, target, ii, adjusted_internal_format, level_width, |
16665 level_depth, 0, format, type, gfx::Rect()); | 16662 level_height, level_depth, 0, format, type, gfx::Rect()); |
16666 } | 16663 } |
16667 level_width = std::max(1, level_width >> 1); | 16664 level_width = std::max(1, level_width >> 1); |
16668 level_height = std::max(1, level_height >> 1); | 16665 level_height = std::max(1, level_height >> 1); |
16669 if (target == GL_TEXTURE_3D) | 16666 if (target == GL_TEXTURE_3D) |
16670 level_depth = std::max(1, level_depth >> 1); | 16667 level_depth = std::max(1, level_depth >> 1); |
16671 } | 16668 } |
16672 texture->SetImmutable(true); | 16669 texture->SetImmutable(true); |
16673 } | 16670 } |
16674 } | 16671 } |
16675 | 16672 |
(...skipping 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
18760 } | 18757 } |
18761 | 18758 |
18762 // Include the auto-generated part of this file. We split this because it means | 18759 // Include the auto-generated part of this file. We split this because it means |
18763 // we can easily edit the non-auto generated parts right here in this file | 18760 // we can easily edit the non-auto generated parts right here in this file |
18764 // instead of having to edit some template or the code generator. | 18761 // instead of having to edit some template or the code generator. |
18765 #include "base/macros.h" | 18762 #include "base/macros.h" |
18766 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18763 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
18767 | 18764 |
18768 } // namespace gles2 | 18765 } // namespace gles2 |
18769 } // namespace gpu | 18766 } // namespace gpu |
OLD | NEW |