Ethan Nicholas | 7970765 | 2017-11-16 11:20:11 -0500 | [diff] [blame] | 1 | STRINGIFY( |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 2 | |
| 3 | // defines built-in interfaces supported by SkiaSL fragment shaders |
| 4 | |
Chris Dalton | 49d14e9 | 2018-07-27 12:38:35 -0600 | [diff] [blame] | 5 | // See "enum SpvBuiltIn_" in ./spirv.h |
Ethan Nicholas | 8aa4569 | 2017-09-20 11:24:15 -0400 | [diff] [blame] | 6 | layout(builtin=15) in float4 sk_FragCoord; |
Chris Dalton | 49d14e9 | 2018-07-27 12:38:35 -0600 | [diff] [blame] | 7 | layout(builtin=17) in bool sk_Clockwise; // Similar to gl_FrontFacing, but defined in device space. |
Ethan Nicholas | 8aa4569 | 2017-09-20 11:24:15 -0400 | [diff] [blame] | 8 | layout(builtin=3) float sk_ClipDistance[1]; |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 9 | |
ethannicholas | 5961bc9 | 2016-10-12 06:39:56 -0700 | [diff] [blame] | 10 | // 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 Wagner | d9fcb23 | 2016-11-04 13:07:29 -0400 | [diff] [blame] | 14 | layout(builtin=9999) int gl_SampleMaskIn[1]; |
| 15 | layout(builtin=9999) out int gl_SampleMask[1]; |
Ethan Nicholas | f7b8820 | 2017-09-18 14:10:39 -0400 | [diff] [blame] | 16 | layout(builtin=9999) out half4 gl_SecondaryFragColorEXT; |
jvanverth | 9df16b5 | 2016-10-11 10:03:56 -0700 | [diff] [blame] | 17 | |
Ethan Nicholas | f7b8820 | 2017-09-18 14:10:39 -0400 | [diff] [blame] | 18 | layout(location=0,index=0,builtin=10001) out half4 sk_FragColor; |
Ethan Nicholas | eab2baa | 2018-04-13 15:16:27 -0400 | [diff] [blame] | 19 | layout(builtin=10008) half4 sk_LastFragColor; |
Ethan Nicholas | cd700e9 | 2018-08-24 16:43:57 -0400 | [diff] [blame] | 20 | layout(builtin=10011) half sk_Width; |
| 21 | layout(builtin=10012) half sk_Height; |
ethannicholas | 5961bc9 | 2016-10-12 06:39:56 -0700 | [diff] [blame] | 22 | |
Ethan Nicholas | 7970765 | 2017-11-16 11:20:11 -0500 | [diff] [blame] | 23 | ) |