| 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 } | 574 } |
| 575 if ((sampler_state.min_filter != GL_NEAREST && | 575 if ((sampler_state.min_filter != GL_NEAREST && |
| 576 sampler_state.min_filter != GL_NEAREST_MIPMAP_NEAREST) || | 576 sampler_state.min_filter != GL_NEAREST_MIPMAP_NEAREST) || |
| 577 sampler_state.mag_filter != GL_NEAREST) { | 577 sampler_state.mag_filter != GL_NEAREST) { |
| 578 DCHECK(!face_infos_.empty()); | 578 DCHECK(!face_infos_.empty()); |
| 579 DCHECK_LT(static_cast<size_t>(base_level_), | 579 DCHECK_LT(static_cast<size_t>(base_level_), |
| 580 face_infos_[0].level_infos.size()); | 580 face_infos_[0].level_infos.size()); |
| 581 const Texture::LevelInfo& first_level = | 581 const Texture::LevelInfo& first_level = |
| 582 face_infos_[0].level_infos[base_level_]; | 582 face_infos_[0].level_infos[base_level_]; |
| 583 if ((GLES2Util::GetChannelsForFormat(first_level.internal_format) & | 583 if ((GLES2Util::GetChannelsForFormat(first_level.internal_format) & |
| 584 (GLES2Util::kDepth | GLES2Util::kStencil)) != 0 || | 584 (GLES2Util::kDepth | GLES2Util::kStencil)) != 0) { |
| 585 feature_info->validators()->compressed_texture_format.IsValid( | 585 if (sampler_state.compare_mode == GL_NONE) { |
| 586 first_level.internal_format)) { | 586 // In ES2 with OES_depth_texture, such limitation isn't specified. |
| 587 // TODO(zmo): The assumption that depth/stencil textures and compressed | 587 if (feature_info->IsES3Enabled()) { |
| 588 // textures are all filterable may not be true in the future. | 588 return false; |
| 589 } |
| 590 } |
| 591 } else if (feature_info->validators()->compressed_texture_format.IsValid( |
| 592 first_level.internal_format)) { |
| 593 // TODO(zmo): The assumption that compressed textures are all filterable |
| 594 // may not be true in the future. |
| 589 } else { | 595 } else { |
| 590 if (!Texture::TextureFilterable(feature_info, | 596 if (!Texture::TextureFilterable(feature_info, |
| 591 first_level.internal_format, | 597 first_level.internal_format, |
| 592 first_level.type)) { | 598 first_level.type)) { |
| 593 return false; | 599 return false; |
| 594 } | 600 } |
| 595 } | 601 } |
| 596 } | 602 } |
| 597 | 603 |
| 598 if (!feature_info->IsES3Enabled()) { | 604 if (!feature_info->IsES3Enabled()) { |
| (...skipping 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3461 uint32_t TextureManager::GetServiceIdGeneration() const { | 3467 uint32_t TextureManager::GetServiceIdGeneration() const { |
| 3462 return current_service_id_generation_; | 3468 return current_service_id_generation_; |
| 3463 } | 3469 } |
| 3464 | 3470 |
| 3465 void TextureManager::IncrementServiceIdGeneration() { | 3471 void TextureManager::IncrementServiceIdGeneration() { |
| 3466 current_service_id_generation_++; | 3472 current_service_id_generation_++; |
| 3467 } | 3473 } |
| 3468 | 3474 |
| 3469 } // namespace gles2 | 3475 } // namespace gles2 |
| 3470 } // namespace gpu | 3476 } // namespace gpu |
| OLD | NEW |