Ethan Nicholas | 7970765 | 2017-11-16 11:20:11 -0500 | [diff] [blame] | 1 | STRINGIFY( |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 2 | |
| 3 | // defines built-in interfaces supported by SkiaSL fragment shaders |
| 4 | |
Ethan Nicholas | 8aa4569 | 2017-09-20 11:24:15 -0400 | [diff] [blame] | 5 | layout(builtin=15) in float4 sk_FragCoord; |
| 6 | layout(builtin=3) float sk_ClipDistance[1]; |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 7 | |
| 8 | // 9999 is a temporary value that causes us to ignore these declarations beyond |
| 9 | // adding them to the symbol table. This works fine in GLSL (where they do not |
| 10 | // require any further handling) but will fail in SPIR-V. We'll have a better |
| 11 | // solution for this soon. |
Ethan Nicholas | 8aa4569 | 2017-09-20 11:24:15 -0400 | [diff] [blame] | 12 | layout(builtin=9999) float4 gl_LastFragData[1]; |
Ethan Nicholas | f7b8820 | 2017-09-18 14:10:39 -0400 | [diff] [blame] | 13 | layout(builtin=9999) half4 gl_LastFragColor; |
| 14 | layout(builtin=9999) half4 gl_LastFragColorARM; |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 15 | layout(builtin=9999) int gl_SampleMaskIn[1]; |
| 16 | layout(builtin=9999) out int gl_SampleMask[1]; |
Ethan Nicholas | f7b8820 | 2017-09-18 14:10:39 -0400 | [diff] [blame] | 17 | layout(builtin=9999) half4 gl_SecondaryFragColorEXT; |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 18 | |
Ethan Nicholas | f7b8820 | 2017-09-18 14:10:39 -0400 | [diff] [blame] | 19 | layout(builtin=10003) half4 sk_InColor; |
| 20 | layout(builtin=10004) out half4 sk_OutColor; |
Ethan Nicholas | 8aa4569 | 2017-09-20 11:24:15 -0400 | [diff] [blame] | 21 | layout(builtin=10005) float2[] sk_TransformedCoords2D; |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 22 | layout(builtin=10006) sampler2D[] sk_TextureSamplers; |
Ethan Nicholas | cd700e9 | 2018-08-24 16:43:57 -0400 | [diff] [blame] | 23 | layout(builtin=10011) half sk_Width; |
| 24 | layout(builtin=10012) half sk_Height; |
Ethan Nicholas | 68990be | 2017-07-13 09:36:52 -0400 | [diff] [blame] | 25 | |
Ethan Nicholas | c9472af | 2017-10-10 16:30:21 -0400 | [diff] [blame] | 26 | half4 process(fragmentProcessor fp); |
Michael Ludwig | 92e4c7f | 2018-08-30 16:08:18 -0400 | [diff] [blame] | 27 | half4 process(fragmentProcessor fp, half4 input); |
Ethan Nicholas | 7970765 | 2017-11-16 11:20:11 -0500 | [diff] [blame] | 28 | ) |