Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(821)

Side by Side Diff: gpu/command_buffer/service/texture_manager.cc

Issue 2117183006: gpu: Clarify sized texture format is available only if ES3 context or immutable texture is supported (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rely on right extension Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 {GL_ALPHA, GL_ALPHA, GL_HALF_FLOAT_OES}, 145 {GL_ALPHA, GL_ALPHA, GL_HALF_FLOAT_OES},
146 // Exposed by GL_ANGLE_depth_texture 146 // Exposed by GL_ANGLE_depth_texture
147 {GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT}, 147 {GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT},
148 {GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT}, 148 {GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT},
149 {GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, 149 {GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8},
150 // Exposed by GL_EXT_sRGB 150 // Exposed by GL_EXT_sRGB
151 {GL_SRGB, GL_SRGB, GL_UNSIGNED_BYTE}, 151 {GL_SRGB, GL_SRGB, GL_UNSIGNED_BYTE},
152 {GL_SRGB_ALPHA, GL_SRGB_ALPHA, GL_UNSIGNED_BYTE}, 152 {GL_SRGB_ALPHA, GL_SRGB_ALPHA, GL_UNSIGNED_BYTE},
153 // Exposed by GL_EXT_texture_format_BGRA8888 153 // Exposed by GL_EXT_texture_format_BGRA8888
154 {GL_BGRA_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE}, 154 {GL_BGRA_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE},
155 {GL_BGRA8_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE},
155 // Exposed by GL_EXT_texture_rg 156 // Exposed by GL_EXT_texture_rg
156 {GL_RED, GL_RED, GL_UNSIGNED_BYTE}, 157 {GL_RED, GL_RED, GL_UNSIGNED_BYTE},
157 {GL_RG, GL_RG, GL_UNSIGNED_BYTE}, 158 {GL_RG, GL_RG, GL_UNSIGNED_BYTE},
158 {GL_RED, GL_RED, GL_FLOAT}, 159 {GL_RED, GL_RED, GL_FLOAT},
159 {GL_RG, GL_RG, GL_FLOAT}, 160 {GL_RG, GL_RG, GL_FLOAT},
160 {GL_RED, GL_RED, GL_HALF_FLOAT_OES}, 161 {GL_RED, GL_RED, GL_HALF_FLOAT_OES},
161 {GL_RG, GL_RG, GL_HALF_FLOAT_OES}, 162 {GL_RG, GL_RG, GL_HALF_FLOAT_OES},
162 163
163 // ES3. 164 // ES3.
164 {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, 165 {GL_R8, GL_RED, GL_UNSIGNED_BYTE},
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 } 755 }
755 return feature_info->validators()-> 756 return feature_info->validators()->
756 texture_sized_color_renderable_internal_format.IsValid(internal_format); 757 texture_sized_color_renderable_internal_format.IsValid(internal_format);
757 } 758 }
758 759
759 // static 760 // static
760 bool Texture::TextureFilterable(const FeatureInfo* feature_info, 761 bool Texture::TextureFilterable(const FeatureInfo* feature_info,
761 GLenum internal_format, 762 GLenum internal_format,
762 GLenum type) { 763 GLenum type) {
763 if (feature_info->validators()->texture_unsized_internal_format.IsValid( 764 if (feature_info->validators()->texture_unsized_internal_format.IsValid(
764 internal_format)) { 765 internal_format) ||
766 feature_info->validators()
767 ->texture_sized_color_renderable_internal_format.IsValid(
768 internal_format)) {
765 switch (type) { 769 switch (type) {
766 case GL_FLOAT: 770 case GL_FLOAT:
767 return feature_info->feature_flags().enable_texture_float_linear; 771 return feature_info->feature_flags().enable_texture_float_linear;
768 case GL_HALF_FLOAT_OES: 772 case GL_HALF_FLOAT_OES:
769 return feature_info->feature_flags().enable_texture_half_float_linear; 773 return feature_info->feature_flags().enable_texture_half_float_linear;
770 default: 774 default:
771 // GL_HALF_FLOAT is ES3 only and should only be used with sized formats. 775 // GL_HALF_FLOAT is ES3 only and should only be used with sized formats.
772 return true; 776 return true;
773 } 777 }
774 } 778 }
(...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3364 uint32_t TextureManager::GetServiceIdGeneration() const { 3368 uint32_t TextureManager::GetServiceIdGeneration() const {
3365 return current_service_id_generation_; 3369 return current_service_id_generation_;
3366 } 3370 }
3367 3371
3368 void TextureManager::IncrementServiceIdGeneration() { 3372 void TextureManager::IncrementServiceIdGeneration() {
3369 current_service_id_generation_++; 3373 current_service_id_generation_++;
3370 } 3374 }
3371 3375
3372 } // namespace gles2 3376 } // namespace gles2
3373 } // namespace gpu 3377 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698