aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2018-04-13 15:16:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-13 20:09:12 +0000
commiteab2baa8a4417ef21979f511d5cad2334cd08d25 (patch)
treebe48fc68fe640f6994779fe49f44fb7f90ac3439 /src/sksl
parent1749af20a11d0f364dbb7cad8dc89101f956c923 (diff)
added sk_LastFragColor
Bug: skia: Change-Id: If64d8281beb8b7687db629eef2e956974ee9a979 Reviewed-on: https://skia-review.googlesource.com/121343 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl')
-rw-r--r--src/sksl/SkSLCompiler.h1
-rw-r--r--src/sksl/SkSLGLSLCodeGenerator.cpp3
-rw-r--r--src/sksl/sksl_frag.inc4
3 files changed, 5 insertions, 3 deletions
diff --git a/src/sksl/SkSLCompiler.h b/src/sksl/SkSLCompiler.h
index 0ed6a3bdbb..7a188e009e 100644
--- a/src/sksl/SkSLCompiler.h
+++ b/src/sksl/SkSLCompiler.h
@@ -25,6 +25,7 @@
#define SK_TRANSFORMEDCOORDS2D_BUILTIN 10005
#define SK_TEXTURESAMPLERS_BUILTIN 10006
#define SK_OUT_BUILTIN 10007
+#define SK_LASTFRAGCOLOR_BUILTIN 10008
#define SK_FRAGCOORD_BUILTIN 15
#define SK_VERTEXID_BUILTIN 42
#define SK_INSTANCEID_BUILTIN 43
diff --git a/src/sksl/SkSLGLSLCodeGenerator.cpp b/src/sksl/SkSLGLSLCodeGenerator.cpp
index 43c1c95327..0ee0afa6a6 100644
--- a/src/sksl/SkSLGLSLCodeGenerator.cpp
+++ b/src/sksl/SkSLGLSLCodeGenerator.cpp
@@ -694,6 +694,9 @@ void GLSLCodeGenerator::writeVariableReference(const VariableReference& ref) {
case SK_INVOCATIONID_BUILTIN:
this->write("gl_InvocationID");
break;
+ case SK_LASTFRAGCOLOR_BUILTIN:
+ this->write(fProgram.fSettings.fCaps->fbFetchColorName());
+ break;
default:
this->write(ref.fVariable.fName);
}
diff --git a/src/sksl/sksl_frag.inc b/src/sksl/sksl_frag.inc
index e96165be1f..429d05a73e 100644
--- a/src/sksl/sksl_frag.inc
+++ b/src/sksl/sksl_frag.inc
@@ -9,13 +9,11 @@ layout(builtin=3) float sk_ClipDistance[1];
// adding them to the symbol table. This works fine in GLSL (where they do not
// require any further handling) but will fail in SPIR-V. We'll have a better
// solution for this soon.
-layout(builtin=9999) float4 gl_LastFragData[1];
-layout(builtin=9999) half4 gl_LastFragColor;
-layout(builtin=9999) half4 gl_LastFragColorARM;
layout(builtin=9999) int gl_SampleMaskIn[1];
layout(builtin=9999) out int gl_SampleMask[1];
layout(builtin=9999) out half4 gl_SecondaryFragColorEXT;
layout(location=0,index=0,builtin=10001) out half4 sk_FragColor;
+layout(builtin=10008) half4 sk_LastFragColor;
)