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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 {GL_RED, GL_RED, GL_FLOAT}, | 158 {GL_RED, GL_RED, GL_FLOAT}, |
159 {GL_RG, GL_RG, GL_FLOAT}, | 159 {GL_RG, GL_RG, GL_FLOAT}, |
160 {GL_RED, GL_RED, GL_HALF_FLOAT_OES}, | 160 {GL_RED, GL_RED, GL_HALF_FLOAT_OES}, |
161 {GL_RG, GL_RG, GL_HALF_FLOAT_OES}, | 161 {GL_RG, GL_RG, GL_HALF_FLOAT_OES}, |
162 | 162 |
163 // ES3. | 163 // ES3. |
164 {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, | 164 {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, |
165 {GL_R8_SNORM, GL_RED, GL_BYTE}, | 165 {GL_R8_SNORM, GL_RED, GL_BYTE}, |
166 {GL_R16F, GL_RED, GL_HALF_FLOAT}, | 166 {GL_R16F, GL_RED, GL_HALF_FLOAT}, |
167 {GL_R16F, GL_RED, GL_FLOAT}, | 167 {GL_R16F, GL_RED, GL_FLOAT}, |
168 {GL_R16F, GL_R16F, GL_HALF_FLOAT}, | |
168 {GL_R32F, GL_RED, GL_FLOAT}, | 169 {GL_R32F, GL_RED, GL_FLOAT}, |
170 {GL_R32F, GL_R32F, GL_FLOAT}, | |
169 {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE}, | 171 {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE}, |
170 {GL_R8I, GL_RED_INTEGER, GL_BYTE}, | 172 {GL_R8I, GL_RED_INTEGER, GL_BYTE}, |
171 {GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT}, | 173 {GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT}, |
174 {GL_R16UI, GL_R16UI, GL_UNSIGNED_SHORT}, | |
Ken Russell (switch to Gerrit)
2016/08/16 00:22:27
This one isn't mentioned in the switch statement b
aleksandar.stojiljkovic
2016/08/16 12:02:31
Code change in this file isn't needed here. I'll r
aleksandar.stojiljkovic
2016/09/20 12:22:54
Done. As part of work on gpu buffers support, this
| |
172 {GL_R16I, GL_RED_INTEGER, GL_SHORT}, | 175 {GL_R16I, GL_RED_INTEGER, GL_SHORT}, |
173 {GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT}, | 176 {GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT}, |
174 {GL_R32I, GL_RED_INTEGER, GL_INT}, | 177 {GL_R32I, GL_RED_INTEGER, GL_INT}, |
175 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE}, | 178 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE}, |
176 {GL_RG8_SNORM, GL_RG, GL_BYTE}, | 179 {GL_RG8_SNORM, GL_RG, GL_BYTE}, |
177 {GL_RG16F, GL_RG, GL_HALF_FLOAT}, | 180 {GL_RG16F, GL_RG, GL_HALF_FLOAT}, |
178 {GL_RG16F, GL_RG, GL_FLOAT}, | 181 {GL_RG16F, GL_RG, GL_FLOAT}, |
179 {GL_RG32F, GL_RG, GL_FLOAT}, | 182 {GL_RG32F, GL_RG, GL_FLOAT}, |
180 {GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE}, | 183 {GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE}, |
181 {GL_RG8I, GL_RG_INTEGER, GL_BYTE}, | 184 {GL_RG8I, GL_RG_INTEGER, GL_BYTE}, |
(...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2896 return GL_RGB; | 2899 return GL_RGB; |
2897 if (format == GL_SRGB_ALPHA_EXT) | 2900 if (format == GL_SRGB_ALPHA_EXT) |
2898 return GL_RGBA; | 2901 return GL_RGBA; |
2899 } | 2902 } |
2900 if (feature_info->gl_version_info().is_desktop_core_profile) { | 2903 if (feature_info->gl_version_info().is_desktop_core_profile) { |
2901 const Texture::CompatibilitySwizzle* swizzle = | 2904 const Texture::CompatibilitySwizzle* swizzle = |
2902 GetCompatibilitySwizzle(format); | 2905 GetCompatibilitySwizzle(format); |
2903 if (swizzle) | 2906 if (swizzle) |
2904 return swizzle->dest_format; | 2907 return swizzle->dest_format; |
2905 } | 2908 } |
2909 switch (format) { | |
2910 case GL_R32F: | |
2911 case GL_R16F: | |
2912 case GL_R8: | |
2913 return GL_RED; | |
2914 default: | |
2915 break; | |
2916 } | |
2906 return format; | 2917 return format; |
2907 } | 2918 } |
2908 | 2919 |
2909 void TextureManager::DoTexImage( | 2920 void TextureManager::DoTexImage( |
2910 DecoderTextureState* texture_state, | 2921 DecoderTextureState* texture_state, |
2911 ContextState* state, | 2922 ContextState* state, |
2912 DecoderFramebufferState* framebuffer_state, | 2923 DecoderFramebufferState* framebuffer_state, |
2913 const char* function_name, | 2924 const char* function_name, |
2914 TextureRef* texture_ref, | 2925 TextureRef* texture_ref, |
2915 const DoTexImageArguments& args) { | 2926 const DoTexImageArguments& args) { |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3364 uint32_t TextureManager::GetServiceIdGeneration() const { | 3375 uint32_t TextureManager::GetServiceIdGeneration() const { |
3365 return current_service_id_generation_; | 3376 return current_service_id_generation_; |
3366 } | 3377 } |
3367 | 3378 |
3368 void TextureManager::IncrementServiceIdGeneration() { | 3379 void TextureManager::IncrementServiceIdGeneration() { |
3369 current_service_id_generation_++; | 3380 current_service_id_generation_++; |
3370 } | 3381 } |
3371 | 3382 |
3372 } // namespace gles2 | 3383 } // namespace gles2 |
3373 } // namespace gpu | 3384 } // namespace gpu |
OLD | NEW |