(shaderType, floatPrecision)
| 871 | } |
| 872 | |
| 873 | _webGL2CompatibilityPrefix(shaderType, floatPrecision) { |
| 874 | let code = ""; |
| 875 | if (this.webglVersion === constants.WEBGL2) { |
| 876 | code += "#version 300 es\n#define WEBGL2\n"; |
| 877 | } |
| 878 | if (shaderType === "vert") { |
| 879 | code += "#define VERTEX_SHADER\n"; |
| 880 | } else if (shaderType === "frag") { |
| 881 | code += "#define FRAGMENT_SHADER\n"; |
| 882 | } |
| 883 | if (floatPrecision) { |
| 884 | code += `precision ${floatPrecision} float;\n`; |
| 885 | } |
| 886 | return code; |
| 887 | } |
| 888 | |
| 889 | /* |
| 890 | * WebGL-specific implementation of imageLight shader creation |
no outgoing calls
no test coverage detected