summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorkaizhangNV <149626564+kaizhangNV@users.noreply.github.com>2024-07-09 08:58:35 -0700
committerGitHub <noreply@github.com>2024-07-09 08:58:35 -0700
commit29418735e5f806e8c0e365314154f55a753e5271 (patch)
treec5c27c14484305e616982d6ed237746637a27d48 /tests
parent5a174dfab4ae0852cb96df5f48bae474949cc017 (diff)
Add intrinsic for clock2x32ARB (#4563)
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
+}