[clang] [llvm] [SPIRV] Pack 64-bit vec2 typed buffers into 4x32-bit images (PR #208626)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 14 20:48:12 PDT 2026
================
@@ -890,6 +890,14 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getSPIRVImageTypeFromHLSLResource(
"The element type for a SPIR-V resource must be a scalar integer or "
"floating point type.");
+ // SPIR-V has no 64-bit multi-component image format, so pack a 2-component
+ // 64-bit typed buffer into a 4-component 32-bit image. The backend
+ // reinterprets it with OpBitcast on load and store.
+ if (SampledType->isIntegerTy(64) && NumChannels == 2) {
----------------
farzonl wrote:
what if we got a 64bit type with 3 components or 4? Should we explicitly reject unsupported 64-bit configurations if we can't handle them like this case does?
https://github.com/llvm/llvm-project/pull/208626
More information about the cfe-commits
mailing list