return;
Id type_id = allocate_id(image, 0);
+ SpirVFormat format = get_format(image.format);
Id image_id = (image.sampled ? next_id++ : type_id);
writer.begin_op(content.globals, OP_TYPE_IMAGE, 9);
writer.write(image.array);
writer.write(image.multisample);
writer.write(image.sampled ? 1 : 2);
- writer.write(get_format(image.format));
+ writer.write(format);
writer.end_op(OP_TYPE_IMAGE);
if(image.sampled)
if(image.multisample && !image.sampled)
use_capability(CAP_STORAGE_IMAGE_MULTISAMPLE);
+
+ if(format>=FORMAT_RG32F && format<=FORMAT_R8_SNORM)
+ use_capability(CAP_STORAGE_IMAGE_EXTENDED_FORMATS);
}
void SpirVGenerator::visit(StructDeclaration &strct)
CAP_SAMPLED_1D = 43,
CAP_IMAGE_1D = 44,
CAP_SAMPLED_CUBE_ARRAY = 45,
+ CAP_STORAGE_IMAGE_EXTENDED_FORMATS = 49,
CAP_IMAGE_QUERY = 50,
CAP_DERIVATIVE_CONTROL = 51,
CAP_INTERPOLATION_FUNCTION = 52