Skip to content

Commit 7d3d8bb

Browse files
committed
[HLSL][SPRIV] Handle sign RWBuffer correctly
In Vulkan, the signedness of the accesses to images has to match the signedness of the backing image. See https://docs.vulkan.org/spec/latest/chapters/textures.html#textures-input, where it says the behaviour is undefined if > the signedness of any read or sample operation does not match the signedness of the image’s format. Users who define say an `RWBuffer<int>` will create a Vulkan image with a signed integer format. So the HLSL that is generated must match that expecation. The solution we use is to generate a `spirv.SignedImage` target type for signed integer instead of `spirv.Image`. The two types are otherwise the same. The backend will add the `signExtend` image operand to access to the image to ensure the image is access as a signed image. Fixes #144580
1 parent 0fb198e commit 7d3d8bb

File tree

14 files changed

+403
-79
lines changed

14 files changed

+403
-79
lines changed

clang/lib/CodeGen/Targets/SPIR.cpp

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class CommonSPIRTargetCodeGenInfo : public TargetCodeGenInfo {
5858
const SmallVector<int32_t> *Packoffsets = nullptr) const override;
5959
llvm::Type *getSPIRVImageTypeFromHLSLResource(
6060
const HLSLAttributedResourceType::Attributes &attributes,
61-
llvm::Type *ElementType, llvm::LLVMContext &Ctx) const;
61+
QualType SampledType, CodeGenModule &CGM) const;
6262
void
6363
setOCLKernelStubCallingConvention(const FunctionType *&FT) const override;
6464
};
@@ -483,12 +483,12 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
483483
assert(!ResAttrs.IsROV &&
484484
"Rasterizer order views not implemented for SPIR-V yet");
485485

486-
llvm::Type *ElemType = CGM.getTypes().ConvertType(ContainedTy);
487486
if (!ResAttrs.RawBuffer) {
488487
// convert element type
489-
return getSPIRVImageTypeFromHLSLResource(ResAttrs, ElemType, Ctx);
488+
return getSPIRVImageTypeFromHLSLResource(ResAttrs, ContainedTy, CGM);
490489
}
491490

491+
llvm::Type *ElemType = CGM.getTypes().ConvertType(ContainedTy);
492492
llvm::ArrayType *RuntimeArrayType = llvm::ArrayType::get(ElemType, 0);
493493
uint32_t StorageClass = /* StorageBuffer storage class */ 12;
494494
bool IsWritable = ResAttrs.ResourceClass == llvm::dxil::ResourceClass::UAV;
@@ -516,13 +516,18 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
516516
}
517517

