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 /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 'shaders-hlsl')
-rw-r--r-- | shaders-hlsl/comp/scalar-std450-distance-length-normalize.comp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/shaders-hlsl/comp/scalar-std450-distance-length-normalize.comp b/shaders-hlsl/comp/scalar-std450-distance-length-normalize.comp new file mode 100644 index 00000000..37414737 --- /dev/null +++ b/shaders-hlsl/comp/scalar-std450-distance-length-normalize.comp @@ -0,0 +1,18 @@ +#version 450 +layout(local_size_x = 1) in; + +layout(std430, set = 0, binding = 0) buffer SSBO +{ + float a; + float b; + float c; + float d; + float e; +}; + +void main() +{ + c = distance(a, b); + d = length(a); + e = normalize(a); +} |