summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/glsl-intrinsic/clock-read.slang19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/glsl-intrinsic/clock-read.slang b/tests/glsl-intrinsic/clock-read.slang
new file mode 100644
index 000000000..4bac5a07d
--- /dev/null
+++ b/tests/glsl-intrinsic/clock-read.slang
@@ -0,0 +1,19 @@
+//TEST:SIMPLE(filecheck=CHECK1): -target glsl
+//TEST:SIMPLE(filecheck=CHECK2): -target spirv
+//TEST:SIMPLE(filecheck=CHECK3): -target spirv -emit-spirv-via-glsl
+
+
+// CHECK1: GL_ARB_shader_clock : require
+// CHECK2: OpCapability ShaderClockKHR
+// CHECK2: OpExtension "SPV_KHR_shader_clock"
+RWStructuredBuffer<float> output;
+
+[shader("compute")]
+[numthreads(1, 1, 1)]
+void computeMain(uint3 id: SV_DispatchThreadID)
+{
+ output[0] = clock2x32ARB().x;
+ // CHECK1: clock2x32ARB
+ // CHECK2: OpReadClockKHR %v2uint %uint_3
+ // CHECK3: OpReadClockKHR %v2uint %uint_3
+}