diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-12-02 11:14:28 -0500 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-12-02 08:14:28 -0800 |
| commit | a3651d99fb8f3a046365d60751d1f3f806e48f7a (patch) | |
| tree | 8950724957bb7f2cdaa45bfa2b75cbe4e38e947b /tests | |
| parent | c6393465795e700a68458ff618041104f89ed42b (diff) | |
Fix bug in calcSafeRadians. (#1138)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/compute/transcendental.slang | 31 | ||||
| -rw-r--r-- | tests/compute/transcendental.slang.expected.txt | 16 |
2 files changed, 47 insertions, 0 deletions
diff --git a/tests/compute/transcendental.slang b/tests/compute/transcendental.slang new file mode 100644 index 000000000..aa40da752 --- /dev/null +++ b/tests/compute/transcendental.slang @@ -0,0 +1,31 @@ +//TEST(compute):COMPARE_COMPUTE:-cpu +//TEST(compute):COMPARE_COMPUTE: +//TEST(compute,vulcan):COMPARE_COMPUTE:-vk + +//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<int> outputBuffer : register(u0); + +int quantize(double value) +{ + return int(value * 256); +} + +int quantize(float value) +{ + return int(value * 256); +} + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + float values[] = { -9, 9, -3, 3 }; + + int tid = int(dispatchThreadID.x); + float value = values[tid]; + + outputBuffer[tid * 4] = quantize(sin(value)); + outputBuffer[tid * 4 + 1] = quantize(cos(value)); + + outputBuffer[tid * 4 + 2] = quantize(sin(double(value))); + outputBuffer[tid * 4 + 3] = quantize(cos(double(value))); +}
\ No newline at end of file diff --git a/tests/compute/transcendental.slang.expected.txt b/tests/compute/transcendental.slang.expected.txt new file mode 100644 index 000000000..4a525cc7c --- /dev/null +++ b/tests/compute/transcendental.slang.expected.txt @@ -0,0 +1,16 @@ +FFFFFF97 +FFFFFF17 +FFFFFF97 +FFFFFF17 +69 +FFFFFF17 +69 +FFFFFF17 +FFFFFFDC +FFFFFF03 +FFFFFFDC +FFFFFF03 +24 +FFFFFF03 +24 +FFFFFF03 |
