summaryrefslogtreecommitdiff
path: root/tests/experiments/generic/generic-in-function.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/experiments/generic/generic-in-function.slang')
-rw-r--r--tests/experiments/generic/generic-in-function.slang30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/experiments/generic/generic-in-function.slang b/tests/experiments/generic/generic-in-function.slang
new file mode 100644
index 000000000..7a45d43de
--- /dev/null
+++ b/tests/experiments/generic/generic-in-function.slang
@@ -0,0 +1,30 @@
+//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
+
+/* It appears the use of a generic defined within a function appears to trigger a crash
+
+
+```
+void Type::accept(ITypeVisitor* visitor, void* extra)
+```
+
+As this is nullptr.
+*/
+
+RWStructuredBuffer<float> outputBuffer;
+
+int doThing()
+{
+ int getValue<let N : int>() { return N; }
+
+ return getValue<10>();
+}
+
+[numthreads(4, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ uint tid = dispatchThreadID.x;
+
+ float inVal = float(tid);
+
+ outputBuffer[tid] = doThing();
+}