summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/reflection/actual-global.slang12
-rw-r--r--tests/reflection/actual-global.slang.expected51
2 files changed, 63 insertions, 0 deletions
diff --git a/tests/reflection/actual-global.slang b/tests/reflection/actual-global.slang
new file mode 100644
index 000000000..806b75f2f
--- /dev/null
+++ b/tests/reflection/actual-global.slang
@@ -0,0 +1,12 @@
+//TEST(64-bit):REFLECTION:-stage compute -no-codegen -target host-callable -entry computeMain
+
+__global int actualGlobal;
+int regularGlobal;
+
+RWStructuredBuffer<int> outputBuffer;
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ outputBuffer[dispatchThreadID.x] = dispatchThreadID.x + actualGlobal + regularGlobal;
+} \ No newline at end of file
diff --git a/tests/reflection/actual-global.slang.expected b/tests/reflection/actual-global.slang.expected
new file mode 100644
index 000000000..5dbcde22e
--- /dev/null
+++ b/tests/reflection/actual-global.slang.expected
@@ -0,0 +1,51 @@
+result code = 0
+standard error = {
+}
+standard output = {
+{
+ "parameters": [
+ {
+ "name": "regularGlobal",
+ "binding": {"kind": "uniform", "offset": 0, "size": 4},
+ "type": {
+ "kind": "scalar",
+ "scalarType": "int32"
+ }
+ },
+ {
+ "name": "outputBuffer",
+ "binding": {"kind": "uniform", "offset": 8, "size": 16},
+ "type": {
+ "kind": "resource",
+ "baseShape": "structuredBuffer",
+ "access": "readWrite",
+ "resultType": {
+ "kind": "scalar",
+ "scalarType": "int32"
+ }
+ }
+ }
+ ],
+ "entryPoints": [
+ {
+ "name": "computeMain",
+ "stage:": "compute",
+ "parameters": [
+ {
+ "name": "dispatchThreadID",
+ "semanticName": "SV_DISPATCHTHREADID",
+ "type": {
+ "kind": "vector",
+ "elementCount": 3,
+ "elementType": {
+ "kind": "scalar",
+ "scalarType": "uint32"
+ }
+ }
+ }
+ ],
+ "threadGroupSize": [4, 1, 1]
+ }
+ ]
+}
+}