diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2019-06-28 12:19:19 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2019-06-28 12:20:14 +0300 |
commit | ff87419607dd8f8dfbd6f4165c102262c0b91368 (patch) | |
tree | 7d04449a3e0e292fa76fe5415ee0bb91618f77d6 /reference/shaders-hlsl | |
parent | d1bdb6d49144d23c75963e89cd6369d9d0406f7d (diff) |
Deal with scalar input values for distance/length/normalize.
HLSL and MSL don't support it, so fall back to simpler intrinsics.
Diffstat (limited to 'reference/shaders-hlsl')
-rw-r--r-- | reference/shaders-hlsl/comp/scalar-std450-distance-length-normalize.comp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/reference/shaders-hlsl/comp/scalar-std450-distance-length-normalize.comp b/reference/shaders-hlsl/comp/scalar-std450-distance-length-normalize.comp new file mode 100644 index 00000000..47f2fe41 --- /dev/null +++ b/reference/shaders-hlsl/comp/scalar-std450-distance-length-normalize.comp @@ -0,0 +1,14 @@ +RWByteAddressBuffer _9 : register(u0); + +void comp_main() +{ + _9.Store(8, asuint(distance(asfloat(_9.Load(0)), asfloat(_9.Load(4))))); + _9.Store(12, asuint(length(asfloat(_9.Load(0))))); + _9.Store(16, asuint(sign(asfloat(_9.Load(0))))); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} |