File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,17 @@ bool LowerTypeVisitor::visitInstruction(SpirvInstruction *instr) {
214214 arrayType->getStride ());
215215 instr->setResultType (resultType);
216216 }
217+ } else if (const auto *runtimeArrayType =
218+ dyn_cast<RuntimeArrayType>(resultType)) {
219+ if (const auto *imageType =
220+ dyn_cast<ImageType>(runtimeArrayType->getElementType ())) {
221+ auto newImgType = spvContext.getImageType (
222+ imageType,
223+ vkImgFeatures.format .value_or (spv::ImageFormat::Unknown));
224+ resultType = spvContext.getRuntimeArrayType (
225+ newImgType, runtimeArrayType->getStride ());
226+ instr->setResultType (resultType);
227+ }
217228 }
218229 }
219230 }
Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ RWBuffer<int64_t> Buf_r64i;
6060[[vk::image_format ("r64ui" )]]
6161RWBuffer <uint64_t> Buf_r64ui;
6262
63+ [[vk::image_format ("r16f" )]]
64+ // CHECK: [[ImgType:%[0-9a-zA-Z_]+]] = OpTypeImage %float 2D 2 0 0 2 R16f
65+ // CHECK: [[ArrayType:%[0-9a-zA-Z_]+]] = OpTypeRuntimeArray [[ImgType]]
66+ // CHECK: [[PtrType:%[0-9a-zA-Z_]+]] = OpTypePointer UniformConstant [[ArrayType]]
67+ RWTexture2D <float > Buf_r16f_bindless[];
68+
6369struct S {
6470 RWBuffer <float4 > b;
6571};
You can’t perform that action at this time.
0 commit comments