The type of the components that result from sampling or reading from the given SPIR-V image or sampled image type.
fn ImageSampledType(Image: type) type
fn ImageSampledType(Image: type) type {
const image_info = switch (@typeInfo(Image)) {
.spirv => |spirv| switch (spirv) {
.sampled_image => |sampled_image| @typeInfo(sampled_image).spirv.image,
.image => |image| image,
else => @compileError("Expected SPIR-V image or sampled image type, found '" ++ @typeName(Image) ++ "'"),
},
else => @compileError("Expected SPIR-V image or sampled image type, found '" ++ @typeName(Image) ++ "'"),
};
return switch (image_info.usage) {
inline else => |usage| usage,
};
}