GrAssert(ver >= GR_GLSL_VER(1,10));
if (ver >= GR_GLSL_VER(1,50)) {
return k150_GrGLSLGeneration;
+ } else if (ver >= GR_GLSL_VER(1,40)) {
+ return k140_GrGLSLGeneration;
} else if (ver >= GR_GLSL_VER(1,30)) {
return k130_GrGLSLGeneration;
} else {
case k130_GrGLSLGeneration:
GrAssert(kDesktop_GrGLBinding == binding);
return "#version 130\n";
+ case k140_GrGLSLGeneration:
+ GrAssert(kDesktop_GrGLBinding == binding);
+ return "#version 140\n";
case k150_GrGLSLGeneration:
GrAssert(kDesktop_GrGLBinding == binding);
return "#version 150\n";
// down the GLSL version to one of these enums.
enum GrGLSLGeneration {
/**
- * Desktop GLSL 1.10 and ES2 shading lang (based on desktop GLSL 1.20)
+ * Desktop GLSL 1.10 and ES2 shading language (based on desktop GLSL 1.20)
*/
k110_GrGLSLGeneration,
/**
*/
k130_GrGLSLGeneration,
/**
- * Dekstop GLSL 1.50
+ * Desktop GLSL 1.40
+ */
+ k140_GrGLSLGeneration,
+ /**
+ * Desktop GLSL 1.50
*/
k150_GrGLSLGeneration,
};
/**
* Types of shader-language-specific boxed variables we can create.
* (Currently only GrGLShaderVars, but should be applicable to other shader
- * langauges.)
+ * languages.)
*/
enum GrSLType {
kVoid_GrSLType,
const GrGLInterface* gl);
/**
- * Returns a string to include at the begining of a shader to declare the GLSL
+ * Returns a string to include at the beginning of a shader to declare the GLSL
* version.
*/
const char* GrGetGLSLVersionDecl(GrGLBinding binding,
* vec4(0,0,0,0) is assumed. It is an error to pass kNone for default<i> if in<i> is NULL or "".
* Note that when if function determines that the result is a zeros or ones vec then any expression
* represented by in0 or in1 will not be emitted. The return value indicates whether a zeros, ones
- * or neither was appeneded.
+ * or neither was appended.
*/
GrSLConstantVec GrGLSLModulate4f(SkString* outAppend,
const char* in0,
/**
* Does an inplace mul, *=, of vec4VarName by mulFactor. If mulFactorDefault is not kNone then
- * mulFactor may be either "" or NULL. In this case either nothing will be appened (kOnes) or an
+ * mulFactor may be either "" or NULL. In this case either nothing will be appended (kOnes) or an
* assignment of vec(0,0,0,0) will be appended (kZeros). The assignment is prepended by tabCnt tabs.
* A semicolon and newline are added after the assignment. (TODO: Remove tabCnt when we auto-insert
* tabs to custom stage-generated lines.) If a zeros vec is assigned then the return value is