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

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

Issue 2863773002: Don't expose EXT_color_buffer_half_float to GL 2.x (Closed)
Patch Set: Add ES check Created 3 years, 7 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/test_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/feature_info.h" 5 #include "gpu/command_buffer/service/feature_info.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 }; 1499 };
1500 DCHECK_EQ(arraysize(internal_formats), arraysize(formats)); 1500 DCHECK_EQ(arraysize(internal_formats), arraysize(formats));
1501 for (size_t i = 0; i < arraysize(formats); ++i) { 1501 for (size_t i = 0; i < arraysize(formats); ++i) {
1502 glTexImage2D(GL_TEXTURE_2D, 0, internal_formats[i], width, width, 0, 1502 glTexImage2D(GL_TEXTURE_2D, 0, internal_formats[i], width, width, 0,
1503 formats[i], GL_FLOAT, NULL); 1503 formats[i], GL_FLOAT, NULL);
1504 full_float_support &= glCheckFramebufferStatusEXT(GL_FRAMEBUFFER) == 1504 full_float_support &= glCheckFramebufferStatusEXT(GL_FRAMEBUFFER) ==
1505 GL_FRAMEBUFFER_COMPLETE; 1505 GL_FRAMEBUFFER_COMPLETE;
1506 } 1506 }
1507 enable_ext_color_buffer_float = full_float_support; 1507 enable_ext_color_buffer_float = full_float_support;
1508 } 1508 }
1509 // Likewise for EXT_color_buffer_half_float on ES2 contexts. 1509 // Likewise for EXT_color_buffer_half_float on ES2 contexts. On desktop,
1510 if (IsWebGL1OrES2Context() && !enable_ext_color_buffer_half_float) { 1510 // require at least GL 3.0, to ensure that all formats are defined.
1511 if (IsWebGL1OrES2Context() && !enable_ext_color_buffer_half_float &&
1512 (gl_version_info_->is_es || gl_version_info_->IsAtLeastGL(3, 0))) {
1511 bool full_half_float_support = true; 1513 bool full_half_float_support = true;
1512 GLenum internal_formats[] = { 1514 GLenum internal_formats[] = {
1513 GL_R16F, GL_RG16F, GL_RGBA16F, 1515 GL_R16F, GL_RG16F, GL_RGBA16F,
1514 }; 1516 };
1515 GLenum formats[] = { 1517 GLenum formats[] = {
1516 GL_RED, GL_RG, GL_RGBA, 1518 GL_RED, GL_RG, GL_RGBA,
1517 }; 1519 };
1518 GLenum data_type = GL_FLOAT; 1520 GLenum data_type = GL_FLOAT;
1519 if (gl_version_info_->is_es2) 1521 if (gl_version_info_->is_es2)
1520 data_type = GL_HALF_FLOAT_OES; 1522 data_type = GL_HALF_FLOAT_OES;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 if (pos == std::string::npos) { 1698 if (pos == std::string::npos) {
1697 extensions_ += (extensions_.empty() ? "" : " ") + str; 1699 extensions_ += (extensions_.empty() ? "" : " ") + str;
1698 } 1700 }
1699 } 1701 }
1700 1702
1701 FeatureInfo::~FeatureInfo() { 1703 FeatureInfo::~FeatureInfo() {
1702 } 1704 }
1703 1705
1704 } // namespace gles2 1706 } // namespace gles2
1705 } // namespace gpu 1707 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698