diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-02-07 19:37:26 -0500 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-02-07 16:37:26 -0800 |
| commit | 23b36c5cb10c820c0b0f66000711d1013bc009f3 (patch) | |
| tree | b694305dcdecafd27ca785aae000fed610796480 /tests/compute | |
| parent | 4d593fe34ff89ce13882e47ccd95881ef4743c6b (diff) | |
* Improve test coverage of bit cast, particularly for asfloat. Make the values being cast between valid floats. (#832)
* Typo fix
Diffstat (limited to 'tests/compute')
| -rw-r--r-- | tests/compute/bit-cast.slang | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/compute/bit-cast.slang b/tests/compute/bit-cast.slang index 050b84f30..324400a34 100644 --- a/tests/compute/bit-cast.slang +++ b/tests/compute/bit-cast.slang @@ -31,12 +31,19 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) } { - int4 i4 = int4(id, id + 1, id + 2, id + 3); + // Make i4 holds id as floats so we know they are valid float values and not denormals + int4 i4 = int4(asint(float(id)), asint(float(id + 1)), asint(float(id + 2)), asint(float(id + 3))); float4 f4 = asfloat(i4); uint3 u3 = asuint(f4.xyz); float2 f2 = asfloat(u3.xy); - int i1 = asint(id); + uint u1 = asuint(f2.x); + + float f1 = asfloat(u1); + int i1 = asint(f1); + + float f1_ = asfloat(i1); + int i1_ = asint(f1_); - outputBuffer[id + 8] = i1; + outputBuffer[id + 8] = (int)asfloat(i1_); } }
\ No newline at end of file |
