aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-06-19 16:28:41 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-19 21:23:18 +0000
commit23c55b6b18a7f9bb93a303914f89c1d8a576ec81 (patch)
treef161151502a80056a7a2c1e7ad7e609edda5eafb /src/gpu/glsl
parent0e4041f5c962dd16c4a69cbd9ff35685e9519ff3 (diff)
Move GrGLSL.h from include/private to src/gpu/glsl.
Nothing public was including this and it was included unnecessarily in many places. Change-Id: Iee960b3e67981ab41af7442cc43391f2f57eb551 Reviewed-on: https://skia-review.googlesource.com/135787 Commit-Queue: Brian Salomon <bsalomon@google.com> Auto-Submit: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/glsl')
-rw-r--r--src/gpu/glsl/GrGLSL.cpp40
-rw-r--r--src/gpu/glsl/GrGLSL.h58
-rw-r--r--src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp1
3 files changed, 59 insertions, 40 deletions
diff --git a/src/gpu/glsl/GrGLSL.cpp b/src/gpu/glsl/GrGLSL.cpp
index 4791a0ee22..67fe2995fa 100644
--- a/src/gpu/glsl/GrGLSL.cpp
+++ b/src/gpu/glsl/GrGLSL.cpp
@@ -5,26 +5,8 @@
* found in the LICENSE file.
*/
+#include "GrGLSL.h"
#include "GrShaderCaps.h"
-#include "SkString.h"
-#include "../private/GrGLSL.h"
-
-bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration gen) {
- switch (gen) {
- case k110_GrGLSLGeneration:
- return false;
- case k130_GrGLSLGeneration:
- case k140_GrGLSLGeneration:
- case k150_GrGLSLGeneration:
- case k330_GrGLSLGeneration:
- case k400_GrGLSLGeneration:
- case k420_GrGLSLGeneration:
- case k310es_GrGLSLGeneration:
- case k320es_GrGLSLGeneration:
- return true;
- }
- return false;
-}
const char* GrGLSLTypeString(const GrShaderCaps* shaderCaps, GrSLType t) {
switch (t) {
@@ -111,23 +93,3 @@ const char* GrGLSLTypeString(const GrShaderCaps* shaderCaps, GrSLType t) {
SK_ABORT("Unknown shader var type.");
return ""; // suppress warning
}
-
-void GrGLSLAppendDefaultFloatPrecisionDeclaration(GrSLPrecision p,
- const GrShaderCaps& shaderCaps,
- SkString* out) {
- if (shaderCaps.usesPrecisionModifiers()) {
- switch (p) {
- case kHigh_GrSLPrecision:
- out->append("precision highp float;\n");
- break;
- case kMedium_GrSLPrecision:
- out->append("precision mediump float;\n");
- break;
- case kLow_GrSLPrecision:
- out->append("precision lowp float;\n");
- break;
- default:
- SK_ABORT("Unknown precision value.");
- }
- }
-}
diff --git a/src/gpu/glsl/GrGLSL.h b/src/gpu/glsl/GrGLSL.h
new file mode 100644
index 0000000000..743eef1514
--- /dev/null
+++ b/src/gpu/glsl/GrGLSL.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGLSL_DEFINED
+#define GrGLSL_DEFINED
+
+#include "GrTypesPriv.h"
+
+class GrShaderCaps;
+
+// Limited set of GLSL versions we build shaders for. Caller should round
+// down the GLSL version to one of these enums.
+enum GrGLSLGeneration {
+ /**
+ * Desktop GLSL 1.10 and ES2 shading language (based on desktop GLSL 1.20)
+ */
+ k110_GrGLSLGeneration,
+ /**
+ * Desktop GLSL 1.30
+ */
+ k130_GrGLSLGeneration,
+ /**
+ * Desktop GLSL 1.40
+ */
+ k140_GrGLSLGeneration,
+ /**
+ * Desktop GLSL 1.50
+ */
+ k150_GrGLSLGeneration,
+ /**
+ * Desktop GLSL 3.30, and ES GLSL 3.00
+ */
+ k330_GrGLSLGeneration,
+ /**
+ * Desktop GLSL 4.00
+ */
+ k400_GrGLSLGeneration,
+ /**
+ * Desktop GLSL 4.20
+ */
+ k420_GrGLSLGeneration,
+ /**
+ * ES GLSL 3.10 only TODO Make GLSLCap objects to make this more granular
+ */
+ k310es_GrGLSLGeneration,
+ /**
+ * ES GLSL 3.20
+ */
+ k320es_GrGLSLGeneration,
+};
+
+const char* GrGLSLTypeString(const GrShaderCaps*, GrSLType);
+
+#endif
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index 895d344d43..788fd702fe 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -13,7 +13,6 @@
#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLUniformHandler.h"
#include "glsl/GrGLSLVarying.h"
-#include "../private/GrGLSL.h"
const char* GrGLSLFragmentShaderBuilder::kDstColorName = "_dstColor";