MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / ValidateImageQueryFormatOrOrder

Function ValidateImageQueryFormatOrOrder

source/val/validate_image.cpp:2225–2249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2223}
2224
2225spv_result_t ValidateImageQueryFormatOrOrder(ValidationState_t& _,
2226 const Instruction* inst) {
2227 if (!_.IsIntScalarType(inst->type_id())) {
2228 return _.diag(SPV_ERROR_INVALID_DATA, inst)
2229 << "Expected Result Type to be int scalar type";
2230 }
2231
2232 const uint32_t image_type = _.GetOperandTypeId(inst, 2);
2233 if (_.GetIdOpcode(image_type) != spv::Op::OpTypeImage) {
2234 return _.diag(SPV_ERROR_INVALID_DATA, inst)
2235 << "Expected operand to be of type OpTypeImage";
2236 }
2237
2238 ImageTypeInfo info;
2239 if (!GetImageTypeInfo(_, image_type, &info)) {
2240 return _.diag(SPV_ERROR_INVALID_DATA, inst)
2241 << "Corrupt image type definition";
2242 }
2243
2244 if (info.dim == spv::Dim::TileImageDataEXT) {
2245 return _.diag(SPV_ERROR_INVALID_DATA, inst)
2246 << "Image 'Dim' cannot be TileImageDataEXT";
2247 }
2248 return SPV_SUCCESS;
2249}
2250
2251spv_result_t ValidateImageQueryLod(ValidationState_t& _,
2252 const Instruction* inst) {

Callers 1

ImagePassFunction · 0.85

Calls 6

GetImageTypeInfoFunction · 0.85
IsIntScalarTypeMethod · 0.80
diagMethod · 0.80
GetOperandTypeIdMethod · 0.80
GetIdOpcodeMethod · 0.80
type_idMethod · 0.45

Tested by

no test coverage detected