summaryrefslogtreecommitdiffstats
path: root/tests/hlsl/simple
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-10-12 10:30:48 -0700
committerGitHub <noreply@github.com>2017-10-12 10:30:48 -0700
commit9a231a5efb0ddce635e7e40c2d5b086ff4bd389a (patch)
tree7e9d6a2b97928820687fbc04927bf2224964d40f /tests/hlsl/simple
parent28ca4dc60aecc0acda8b364d0553a72d2e6c7964 (diff)
Do loop fix (#209)
* Bug fix: emit logic for `do` loops This case was never tested, and I was outputting some garbage characters. This comit fixes the codegen and adds a test case. * Bug fix: make sure to pass through `[allow_uav_condition]` This also fixes the standard library definition of `IncrementCounter()` so that it returns a `uint` instead of `void`.
Diffstat (limited to 'tests/hlsl/simple')
-rw-r--r--tests/hlsl/simple/allow-uav-conditional.hlsl19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/hlsl/simple/allow-uav-conditional.hlsl b/tests/hlsl/simple/allow-uav-conditional.hlsl
new file mode 100644
index 000000000..3da239860
--- /dev/null
+++ b/tests/hlsl/simple/allow-uav-conditional.hlsl
@@ -0,0 +1,19 @@
+//TEST:COMPARE_HLSL: -profile cs_5_0 -target dxbc-assembly
+
+// Check output for `[allow_uav_conditional]`
+
+RWStructuredBuffer<uint> gBuffer : register(u0);
+
+[numthreads(16,1,1)]
+void main(
+ uint tid : SV_DispatchThreadID)
+{
+ uint index = tid;
+
+ [allow_uav_condition]
+ while(gBuffer[index] != 0)
+ {
+ index = gBuffer[index];
+ gBuffer[index]--;
+ }
+}