Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Hollings <bill.hollings@brenwill.com>2021-10-20 21:46:30 +0300
committerBill Hollings <bill.hollings@brenwill.com>2021-10-20 21:46:30 +0300
commit595eb0c21dc95a27cd7b4626f696f44dfe9c1664 (patch)
treeb5903d565fffecd80f6a2a03276a291fd8abc521 /spirv_glsl.cpp
parente4243b898ca5e1e19e48725a991ada1e5744691c (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.cpp2
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.
}
}