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

Unified Diff: src/gpu/gl/GrGLSL.cpp

Issue 23526008: Modify GLSL version declaration to allow access to compat. features (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLSL.h ('k') | src/gpu/gl/GrGLShaderBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLSL.cpp
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp
index 486390b8fb520294676ea8fa827cf2631d61f8ac..29596827da05b5803f3ebac1880f899cec9df0a3 100644
--- a/src/gpu/gl/GrGLSL.cpp
+++ b/src/gpu/gl/GrGLSL.cpp
@@ -33,26 +33,30 @@ GrGLSLGeneration GrGetGLSLGeneration(GrGLBinding binding, const GrGLInterface* g
}
}
-const char* GrGetGLSLVersionDecl(GrGLBinding binding, GrGLSLGeneration gen) {
- switch (gen) {
+const char* GrGetGLSLVersionDecl(const GrGLContextInfo& info) {
+ switch (info.glslGeneration()) {
case k110_GrGLSLGeneration:
- if (kES_GrGLBinding == binding) {
+ if (kES_GrGLBinding == info.binding()) {
// ES2s shader language is based on version 1.20 but is version
// 1.00 of the ES language.
return "#version 100\n";
} else {
- SkASSERT(kDesktop_GrGLBinding == binding);
+ SkASSERT(kDesktop_GrGLBinding == info.binding());
return "#version 110\n";
}
case k130_GrGLSLGeneration:
- SkASSERT(kDesktop_GrGLBinding == binding);
+ SkASSERT(kDesktop_GrGLBinding == info.binding());
return "#version 130\n";
case k140_GrGLSLGeneration:
- SkASSERT(kDesktop_GrGLBinding == binding);
+ SkASSERT(kDesktop_GrGLBinding == info.binding());
return "#version 140\n";
case k150_GrGLSLGeneration:
- SkASSERT(kDesktop_GrGLBinding == binding);
- return "#version 150\n";
+ SkASSERT(kDesktop_GrGLBinding == info.binding());
+ if (info.caps()->isCoreProfile()) {
+ return "#version 150\n";
+ } else {
+ return "#version 150 compatibility\n";
+ }
default:
GrCrash("Unknown GL version.");
return ""; // suppress warning
« no previous file with comments | « src/gpu/gl/GrGLSL.h ('k') | src/gpu/gl/GrGLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698