diff options
author | Sarah Spall <sarahspall@microsoft.com> | 2025-06-27 13:43:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-27 13:43:03 -0700 |
commit | 23be14b22200905b42bcea9add95f1f9233c728a (patch) | |
tree | ea02a55aefae30e7bf9d28c091951b6fa65313f0 /clang/lib | |
parent | f20ef8520ddc5c8dfa925b7a6be3aad7622ffc17 (diff) | |
download | llvm-23be14b22200905b42bcea9add95f1f9233c728a.zip llvm-23be14b22200905b42bcea9add95f1f9233c728a.tar.gz llvm-23be14b22200905b42bcea9add95f1f9233c728a.tar.bz2 |
[HLSL][SPIRV] Boolean in a RawBuffer should be i32 and Boolean vector in a RawBuffer should be <N x i32> (#144929)
Instead of converting the type in a RawBuffer to its HLSL type using
'ConvertType', use 'ConvertTypeForMem'.
ConvertTypeForMem handles booleans being i32 and boolean vectors being <
N x i32 >.
Add tests to show booleans and boolean vectors in RawBuffers now have
the correct type of i32, and respectively.
Closes #141089
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/Targets/SPIR.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/Targets/SPIR.cpp b/clang/lib/CodeGen/Targets/SPIR.cpp index be9a5e6..5b4a89a 100644 --- a/clang/lib/CodeGen/Targets/SPIR.cpp +++ b/clang/lib/CodeGen/Targets/SPIR.cpp @@ -487,7 +487,7 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType( assert(!ResAttrs.IsROV && "Rasterizer order views not implemented for SPIR-V yet"); - llvm::Type *ElemType = CGM.getTypes().ConvertType(ContainedTy); + llvm::Type *ElemType = CGM.getTypes().ConvertTypeForMem(ContainedTy); if (!ResAttrs.RawBuffer) { // convert element type return getSPIRVImageTypeFromHLSLResource(ResAttrs, ElemType, Ctx); |