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 16123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16134 depth); | 16134 depth); |
16135 } | 16135 } |
16136 if (workarounds().reset_base_mipmap_level_before_texstorage && | 16136 if (workarounds().reset_base_mipmap_level_before_texstorage && |
16137 texture->base_level() > 0) | 16137 texture->base_level() > 0) |
16138 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); | 16138 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); |
16139 | 16139 |
16140 { | 16140 { |
16141 GLsizei level_width = width; | 16141 GLsizei level_width = width; |
16142 GLsizei level_height = height; | 16142 GLsizei level_height = height; |
16143 GLsizei level_depth = depth; | 16143 GLsizei level_depth = depth; |
16144 GLenum adjusted_format = | |
16145 feature_info_->IsES3Enabled() ? internal_format : format; | |
dshwang
2016/10/10 20:57:10
Here is inside GLES2DecoderImpl::TexStorageImpl().
| |
16146 for (int ii = 0; ii < levels; ++ii) { | 16144 for (int ii = 0; ii < levels; ++ii) { |
16147 if (target == GL_TEXTURE_CUBE_MAP) { | 16145 if (target == GL_TEXTURE_CUBE_MAP) { |
16148 for (int jj = 0; jj < 6; ++jj) { | 16146 for (int jj = 0; jj < 6; ++jj) { |
16149 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; | 16147 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; |
16150 texture_manager()->SetLevelInfo(texture_ref, face, ii, | 16148 texture_manager()->SetLevelInfo( |
16151 adjusted_format, | 16149 texture_ref, face, ii, internal_format, level_width, level_height, |
16152 level_width, level_height, 1, | 16150 1, 0, format, type, gfx::Rect()); |
16153 0, format, type, gfx::Rect()); | |
16154 } | 16151 } |
16155 } else { | 16152 } else { |
16156 texture_manager()->SetLevelInfo(texture_ref, target, ii, | 16153 texture_manager()->SetLevelInfo( |
16157 adjusted_format, | 16154 texture_ref, target, ii, internal_format, level_width, level_height, |
16158 level_width, level_height, level_depth, | 16155 level_depth, 0, format, type, gfx::Rect()); |
16159 0, format, type, gfx::Rect()); | |
16160 } | 16156 } |
16161 level_width = std::max(1, level_width >> 1); | 16157 level_width = std::max(1, level_width >> 1); |
16162 level_height = std::max(1, level_height >> 1); | 16158 level_height = std::max(1, level_height >> 1); |
16163 if (target == GL_TEXTURE_3D) | 16159 if (target == GL_TEXTURE_3D) |
16164 level_depth = std::max(1, level_depth >> 1); | 16160 level_depth = std::max(1, level_depth >> 1); |
16165 } | 16161 } |
16166 texture->SetImmutable(true); | 16162 texture->SetImmutable(true); |
16167 } | 16163 } |
16168 } | 16164 } |
16169 | 16165 |
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
18247 } | 18243 } |
18248 | 18244 |
18249 // Include the auto-generated part of this file. We split this because it means | 18245 // Include the auto-generated part of this file. We split this because it means |
18250 // we can easily edit the non-auto generated parts right here in this file | 18246 // we can easily edit the non-auto generated parts right here in this file |
18251 // instead of having to edit some template or the code generator. | 18247 // instead of having to edit some template or the code generator. |
18252 #include "base/macros.h" | 18248 #include "base/macros.h" |
18253 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18249 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
18254 | 18250 |
18255 } // namespace gles2 | 18251 } // namespace gles2 |
18256 } // namespace gpu | 18252 } // namespace gpu |
OLD | NEW |