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

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

Issue 1540483002: Use GLSL version 100 for OpenGL context versions prior to 3.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/shader_translator_unittest.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/shader_translator.h" 5 #include "gpu/command_buffer/service/shader_translator.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <GLES2/gl2.h> 8 #include <GLES2/gl2.h>
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return SH_GLSL_430_CORE_OUTPUT; 133 return SH_GLSL_430_CORE_OUTPUT;
134 } else if (context_version == 420) { 134 } else if (context_version == 420) {
135 return SH_GLSL_420_CORE_OUTPUT; 135 return SH_GLSL_420_CORE_OUTPUT;
136 } else if (context_version == 410) { 136 } else if (context_version == 410) {
137 return SH_GLSL_410_CORE_OUTPUT; 137 return SH_GLSL_410_CORE_OUTPUT;
138 } else if (context_version == 400) { 138 } else if (context_version == 400) {
139 return SH_GLSL_400_CORE_OUTPUT; 139 return SH_GLSL_400_CORE_OUTPUT;
140 } else if (context_version == 330) { 140 } else if (context_version == 330) {
141 return SH_GLSL_330_CORE_OUTPUT; 141 return SH_GLSL_330_CORE_OUTPUT;
142 } else if (context_version == 320) { 142 } else if (context_version == 320) {
143 return SH_GLSL_150_CORE_OUTPUT; 143 return SH_GLSL_150_CORE_OUTPUT;
Kimmo Kinnunen 2015/12/18 07:03:23 Would version 150 also have the same problem? htt
Ken Russell (switch to Gerrit) 2015/12/22 02:45:18 Looking more deeply, yes, it looks like this restr
144 } else if (context_version == 310) {
145 return SH_GLSL_140_OUTPUT;
146 } else if (context_version == 300) {
147 return SH_GLSL_130_OUTPUT;
148 } 144 }
149 145
150 // Before OpenGL 3.0 we use compatibility profile. Also for future 146 // Before OpenGL 3.2 we use the compatibility profile. Shading
151 // specs between OpenGL 3.3 and OpenGL 4.0, at the time of writing, 147 // language version 130 restricted how sampler arrays can be indexed
152 // we use compatibility profile. 148 // in loops, which causes problems like crbug.com/550487 .
Kimmo Kinnunen 2015/12/18 07:03:23 Just verifying: so not using 130-150 would be a wo
Ken Russell (switch to Gerrit) 2015/12/22 02:45:18 OpenGL ES 2.0 / WebGL 1.0 require sampler arrays t
149 //
150 // Also for any future specs that might be introduced between OpenGL
151 // 3.3 and OpenGL 4.0, at the time of writing, we use the
152 // compatibility profile.
153 return SH_GLSL_COMPATIBILITY_OUTPUT; 153 return SH_GLSL_COMPATIBILITY_OUTPUT;
154 } 154 }
155 155
156 ShaderTranslator::DestructionObserver::DestructionObserver() { 156 ShaderTranslator::DestructionObserver::DestructionObserver() {
157 } 157 }
158 158
159 ShaderTranslator::DestructionObserver::~DestructionObserver() { 159 ShaderTranslator::DestructionObserver::~DestructionObserver() {
160 } 160 }
161 161
162 ShaderTranslator::ShaderTranslator() 162 ShaderTranslator::ShaderTranslator()
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 destruction_observers_, 274 destruction_observers_,
275 OnDestruct(this)); 275 OnDestruct(this));
276 276
277 if (compiler_ != NULL) 277 if (compiler_ != NULL)
278 ShDestruct(compiler_); 278 ShDestruct(compiler_);
279 } 279 }
280 280
281 } // namespace gles2 281 } // namespace gles2
282 } // namespace gpu 282 } // namespace gpu
283 283
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/shader_translator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698