From eab2baa8a4417ef21979f511d5cad2334cd08d25 Mon Sep 17 00:00:00 2001 From: Ethan Nicholas Date: Fri, 13 Apr 2018 15:16:27 -0400 Subject: added sk_LastFragColor Bug: skia: Change-Id: If64d8281beb8b7687db629eef2e956974ee9a979 Reviewed-on: https://skia-review.googlesource.com/121343 Reviewed-by: Brian Salomon Commit-Queue: Ethan Nicholas --- src/sksl/SkSLCompiler.h | 1 + src/sksl/SkSLGLSLCodeGenerator.cpp | 3 +++ src/sksl/sksl_frag.inc | 4 +--- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/sksl') 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; ) -- cgit v1.2.3