blob: 5bc5f55dce718026a765feac91d8b83d2354539a [file] [log] [blame]
Ethan Nicholas79707652017-11-16 11:20:11 -05001STRINGIFY(
ethannicholasb3058bd2016-07-01 08:22:01 -07002
3// defines built-in interfaces supported by SkiaSL fragment shaders
4
Chris Dalton49d14e92018-07-27 12:38:35 -06005// See "enum SpvBuiltIn_" in ./spirv.h
Ethan Nicholas8aa45692017-09-20 11:24:15 -04006layout(builtin=15) in float4 sk_FragCoord;
Chris Dalton49d14e92018-07-27 12:38:35 -06007layout(builtin=17) in bool sk_Clockwise; // Similar to gl_FrontFacing, but defined in device space.
Ethan Nicholas8aa45692017-09-20 11:24:15 -04008layout(builtin=3) float sk_ClipDistance[1];
ethannicholasb3058bd2016-07-01 08:22:01 -07009
ethannicholas5961bc92016-10-12 06:39:56 -070010// 9999 is a temporary value that causes us to ignore these declarations beyond
11// adding them to the symbol table. This works fine in GLSL (where they do not
12// require any further handling) but will fail in SPIR-V. We'll have a better
13// solution for this soon.
Ben Wagnerd9fcb232016-11-04 13:07:29 -040014layout(builtin=9999) int gl_SampleMaskIn[1];
15layout(builtin=9999) out int gl_SampleMask[1];
Ethan Nicholasf7b88202017-09-18 14:10:39 -040016layout(builtin=9999) out half4 gl_SecondaryFragColorEXT;
jvanverth9df16b52016-10-11 10:03:56 -070017
Ethan Nicholasf7b88202017-09-18 14:10:39 -040018layout(location=0,index=0,builtin=10001) out half4 sk_FragColor;
Ethan Nicholaseab2baa2018-04-13 15:16:27 -040019layout(builtin=10008) half4 sk_LastFragColor;
Ethan Nicholascd700e92018-08-24 16:43:57 -040020layout(builtin=10011) half sk_Width;
21layout(builtin=10012) half sk_Height;
ethannicholas5961bc92016-10-12 06:39:56 -070022
Ethan Nicholas79707652017-11-16 11:20:11 -050023)