518518
llvm::Type *CommonSPIRTargetCodeGenInfo::getSPIRVImageTypeFromHLSLResource(
519-
const HLSLAttributedResourceType::Attributes &attributes,
520-
llvm::Type *ElementType, llvm::LLVMContext &Ctx) const {
519+
const HLSLAttributedResourceType::Attributes &attributes, QualType Ty,
520+
CodeGenModule &CGM) const {
521+
llvm::LLVMContext &Ctx = CGM.getLLVMContext();
521522

522-
if (ElementType->isVectorTy())
523-
ElementType = ElementType->getScalarType();
523+
Ty = Ty->getCanonicalTypeUnqualified();
524+
if (const VectorType *V = dyn_cast<VectorType>(Ty))
525+
Ty = V->getElementType();
526+
assert(!Ty->isVectorType() && "We still have a vector type.");
524527

525-
assert((ElementType->isIntegerTy() || ElementType->isFloatingPointTy()) &&
528+
llvm::Type *SampledType = CGM.getTypes().ConvertType(Ty);
529+
530+
assert((SampledType->isIntegerTy() || SampledType->isFloatingPointTy()) &&
526531
"The element type for a SPIR-V resource must be a scalar integer or "
527532
"floating point type.");
528533

@@ -531,6 +536,9 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getSPIRVImageTypeFromHLSLResource(
531536
// https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpTypeImage.
532537
SmallVector<unsigned, 6> IntParams(6, 0);
533538

539+
const char *Name =
540+
Ty->isSignedIntegerType() ? "spirv.SignedImage" : "spirv.Image";
541+
534542
// Dim
535543
// For now we assume everything is a buffer.
536544
IntParams[0] = 5;
@@ -553,7 +561,9 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getSPIRVImageTypeFromHLSLResource(
553561
// Setting to unknown for now.
554562
IntParams[5] = 0;
555563

556-
return llvm::TargetExtType::get(Ctx, "spirv.Image", {ElementType}, IntParams);
564+
llvm::TargetExtType *ImageType =
565+
llvm::TargetExtType::get(Ctx, Name, {SampledType}, IntParams);
566+
return ImageType;
557567
}
558568

559569
std::unique_ptr<TargetCodeGenInfo>

clang/test/CodeGenHLSL/builtins/RWBuffer-elementtype.hlsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
// DXIL: %"class.hlsl::RWBuffer.11" = type { target("dx.TypedBuffer", <3 x float>, 1, 0, 0) }
1717
// DXIL: %"class.hlsl::RWBuffer.12" = type { target("dx.TypedBuffer", <4 x i32>, 1, 0, 1) }
1818

19-
// SPIRV: %"class.hlsl::RWBuffer" = type { target("spirv.Image", i16, 5, 2, 0, 0, 2, 0) }
19+
// SPIRV: %"class.hlsl::RWBuffer" = type { target("spirv.SignedImage", i16, 5, 2, 0, 0, 2, 0) }
2020
// SPIRV: %"class.hlsl::RWBuffer.0" = type { target("spirv.Image", i16, 5, 2, 0, 0, 2, 0) }
21-
// SPIRV: %"class.hlsl::RWBuffer.1" = type { target("spirv.Image", i32, 5, 2, 0, 0, 2, 0) }
21+
// SPIRV: %"class.hlsl::RWBuffer.1" = type { target("spirv.SignedImage", i32, 5, 2, 0, 0, 2, 0) }
2222
// SPIRV: %"class.hlsl::RWBuffer.2" = type { target("spirv.Image", i32, 5, 2, 0, 0, 2, 0) }
23-
// SPIRV: %"class.hlsl::RWBuffer.3" = type { target("spirv.Image", i64, 5, 2, 0, 0, 2, 0) }
23+
// SPIRV: %"class.hlsl::RWBuffer.3" = type { target("spirv.SignedImage", i64, 5, 2, 0, 0, 2, 0) }
2424
// SPIRV: %"class.hlsl::RWBuffer.4" = type { target("spirv.Image", i64, 5, 2, 0, 0, 2, 0) }
2525
// SPIRV: %"class.hlsl::RWBuffer.5" = type { target("spirv.Image", half, 5, 2, 0, 0, 2, 0) }
2626
// SPIRV: %"class.hlsl::RWBuffer.6" = type { target("spirv.Image", float, 5, 2, 0, 0, 2, 0) }
2727
// SPIRV: %"class.hlsl::RWBuffer.7" = type { target("spirv.Image", double, 5, 2, 0, 0, 2, 0) }
28-
// SPIRV: %"class.hlsl::RWBuffer.8" = type { target("spirv.Image", i16, 5, 2, 0, 0, 2, 0) }
28+
// SPIRV: %"class.hlsl::RWBuffer.8" = type { target("spirv.SignedImage", i16, 5, 2, 0, 0, 2, 0) }
2929
// SPIRV: %"class.hlsl::RWBuffer.9" = type { target("spirv.Image", i32, 5, 2, 0, 0, 2, 0) }
3030
// SPIRV: %"class.hlsl::RWBuffer.10" = type { target("spirv.Image", half, 5, 2, 0, 0, 2, 0) }
3131
// SPIRV: %"class.hlsl::RWBuffer.11" = type { target("spirv.Image", float, 5, 2, 0, 0, 2, 0) }
32-
// SPIRV: %"class.hlsl::RWBuffer.12" = type { target("spirv.Image", i32, 5, 2, 0, 0, 2, 0) }
32+
// SPIRV: %"class.hlsl::RWBuffer.12" = type { target("spirv.SignedImage", i32, 5, 2, 0, 0, 2, 0) }
3333

3434
RWBuffer<int16_t> BufI16;
3535
RWBuffer<uint16_t> BufU16;

clang/test/CodeGenHLSL/builtins/RWBuffer-subscript.hlsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ void main(unsigned GI : SV_GroupIndex) {
99
// CHECK: define void @main()
1010

1111
// DXC: %[[INPTR:.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @llvm.dx.resource.getpointer.p0.tdx.TypedBuffer_i32_1_0_1t(target("dx.TypedBuffer", i32, 1, 0, 1) %{{.*}}, i32 %{{.*}})
12-
// SPIRV: %[[INPTR:.*]] = call noundef align 4 dereferenceable(4) ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.Image_i32_5_2_0_0_2_0t(target("spirv.Image", i32, 5, 2, 0, 0, 2, 0) %{{.*}}, i32 %{{.*}})
12+
// SPIRV: %[[INPTR:.*]] = call noundef align 4 dereferenceable(4) ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.SignedImage_i32_5_2_0_0_2_0t(target("spirv.SignedImage", i32, 5, 2, 0, 0, 2, 0) %{{.*}}, i32 %{{.*}})
1313
// CHECK: %[[LOAD:.*]] = load i32, ptr {{.*}}%[[INPTR]]
1414
// DXC: %[[OUTPTR:.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @llvm.dx.resource.getpointer.p0.tdx.TypedBuffer_i32_1_0_1t(target("dx.TypedBuffer", i32, 1, 0, 1) %{{.*}}, i32 %{{.*}})
15-
// SPIRV: %[[OUTPTR:.*]] = call noundef align 4 dereferenceable(4) ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.Image_i32_5_2_0_0_2_0t(target("spirv.Image", i32, 5, 2, 0, 0, 2, 0) %{{.*}}, i32 %{{.*}})
15+
// SPIRV: %[[OUTPTR:.*]] = call noundef align 4 dereferenceable(4) ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.SignedImage_i32_5_2_0_0_2_0t(target("spirv.SignedImage", i32, 5, 2, 0, 0, 2, 0) %{{.*}}, i32 %{{.*}})
1616
// CHECK: store i32 %[[LOAD]], ptr {{.*}}%[[OUTPTR]]
1717
Out[GI] = In[GI];
1818

1919
// DXC: %[[INPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.TypedBuffer_i32_1_0_1t(target("dx.TypedBuffer", i32, 1, 0, 1) %{{.*}}, i32 %{{.*}})
20-
// SPIRV: %[[INPTR:.*]] = call ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.Image_i32_5_2_0_0_2_0t(target("spirv.Image", i32, 5, 2, 0, 0, 2, 0) %{{.*}}, i32 %{{.*}})
20+
// SPIRV: %[[INPTR:.*]] = call ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.SignedImage_i32_5_2_0_0_2_0t(target("spirv.SignedImage", i32, 5, 2, 0, 0, 2, 0) %{{.*}}, i32 %{{.*}})
2121
// CHECK: %[[LOAD:.*]] = load i32, ptr {{.*}}%[[INPTR]]
2222
// DXC: %[[OUTPTR:.*]] = call noundef nonnull align 4 dereferenceable(4) ptr @llvm.dx.resource.getpointer.p0.tdx.TypedBuffer_i32_1_0_1t(target("dx.TypedBuffer", i32, 1, 0, 1) %{{.*}}, i32 %{{.*}})
23-
// SPIRV: %[[OUTPTR:.*]] = call noundef align 4 dereferenceable(4) ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.Image_i32_5_2_0_0_2_0t(target("spirv.Image", i32, 5, 2, 0, 0, 2, 0) %{{.*}}, i32 %{{.*}})
23+
// SPIRV: %[[OUTPTR:.*]] = call noundef align 4 dereferenceable(4) ptr addrspace(11) @llvm.spv.resource.getpointer.p11.tspirv.SignedImage_i32_5_2_0_0_2_0t(target("spirv.SignedImage", i32, 5, 2, 0, 0, 2, 0) %{{.*}}, i32 %{{.*}})
2424
// CHECK: store i32 %[[LOAD]], ptr {{.*}}%[[OUTPTR]]
2525
Out[GI] = In.Load(GI);
2626
}

llvm/docs/SPIRVUsage.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ using target extension types and are represented as follows:
255255
SPIR-V Type LLVM type name LLVM type arguments
256256
================== ======================= ===========================================================================================
257257
OpTypeImage ``spirv.Image`` sampled type, dimensionality, depth, arrayed, MS, sampled, image format, [access qualifier]
258+
OpTypeImage ``spirv.SignedImage`` sampled type, dimensionality, depth, arrayed, MS, sampled, image format, [access qualifier]
258259
OpTypeSampler ``spirv.Sampler`` (none)
259260
OpTypeSampledImage ``spirv.SampledImage`` sampled type, dimensionality, depth, arrayed, MS, sampled, image format, [access qualifier]
260261
OpTypeEvent ``spirv.Event`` (none)
@@ -275,6 +276,12 @@ parameters of its underlying image type, so that a sampled image for the
275276
previous type has the representation
276277
``target("spirv.SampledImage, void, 1, 1, 0, 0, 0, 0, 0)``.
277278

279+
The differences between ``spirv.Image`` and ``spirv.SignedImage`` is that the
280+
backend will generate code assuming that the format of the image is a signed
281+
integer instead of unsigned. This is required because llvm-ir will create the
282+
same sampled type for signed and unsigned integers. If the image format is
283+
unknown, the backend cannot distinguish the two case.
284+
278285
See `wg-hlsl proposal 0018 <https://github.com/llvm/wg-hlsl/blob/main/proposals/0018-spirv-resource-representation.md>`_
279286
for details on ``spirv.VulkanBuffer``.
280287

llvm/lib/IR/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ struct TargetTypeInfo {
984984
static TargetTypeInfo getTargetTypeInfo(const TargetExtType *Ty) {
985985
LLVMContext &C = Ty->getContext();
986986
StringRef Name = Ty->getName();
987-
if (Name == "spirv.Image")
987+
if (Name == "spirv.Image" || Name == "spirv.SignedImage")
988988
return TargetTypeInfo(PointerType::get(C, 0), TargetExtType::CanBeGlobal,
989989
TargetExtType::CanBeLocal);
990990
if (Name == "spirv.Type") {

llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,43 +3086,11 @@ static SPIRVType *getCoopMatrType(const TargetExtType *ExtensionType,
30863086
ExtensionType->getIntParameter(3), true);
30873087
}
30883088

3089-
static SPIRVType *
3090-
getImageType(const TargetExtType *ExtensionType,
3091-
const SPIRV::AccessQualifier::AccessQualifier Qualifier,
3092-
MachineIRBuilder &MIRBuilder, SPIRVGlobalRegistry *GR) {
3093-
assert(ExtensionType->getNumTypeParameters() == 1 &&
3094-
"SPIR-V image builtin type must have sampled type parameter!");
3095-
const SPIRVType *SampledType =
3096-
GR->getOrCreateSPIRVType(ExtensionType->getTypeParameter(0), MIRBuilder,
3097-
SPIRV::AccessQualifier::ReadWrite, true);
3098-
assert((ExtensionType->getNumIntParameters() == 7 ||
3099-
ExtensionType->getNumIntParameters() == 6) &&
3100-
"Invalid number of parameters for SPIR-V image builtin!");
3101-
3102-
SPIRV::AccessQualifier::AccessQualifier accessQualifier =
3103-
SPIRV::AccessQualifier::None;
3104-
if (ExtensionType->getNumIntParameters() == 7) {
3105-
accessQualifier = Qualifier == SPIRV::AccessQualifier::WriteOnly
3106-
? SPIRV::AccessQualifier::WriteOnly
3107-
: SPIRV::AccessQualifier::AccessQualifier(
3108-
ExtensionType->getIntParameter(6));
3109-
}
3110-
3111-
// Create or get an existing type from GlobalRegistry.
3112-
return GR->getOrCreateOpTypeImage(
3113-
MIRBuilder, SampledType,
3114-
SPIRV::Dim::Dim(ExtensionType->getIntParameter(0)),
3115-
ExtensionType->getIntParameter(1), ExtensionType->getIntParameter(2),
3116-
ExtensionType->getIntParameter(3), ExtensionType->getIntParameter(4),
3117-
SPIRV::ImageFormat::ImageFormat(ExtensionType->getIntParameter(5)),
3118-
accessQualifier);
3119-
}
3120-
31213089
static SPIRVType *getSampledImageType(const TargetExtType *OpaqueType,
31223090
MachineIRBuilder &MIRBuilder,
31233091
SPIRVGlobalRegistry *GR) {
3124-
SPIRVType *OpaqueImageType = getImageType(
3125-
OpaqueType, SPIRV::AccessQualifier::ReadOnly, MIRBuilder, GR);
3092+
SPIRVType *OpaqueImageType = GR->getImageType(
3093+
OpaqueType, SPIRV::AccessQualifier::ReadOnly, MIRBuilder);
31263094
// Create or get an existing type from GlobalRegistry.
31273095
return GR->getOrCreateOpTypeSampledImage(OpaqueImageType, MIRBuilder);
31283096
}
@@ -3293,7 +3261,7 @@ SPIRVType *lowerBuiltinType(const Type *OpaqueType,
32933261

32943262
switch (TypeRecord->Opcode) {
32953263
case SPIRV::OpTypeImage:
3296-
TargetType = getImageType(BuiltinType, AccessQual, MIRBuilder, GR);
3264+
TargetType = GR->getImageType(BuiltinType, AccessQual, MIRBuilder);
32973265
break;
32983266
case SPIRV::OpTypePipe:
32993267
TargetType = getPipeType(BuiltinType, MIRBuilder, GR);

llvm/lib/Target/SPIRV/SPIRVBuiltins.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,7 @@ def : BuiltinType<"spirv.Event", OpTypeEvent>;
16321632
def : BuiltinType<"spirv.Sampler", OpTypeSampler>;
16331633
def : BuiltinType<"spirv.DeviceEvent", OpTypeDeviceEvent>;
16341634
def : BuiltinType<"spirv.Image", OpTypeImage>;
1635+
def : BuiltinType<"spirv.SignedImage", OpTypeImage>;
16351636
def : BuiltinType<"spirv.SampledImage", OpTypeSampledImage>;
16361637
def : BuiltinType<"spirv.Pipe", OpTypePipe>;
16371638
def : BuiltinType<"spirv.CooperativeMatrixKHR", OpTypeCooperativeMatrixKHR>;

llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,8 @@ Type *SPIRVEmitIntrinsics::deduceElementTypeHelper(
663663
auto *II = dyn_cast<IntrinsicInst>(I);
664664
if (II && II->getIntrinsicID() == Intrinsic::spv_resource_getpointer) {
665665
auto *HandleType = cast<TargetExtType>(II->getOperand(0)->getType());
666-
if (HandleType->getTargetExtName() == "spirv.Image") {
666+
if (HandleType->getTargetExtName() == "spirv.Image" ||
667+
HandleType->getTargetExtName() == "spirv.SignedImage") {
667668
if (II->hasOneUse()) {
668669
auto *U = *II->users().begin();
669670
Ty = cast<Instruction>(U)->getAccessType();

llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,40 @@ SPIRVType *SPIRVGlobalRegistry::getOrCreateLayoutType(
14061406
return SPIRVStructType;
14071407
}
14081408

1409+
SPIRVType *SPIRVGlobalRegistry::getImageType(
1410+
const TargetExtType *ExtensionType,
1411+
const SPIRV::AccessQualifier::AccessQualifier Qualifier,
1412+
MachineIRBuilder &MIRBuilder) {
1413+
assert(ExtensionType->getNumTypeParameters() == 1 &&
1414+
"SPIR-V image builtin type must have sampled type parameter!");
1415+
const SPIRVType *SampledType =
1416+
getOrCreateSPIRVType(ExtensionType->getTypeParameter(0), MIRBuilder,
1417+
SPIRV::AccessQualifier::ReadWrite, true);
1418+
assert((ExtensionType->getNumIntParameters() == 7 ||
1419+
ExtensionType->getNumIntParameters() == 6) &&
1420+
"Invalid number of parameters for SPIR-V image builtin!");
1421+
1422+
SPIRV::AccessQualifier::AccessQualifier accessQualifier =
1423+
SPIRV::AccessQualifier::None;
1424+
if (ExtensionType->getNumIntParameters() == 7) {
1425+
accessQualifier = Qualifier == SPIRV::AccessQualifier::WriteOnly
1426+
? SPIRV::AccessQualifier::WriteOnly
1427+
: SPIRV::AccessQualifier::AccessQualifier(
1428+
ExtensionType->getIntParameter(6));
1429+
}
1430+
1431+
// Create or get an existing type from GlobalRegistry.
1432+
SPIRVType *R = getOrCreateOpTypeImage(
1433+
MIRBuilder, SampledType,
1434+
SPIRV::Dim::Dim(ExtensionType->getIntParameter(0)),
1435+
ExtensionType->getIntParameter(1), ExtensionType->getIntParameter(2),
1436+
ExtensionType->getIntParameter(3), ExtensionType->getIntParameter(4),
1437+
SPIRV::ImageFormat::ImageFormat(ExtensionType->getIntParameter(5)),
1438+
accessQualifier);
1439+
SPIRVToLLVMType[R] = ExtensionType;
1440+
return R;
1441+
}
1442+
14091443
SPIRVType *SPIRVGlobalRegistry::getOrCreateOpTypeImage(
14101444
MachineIRBuilder &MIRBuilder, SPIRVType *SampledType, SPIRV::Dim::Dim Dim,
14111445
uint32_t Depth, uint32_t Arrayed, uint32_t Multisampled, uint32_t Sampled,

llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,13 @@ class SPIRVGlobalRegistry : public SPIRVIRMapping {
501501
MachineIRBuilder &MIRBuilder);
502502
bool hasBlockDecoration(SPIRVType *Type) const;
503503

504+
SPIRVType *
505+
getOrCreateOpTypeImage(MachineIRBuilder &MIRBuilder, SPIRVType *SampledType,
506+
SPIRV::Dim::Dim Dim, uint32_t Depth, uint32_t Arrayed,
507+
uint32_t Multisampled, uint32_t Sampled,
508+
SPIRV::ImageFormat::ImageFormat ImageFormat,
509+
SPIRV::AccessQualifier::AccessQualifier AccQual);
510+
504511
public:
505512
Register buildConstantInt(uint64_t Val, MachineIRBuilder &MIRBuilder,
506513
SPIRVType *SpvType, bool EmitIR,
@@ -607,11 +614,9 @@ class SPIRVGlobalRegistry : public SPIRVIRMapping {
607614
const TargetExtType *T, bool EmitIr = false);
608615

609616
SPIRVType *
610-
getOrCreateOpTypeImage(MachineIRBuilder &MIRBuilder, SPIRVType *SampledType,
611-
SPIRV::Dim::Dim Dim, uint32_t Depth, uint32_t Arrayed,
612-
uint32_t Multisampled, uint32_t Sampled,
613-
SPIRV::ImageFormat::ImageFormat ImageFormat,
614-
SPIRV::AccessQualifier::AccessQualifier AccQual);
617+
getImageType(const TargetExtType *ExtensionType,
618+
const SPIRV::AccessQualifier::AccessQualifier Qualifier,
619+
MachineIRBuilder &MIRBuilder);
615620

616621
SPIRVType *getOrCreateOpTypeSampler(MachineIRBuilder &MIRBuilder);
617622

0 commit comments

Comments
 (0)