summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2021-01-26 16:04:44 -0500
committerGitHub <noreply@github.com>2021-01-26 13:04:44 -0800
commit50676c741e10ffe6f710c5de86387eaacd274a9a (patch)
tree55e306d241df65af7746e5f8ba593ae72002c704 /tests/bugs
parent798d7731eca286df456bc2ec56c0695ba006b472 (diff)
Obfuscation naming issue fix (#1676)
* #include an absolute path didn't work - because paths were taken to always be relative. * Work around for issue with obfuscation (and lack of name hints) leading to names in output not being correctly uniquified. * Improve appendChar Remove unrequired memory juggling to scrub names. * Remove test code. * Small fixes in comments and method called. * Remove linkage decoration on functions that are specialized. * Obfuscation naming with specialization test. * Fix instruction deletion. Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/obfuscate-specialization-naming.slang23
-rw-r--r--tests/bugs/obfuscate-specialization-naming.slang.expected.txt4
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/bugs/obfuscate-specialization-naming.slang b/tests/bugs/obfuscate-specialization-naming.slang
new file mode 100644
index 000000000..2511adbea
--- /dev/null
+++ b/tests/bugs/obfuscate-specialization-naming.slang
@@ -0,0 +1,23 @@
+//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -compile-arg -obfuscate -shaderobj
+//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -compile-arg -obfuscate -shaderobj
+
+//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):name a
+RWStructuredBuffer<int> a;
+//TEST_INPUT:ubuffer(data=[0 2 4 6], stride=4):name b
+RWStructuredBuffer<int> b;
+
+//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name output
+RWStructuredBuffer<int> output;
+
+int doThing(RWStructuredBuffer<int> buf, int index)
+{
+ return buf[index];
+}
+
+[numthreads(16, 1, 1)]
+void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
+{
+ int tid = int(dispatchThreadID.x);
+
+ output[tid] = doThing(a, tid) | doThing(b, tid);
+} \ No newline at end of file
diff --git a/tests/bugs/obfuscate-specialization-naming.slang.expected.txt b/tests/bugs/obfuscate-specialization-naming.slang.expected.txt
new file mode 100644
index 000000000..4a384c4be
--- /dev/null
+++ b/tests/bugs/obfuscate-specialization-naming.slang.expected.txt
@@ -0,0 +1,4 @@
+0
+3
+6
+7