aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLSL.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-10-16 12:25:11 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-16 12:25:11 -0700
commit62372bcc6abe3537dac98dd9b9172cf3b85afa2b (patch)
treebe8fb2232585e0770a0fa0a8642798a1de53d477 /src/gpu/gl/GrGLSL.cpp
parent65151754b9fdb6a968d7307764c20655d1b680a0 (diff)
Support GLSL es 3.00
Diffstat (limited to 'src/gpu/gl/GrGLSL.cpp')
-rw-r--r--src/gpu/gl/GrGLSL.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp
index 866a0d13d3..34c805e21f 100644
--- a/src/gpu/gl/GrGLSL.cpp
+++ b/src/gpu/gl/GrGLSL.cpp
@@ -18,7 +18,9 @@ bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation)
switch (gl->fStandard) {
case kGL_GrGLStandard:
SkASSERT(ver >= GR_GLSL_VER(1,10));
- if (ver >= GR_GLSL_VER(1,50)) {
+ if (ver >= GR_GLSL_VER(3,30)) {
+ *generation = k330_GrGLSLGeneration;
+ } else if (ver >= GR_GLSL_VER(1,50)) {
*generation = k150_GrGLSLGeneration;
} else if (ver >= GR_GLSL_VER(1,40)) {
*generation = k140_GrGLSLGeneration;
@@ -29,9 +31,15 @@ bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation)
}
return true;
case kGLES_GrGLStandard:
- // version 1.00 of ES GLSL based on ver 1.20 of desktop GLSL
SkASSERT(ver >= GR_GL_VER(1,00));
- *generation = k110_GrGLSLGeneration;
+ if (ver >= GR_GLSL_VER(3,1)) {
+ *generation = k310es_GrGLSLGeneration;
+ }
+ else if (ver >= GR_GLSL_VER(3,0)) {
+ *generation = k330_GrGLSLGeneration;
+ } else {
+ *generation = k110_GrGLSLGeneration;
+ }
return true;
default:
SkFAIL("Unknown GL Standard");
@@ -63,6 +71,16 @@ const char* GrGetGLSLVersionDecl(const GrGLContextInfo& info) {
} else {
return "#version 150 compatibility\n";
}
+ case k330_GrGLSLGeneration:
+ if (kGLES_GrGLStandard == info.standard()) {
+ return "#version 300 es\n";
+ } else {
+ SkASSERT(kGL_GrGLStandard == info.standard());
+ return "#version 330 compatibility\n";
+ }
+ case k310es_GrGLSLGeneration:
+ SkASSERT(kGLES_GrGLStandard == info.standard());
+ return "#version 310 es\n";
default:
SkFAIL("Unknown GL version.");
return ""; // suppress warning