aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sksl/SkSLCompiler.cpp2
-rw-r--r--src/sksl/sksl.include8
-rw-r--r--src/sksl/sksl_fp.include4
-rw-r--r--src/sksl/sksl_frag.include4
-rw-r--r--src/sksl/sksl_geom.include4
-rw-r--r--src/sksl/sksl_vert.include4
6 files changed, 14 insertions, 12 deletions
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 3b91511110..a38d280315 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -31,6 +31,8 @@
// include the built-in shader symbols as static strings
+#define STRINGIFY(x) #x
+
static const char* SKSL_INCLUDE =
#include "sksl.include"
;
diff --git a/src/sksl/sksl.include b/src/sksl/sksl.include
index 9621f889fe..2b433ebd0f 100644
--- a/src/sksl/sksl.include
+++ b/src/sksl/sksl.include
@@ -1,4 +1,4 @@
-R"(
+STRINGIFY(
// defines built-in functions supported by SkiaSL
@@ -330,11 +330,11 @@ float4 subpassLoad(subpassInputMS subpass, int sample);
$gfloat4subpassLoad(gsubpassInput subpass);
$gfloat4subpassLoad(gsubpassInputMS subpass, int sample);
*/
-)"
+)
// split into multiple chunks, as MSVC++ complains if a single string is too long
-R"(
+STRINGIFY(
half4 texture($gsampler1D sampler, float2 P);
half4 texture($gsampler1D sampler, float2 P, float bias);
@@ -560,4 +560,4 @@ void memoryBarrierImage();
void groupMemoryBarrier();
*/
-)"
+)
diff --git a/src/sksl/sksl_fp.include b/src/sksl/sksl_fp.include
index 9b1eb2a540..d407fd08f6 100644
--- a/src/sksl/sksl_fp.include
+++ b/src/sksl/sksl_fp.include
@@ -1,4 +1,4 @@
-R"(
+STRINGIFY(
// defines built-in interfaces supported by SkiaSL fragment shaders
@@ -22,4 +22,4 @@ layout(builtin=10005) float2[] sk_TransformedCoords2D;
layout(builtin=10006) sampler2D[] sk_TextureSamplers;
half4 process(fragmentProcessor fp);
-)"
+)
diff --git a/src/sksl/sksl_frag.include b/src/sksl/sksl_frag.include
index c041dbfb94..e96165be1f 100644
--- a/src/sksl/sksl_frag.include
+++ b/src/sksl/sksl_frag.include
@@ -1,4 +1,4 @@
-R"(
+STRINGIFY(
// defines built-in interfaces supported by SkiaSL fragment shaders
@@ -18,4 +18,4 @@ layout(builtin=9999) out half4 gl_SecondaryFragColorEXT;
layout(location=0,index=0,builtin=10001) out half4 sk_FragColor;
-)"
+)
diff --git a/src/sksl/sksl_geom.include b/src/sksl/sksl_geom.include
index fcac8dade7..3e5ffaed37 100644
--- a/src/sksl/sksl_geom.include
+++ b/src/sksl/sksl_geom.include
@@ -1,4 +1,4 @@
-R"(
+STRINGIFY(
// defines built-in interfaces supported by SkiaSL geometry shaders
@@ -21,4 +21,4 @@ sk_has_side_effects void EndStreamPrimitive(int stream);
sk_has_side_effects void EmitVertex();
sk_has_side_effects void EndPrimitive();
-)"
+)
diff --git a/src/sksl/sksl_vert.include b/src/sksl/sksl_vert.include
index 4cc06469ba..da2a1a2513 100644
--- a/src/sksl/sksl_vert.include
+++ b/src/sksl/sksl_vert.include
@@ -1,4 +1,4 @@
-R"(
+STRINGIFY(
// defines built-in interfaces supported by SkiaSL vertex shaders
@@ -11,4 +11,4 @@ out sk_PerVertex {
layout(builtin=5) in int sk_VertexID;
layout(builtin=6) in int sk_InstanceID;
-)"
+)