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

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

Issue 1831833006: Turn on seamless cubemap by default on Desktop GL for ES3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/gles2_cmd_decoder_unittest_base.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/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 LOG(ERROR) << "Underlying driver does not support ES3."; 2735 LOG(ERROR) << "Underlying driver does not support ES3.";
2736 Destroy(true); 2736 Destroy(true);
2737 return false; 2737 return false;
2738 } 2738 }
2739 feature_info_->EnableES3Validators(); 2739 feature_info_->EnableES3Validators();
2740 set_unsafe_es3_apis_enabled(true); 2740 set_unsafe_es3_apis_enabled(true);
2741 2741
2742 frag_depth_explicitly_enabled_ = true; 2742 frag_depth_explicitly_enabled_ = true;
2743 draw_buffers_explicitly_enabled_ = true; 2743 draw_buffers_explicitly_enabled_ = true;
2744 // TODO(zmo): Look into shader_texture_lod_explicitly_enabled_ situation. 2744 // TODO(zmo): Look into shader_texture_lod_explicitly_enabled_ situation.
2745
2746 // TEXTURE_CUBE_MAP_SEAMLESS is available on Desktop GL 3.2 or above.
2747 // ES3 requires it to be always supported.
2748 // We don't support ES3 on Desktop GL lower than 3.2.
2749 if (!feature_info_->gl_version_info().BehavesLikeGLES()) {
2750 glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
2751 }
piman 2016/03/25 17:01:04 Can you remove this? The code below will take care
Zhenyao Mo 2016/03/25 17:17:29 Ah, nasty. I thought I deleted already.
2745 } 2752 }
2746 2753
2747 state_.attrib_values.resize(group_->max_vertex_attribs()); 2754 state_.attrib_values.resize(group_->max_vertex_attribs());
2748 vertex_array_manager_.reset(new VertexArrayManager()); 2755 vertex_array_manager_.reset(new VertexArrayManager());
2749 2756
2750 GLuint default_vertex_attrib_service_id = 0; 2757 GLuint default_vertex_attrib_service_id = 0;
2751 if (features().native_vertex_array_object) { 2758 if (features().native_vertex_array_object) {
2752 glGenVertexArraysOES(1, &default_vertex_attrib_service_id); 2759 glGenVertexArraysOES(1, &default_vertex_attrib_service_id);
2753 glBindVertexArrayOES(default_vertex_attrib_service_id); 2760 glBindVertexArrayOES(default_vertex_attrib_service_id);
2754 } 2761 }
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
3011 // variable in fragment shaders. 3018 // variable in fragment shaders.
3012 if (!feature_info_->gl_version_info().BehavesLikeGLES()) { 3019 if (!feature_info_->gl_version_info().BehavesLikeGLES()) {
3013 glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); 3020 glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
3014 glEnable(GL_POINT_SPRITE); 3021 glEnable(GL_POINT_SPRITE);
3015 } else if (feature_info_->gl_version_info().is_desktop_core_profile) { 3022 } else if (feature_info_->gl_version_info().is_desktop_core_profile) {
3016 // The desktop core profile changed how program point size mode is 3023 // The desktop core profile changed how program point size mode is
3017 // enabled. 3024 // enabled.
3018 glEnable(GL_PROGRAM_POINT_SIZE); 3025 glEnable(GL_PROGRAM_POINT_SIZE);
3019 } 3026 }
3020 3027
3028 // ES3 requires seamless cubemap. ES2 does not.
3029 // However, when ES2 is implemented on top of DX11, seamless cubemap is
3030 // always enabled and there is no way to disable it.
3031 // Therefore, it seems OK to also always enable it on top of Desktop GL for
3032 // both ES2 and ES3 contexts.
3033 if (feature_info_->gl_version_info().IsAtLeastGL(3, 2)) {
3034 glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
3035 }
3036
3021 has_robustness_extension_ = 3037 has_robustness_extension_ =
3022 context->HasExtension("GL_ARB_robustness") || 3038 context->HasExtension("GL_ARB_robustness") ||
3023 context->HasExtension("GL_KHR_robustness") || 3039 context->HasExtension("GL_KHR_robustness") ||
3024 context->HasExtension("GL_EXT_robustness"); 3040 context->HasExtension("GL_EXT_robustness");
3025 3041
3026 if (!InitializeShaderTranslator()) { 3042 if (!InitializeShaderTranslator()) {
3027 return false; 3043 return false;
3028 } 3044 }
3029 3045
3030 GLint viewport_params[4] = { 0 }; 3046 GLint viewport_params[4] = { 0 };
(...skipping 13302 matching lines...) Expand 10 before | Expand all | Expand 10 after
16333 } 16349 }
16334 16350
16335 // Include the auto-generated part of this file. We split this because it means 16351 // Include the auto-generated part of this file. We split this because it means
16336 // we can easily edit the non-auto generated parts right here in this file 16352 // we can easily edit the non-auto generated parts right here in this file
16337 // instead of having to edit some template or the code generator. 16353 // instead of having to edit some template or the code generator.
16338 #include "base/macros.h" 16354 #include "base/macros.h"
16339 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 16355 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
16340 16356
16341 } // namespace gles2 16357 } // namespace gles2
16342 } // namespace gpu 16358 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698