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 16389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16400 depth); | 16400 depth); |
16401 } | 16401 } |
16402 if (workarounds().reset_base_mipmap_level_before_texstorage && | 16402 if (workarounds().reset_base_mipmap_level_before_texstorage && |
16403 texture->base_level() > 0) | 16403 texture->base_level() > 0) |
16404 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); | 16404 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); |
16405 | 16405 |
16406 { | 16406 { |
16407 GLsizei level_width = width; | 16407 GLsizei level_width = width; |
16408 GLsizei level_height = height; | 16408 GLsizei level_height = height; |
16409 GLsizei level_depth = depth; | 16409 GLsizei level_depth = depth; |
16410 GLenum adjusted_format = | |
16411 feature_info_->IsES3Enabled() ? internal_format : format; | |
16412 for (int ii = 0; ii < levels; ++ii) { | 16410 for (int ii = 0; ii < levels; ++ii) { |
16413 if (target == GL_TEXTURE_CUBE_MAP) { | 16411 if (target == GL_TEXTURE_CUBE_MAP) { |
16414 for (int jj = 0; jj < 6; ++jj) { | 16412 for (int jj = 0; jj < 6; ++jj) { |
16415 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; | 16413 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; |
16416 texture_manager()->SetLevelInfo(texture_ref, face, ii, | 16414 texture_manager()->SetLevelInfo( |
16417 adjusted_format, | 16415 texture_ref, face, ii, internal_format, level_width, level_height, |
16418 level_width, level_height, 1, | 16416 1, 0, format, type, gfx::Rect()); |
16419 0, format, type, gfx::Rect()); | |
16420 } | 16417 } |
16421 } else { | 16418 } else { |
16422 texture_manager()->SetLevelInfo(texture_ref, target, ii, | 16419 texture_manager()->SetLevelInfo( |
16423 adjusted_format, | 16420 texture_ref, target, ii, internal_format, level_width, level_height, |
16424 level_width, level_height, level_depth, | 16421 level_depth, 0, format, type, gfx::Rect()); |
16425 0, format, type, gfx::Rect()); | |
16426 } | 16422 } |
16427 level_width = std::max(1, level_width >> 1); | 16423 level_width = std::max(1, level_width >> 1); |
16428 level_height = std::max(1, level_height >> 1); | 16424 level_height = std::max(1, level_height >> 1); |
16429 if (target == GL_TEXTURE_3D) | 16425 if (target == GL_TEXTURE_3D) |
16430 level_depth = std::max(1, level_depth >> 1); | 16426 level_depth = std::max(1, level_depth >> 1); |
16431 } | 16427 } |
16432 texture->SetImmutable(true); | 16428 texture->SetImmutable(true); |
16433 } | 16429 } |
16434 } | 16430 } |
16435 | 16431 |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18519 } | 18515 } |
18520 | 18516 |
18521 // Include the auto-generated part of this file. We split this because it means | 18517 // Include the auto-generated part of this file. We split this because it means |
18522 // we can easily edit the non-auto generated parts right here in this file | 18518 // we can easily edit the non-auto generated parts right here in this file |
18523 // instead of having to edit some template or the code generator. | 18519 // instead of having to edit some template or the code generator. |
18524 #include "base/macros.h" | 18520 #include "base/macros.h" |
18525 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18521 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
18526 | 18522 |
18527 } // namespace gles2 | 18523 } // namespace gles2 |
18528 } // namespace gpu | 18524 } // namespace gpu |
OLD | NEW |