OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrGLSL.h" | 8 #include "GrGLSL.h" |
9 #include "GrGLSLCaps.h" | 9 #include "GrGLSLCaps.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
11 | 11 |
12 bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration gen) { | 12 bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration gen) { |
13 switch (gen) { | 13 switch (gen) { |
14 case k110_GrGLSLGeneration: | 14 case k110_GrGLSLGeneration: |
15 return false; | 15 return false; |
16 case k130_GrGLSLGeneration: | 16 case k130_GrGLSLGeneration: |
17 case k140_GrGLSLGeneration: | 17 case k140_GrGLSLGeneration: |
18 case k150_GrGLSLGeneration: | 18 case k150_GrGLSLGeneration: |
19 case k330_GrGLSLGeneration: | 19 case k330_GrGLSLGeneration: |
| 20 case k400_GrGLSLGeneration: |
20 case k310es_GrGLSLGeneration: | 21 case k310es_GrGLSLGeneration: |
| 22 case k320es_GrGLSLGeneration: |
21 return true; | 23 return true; |
22 } | 24 } |
23 return false; | 25 return false; |
24 } | 26 } |
25 | 27 |
26 void GrGLSLAppendDefaultFloatPrecisionDeclaration(GrSLPrecision p, | 28 void GrGLSLAppendDefaultFloatPrecisionDeclaration(GrSLPrecision p, |
27 const GrGLSLCaps& glslCaps, | 29 const GrGLSLCaps& glslCaps, |
28 SkString* out) { | 30 SkString* out) { |
29 if (glslCaps.usesPrecisionModifiers()) { | 31 if (glslCaps.usesPrecisionModifiers()) { |
30 switch (p) { | 32 switch (p) { |
(...skipping 16 matching lines...) Expand all Loading... |
47 if (mulFactor.isOnes()) { | 49 if (mulFactor.isOnes()) { |
48 *outAppend = SkString(); | 50 *outAppend = SkString(); |
49 } | 51 } |
50 | 52 |
51 if (mulFactor.isZeros()) { | 53 if (mulFactor.isZeros()) { |
52 outAppend->appendf("%s = vec4(0);", vec4VarName); | 54 outAppend->appendf("%s = vec4(0);", vec4VarName); |
53 } else { | 55 } else { |
54 outAppend->appendf("%s *= %s;", vec4VarName, mulFactor.c_str()); | 56 outAppend->appendf("%s *= %s;", vec4VarName, mulFactor.c_str()); |
55 } | 57 } |
56 } | 58 } |
OLD | NEW |