Index: src/gpu/gl/GrGLSL.cpp |
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp |
index 866a0d13d3a03dbc408c79913b1e4cd2143dd5bb..34c805e21fcada65618a8874c9bffc9ee4cf083f 100644 |
--- a/src/gpu/gl/GrGLSL.cpp |
+++ b/src/gpu/gl/GrGLSL.cpp |
@@ -18,7 +18,9 @@ |
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 @@ |
} |
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 @@ |
} 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 |