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) {
214
214
arrayType->getStride ());
215
215
instr->setResultType (resultType);
216
216
}
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
+ }
217
228
}
218
229
}
219
230
}
Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ RWBuffer<int64_t> Buf_r64i;
60
60
[[vk::image_format ("r64ui" )]]
61
61
RWBuffer <uint64_t> Buf_r64ui;
62
62
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
+
63
69
struct S {
64
70
RWBuffer <float4 > b;
65
71
};
You can’t perform that action at this time.
0 commit comments