Chromium Code Reviews| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 554 } | 554 } |
| 555 if ((sampler_state.min_filter != GL_NEAREST && | 555 if ((sampler_state.min_filter != GL_NEAREST && |
| 556 sampler_state.min_filter != GL_NEAREST_MIPMAP_NEAREST) || | 556 sampler_state.min_filter != GL_NEAREST_MIPMAP_NEAREST) || |
| 557 sampler_state.mag_filter != GL_NEAREST) { | 557 sampler_state.mag_filter != GL_NEAREST) { |
| 558 DCHECK(!face_infos_.empty()); | 558 DCHECK(!face_infos_.empty()); |
| 559 DCHECK_LT(static_cast<size_t>(base_level_), | 559 DCHECK_LT(static_cast<size_t>(base_level_), |
| 560 face_infos_[0].level_infos.size()); | 560 face_infos_[0].level_infos.size()); |
| 561 const Texture::LevelInfo& first_level = | 561 const Texture::LevelInfo& first_level = |
| 562 face_infos_[0].level_infos[base_level_]; | 562 face_infos_[0].level_infos[base_level_]; |
| 563 if ((GLES2Util::GetChannelsForFormat(first_level.internal_format) & | 563 if ((GLES2Util::GetChannelsForFormat(first_level.internal_format) & |
| 564 (GLES2Util::kDepth | GLES2Util::kStencil)) != 0 || | 564 (GLES2Util::kDepth | GLES2Util::kStencil)) != 0) { |
| 565 feature_info->validators()->compressed_texture_format.IsValid( | 565 if (sampler_state.compare_mode == GL_NONE) { |
|
Ken Russell (switch to Gerrit)
2016/09/23 19:25:15
Could you explain this check? I thought we were go
Zhenyao Mo
2016/09/23 20:09:10
The filter check is done in the above (line 555-55
| |
| 566 first_level.internal_format)) { | 566 // In ES2 with OES_depth_texture, such limitation isn't specified. |
| 567 // TODO(zmo): The assumption that depth/stencil textures and compressed | 567 if (feature_info->IsES3Enabled()) { |
| 568 // textures are all filterable may not be true in the future. | 568 return false; |
| 569 } | |
| 570 } | |
| 571 } else if (feature_info->validators()->compressed_texture_format.IsValid( | |
| 572 first_level.internal_format)) { | |
| 573 // TODO(zmo): The assumption that compressed textures are all filterable | |
| 574 // may not be true in the future. | |
| 569 } else { | 575 } else { |
| 570 if (!Texture::TextureFilterable(feature_info, | 576 if (!Texture::TextureFilterable(feature_info, |
| 571 first_level.internal_format, | 577 first_level.internal_format, |
| 572 first_level.type)) { | 578 first_level.type)) { |
| 573 return false; | 579 return false; |
| 574 } | 580 } |
| 575 } | 581 } |
| 576 } | 582 } |
| 577 | 583 |
| 578 if (!feature_info->IsES3Enabled()) { | 584 if (!feature_info->IsES3Enabled()) { |
| (...skipping 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3418 uint32_t TextureManager::GetServiceIdGeneration() const { | 3424 uint32_t TextureManager::GetServiceIdGeneration() const { |
| 3419 return current_service_id_generation_; | 3425 return current_service_id_generation_; |
| 3420 } | 3426 } |
| 3421 | 3427 |
| 3422 void TextureManager::IncrementServiceIdGeneration() { | 3428 void TextureManager::IncrementServiceIdGeneration() { |
| 3423 current_service_id_generation_++; | 3429 current_service_id_generation_++; |
| 3424 } | 3430 } |
| 3425 | 3431 |
| 3426 } // namespace gles2 | 3432 } // namespace gles2 |
| 3427 } // namespace gpu | 3433 } // namespace gpu |
| OLD | NEW |