diff options
| author | Yong He <yonghe@outlook.com> | 2024-07-30 10:52:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-30 10:52:45 -0700 |
| commit | c94fd84eff090f326403e67e712bf38e9e27c36c (patch) | |
| tree | 839fb52c1a9eec4d354b04a85a3d02de96f588aa /source/slang/slang-emit-spirv.cpp | |
| parent | 7e2bc8e06f61d554bae9bbebc1db0302eb3f1d8a (diff) | |
Fix SPIRV emit for small-integer texture types. (#4753)
* Fix SPIRV emit for small-integer texture types.
* Disable -emit-spirv-via-glsl test.
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
| -rw-r--r-- | source/slang/slang-emit-spirv.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index cb9eb0ae9..23eaa4435 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -6423,11 +6423,12 @@ struct SPIRVEmitContext // If the component types are not the same, convert them to be so. if (!isTypeEqual(getVectorElementType(toType), fromElementType)) { + SpvOp convertOp = isIntegralType(fromElementType) ? (isSignedType(fromElementType) ? SpvOpSConvert : SpvOpUConvert) : SpvOpFConvert; auto newFromType = replaceVectorElementType(fromType, getVectorElementType(toType)); fromSpvInst = emitInstCustomOperandFunc( parent, nullptr, - SpvOpFConvert, + convertOp, [&]() { emitOperand(newFromType); emitOperand(kResultID), |
