diff options
author | Bill Hollings <bill.hollings@brenwill.com> | 2021-10-20 21:46:30 +0300 |
---|---|---|
committer | Bill Hollings <bill.hollings@brenwill.com> | 2021-10-20 21:46:30 +0300 |
commit | 595eb0c21dc95a27cd7b4626f696f44dfe9c1664 (patch) | |
tree | b5903d565fffecd80f6a2a03276a291fd8abc521 /spirv_glsl.cpp | |
parent | e4243b898ca5e1e19e48725a991ada1e5744691c (diff) |
Per spec, support undefined behavior for out-of-bounds swizzles.
Per spec, instead of throwing exception for out-of-bounds swizzles,
engage undefined behavior by defaulting to the .x swizzle.
Diffstat (limited to 'spirv_glsl.cpp')
-rw-r--r-- | spirv_glsl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp index ccab2084..21d54396 100644 --- a/spirv_glsl.cpp +++ b/spirv_glsl.cpp @@ -8525,7 +8525,7 @@ const char *CompilerGLSL::index_to_swizzle(uint32_t index) case 3: return "w"; default: - SPIRV_CROSS_THROW("Swizzle index out of range"); + return "x"; // Don't crash, but engage the "undefined behavior" described for out-of-bounds logical addressing in spec. } } |