| 1162 | } |
| 1163 | |
| 1164 | spv_result_t BuiltInsValidator::ValidateArrayedF32Vec( |
| 1165 | const Decoration& decoration, const Instruction& inst, |
| 1166 | uint32_t num_components, uint32_t array_length, |
| 1167 | const std::function<spv_result_t(const std::string& message)>& diag) { |
| 1168 | uint32_t underlying_type = 0; |
| 1169 | if (spv_result_t error = |
| 1170 | GetUnderlyingType(_, decoration, inst, &underlying_type)) { |
| 1171 | return error; |
| 1172 | } |
| 1173 | |
| 1174 | if (_.GetIdOpcode(underlying_type) != spv::Op::OpTypeArray) { |
| 1175 | return diag(GetDefinitionDesc(decoration, inst) + " is not an array."); |
| 1176 | } |
| 1177 | |
| 1178 | const uint32_t length_id = _.FindDef(underlying_type)->word(3u); |
| 1179 | uint64_t found_length = 0; |
| 1180 | if (!_.EvalConstantValUint64(length_id, &found_length)) { |
| 1181 | return diag(GetDefinitionDesc(decoration, inst) + |
| 1182 | " array has a non constant length."); |
| 1183 | } |
| 1184 | |
| 1185 | if (array_length != found_length) { |
| 1186 | return diag(GetDefinitionDesc(decoration, inst) + " array length must be " + |
| 1187 | std::to_string(array_length)); |
| 1188 | } |
| 1189 | |
| 1190 | underlying_type = _.FindDef(underlying_type)->word(2u); |
| 1191 | |
| 1192 | return ValidateF32VecHelper(decoration, inst, num_components, diag, |
| 1193 | underlying_type); |
| 1194 | } |
| 1195 | |
| 1196 | spv_result_t BuiltInsValidator::ValidateF32Vec( |
| 1197 | const Decoration& decoration, const Instruction& inst, |
nothing calls this directly
no test coverage detected