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

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

Issue 659443007: Support GLSL es 3.00 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: bug war Created 6 years, 2 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
Index: src/gpu/gl/GrGLSL.cpp
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp
index 866a0d13d3a03dbc408c79913b1e4cd2143dd5bb..592ad63083cdea8f2a9bdddb8985a6055699e987 100644
--- a/src/gpu/gl/GrGLSL.cpp
+++ b/src/gpu/gl/GrGLSL.cpp
@@ -31,7 +31,14 @@ bool GrGetGLSLGeneration(const GrGLInterface* gl, GrGLSLGeneration* generation)
case kGLES_GrGLStandard:
// version 1.00 of ES GLSL based on ver 1.20 of desktop GLSL
bsalomon 2014/10/16 01:41:35 This comment should probably go
SkASSERT(ver >= GR_GL_VER(1,00));
- *generation = k110_GrGLSLGeneration;
+ if (ver >= GR_GLSL_VER(3,1)) {
+ *generation = k310_GrGLSLGeneration;
+ }
+ else if (ver >= GR_GLSL_VER(3,0)) {
+ *generation = k300_GrGLSLGeneration;
+ } else {
+ *generation = k110_GrGLSLGeneration;
+ }
return true;
default:
SkFAIL("Unknown GL Standard");
@@ -63,6 +70,12 @@ const char* GrGetGLSLVersionDecl(const GrGLContextInfo& info) {
} else {
return "#version 150 compatibility\n";
}
+ case k300_GrGLSLGeneration:
bsalomon 2014/10/16 01:41:35 I think we should make this work with desktop as w
+ SkASSERT(kGLES_GrGLStandard == info.standard());
+ return "#version 300 es\n";
+ case k310_GrGLSLGeneration:
+ SkASSERT(kGLES_GrGLStandard == info.standard());
+ return "#version 310 es\n";
default:
SkFAIL("Unknown GL version.");
return ""; // suppress warning
« src/gpu/gl/GrGLSL.h ('K') | « src/gpu/gl/GrGLSL.h ('k') | src/gpu/gl/GrGLShaderVar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698