summaryrefslogtreecommitdiffstats
path: root/gfx/skia/skia/src/sksl/sksl_compute.sksl
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/skia/skia/src/sksl/sksl_compute.sksl')
-rw-r--r--gfx/skia/skia/src/sksl/sksl_compute.sksl21
1 files changed, 21 insertions, 0 deletions
diff --git a/gfx/skia/skia/src/sksl/sksl_compute.sksl b/gfx/skia/skia/src/sksl/sksl_compute.sksl
new file mode 100644
index 0000000000..b06cb7b38b
--- /dev/null
+++ b/gfx/skia/skia/src/sksl/sksl_compute.sksl
@@ -0,0 +1,21 @@
+// defines built-in interfaces supported by SkSL compute shaders
+
+layout(builtin=24) in uint3 sk_NumWorkgroups;
+layout(builtin=26) in uint3 sk_WorkgroupID;
+layout(builtin=27) in uint3 sk_LocalInvocationID;
+layout(builtin=28) in uint3 sk_GlobalInvocationID;
+layout(builtin=29) in uint sk_LocalInvocationIndex;
+
+$pure half4 read($readableTexture2D t, uint2 pos);
+void write($writableTexture2D t, uint2 pos, half4 color);
+
+$pure uint width($genTexture2D t);
+$pure uint height($genTexture2D t);
+
+// Control-barrier with memory-ordering constraints applied to
+// workgroup shared memory only.
+void workgroupBarrier();
+
+// Control-barrier with memory-ordering constraints applied to
+// uniform and storage-buffer memory.
+void storageBarrier();