Lines Matching refs:inst
90 const Instruction* inst = _.FindDef(id); in GetImageTypeInfo() local
91 assert(inst); in GetImageTypeInfo()
93 if (inst->opcode() == SpvOpTypeSampledImage) { in GetImageTypeInfo()
94 inst = _.FindDef(inst->word(2)); in GetImageTypeInfo()
95 assert(inst); in GetImageTypeInfo()
98 if (inst->opcode() != SpvOpTypeImage) return false; in GetImageTypeInfo()
100 const size_t num_words = inst->words().size(); in GetImageTypeInfo()
103 info->sampled_type = inst->word(2); in GetImageTypeInfo()
104 info->dim = static_cast<SpvDim>(inst->word(3)); in GetImageTypeInfo()
105 info->depth = inst->word(4); in GetImageTypeInfo()
106 info->arrayed = inst->word(5); in GetImageTypeInfo()
107 info->multisampled = inst->word(6); in GetImageTypeInfo()
108 info->sampled = inst->word(7); in GetImageTypeInfo()
109 info->format = static_cast<SpvImageFormat>(inst->word(8)); in GetImageTypeInfo()
112 : static_cast<SpvAccessQualifier>(inst->word(9)); in GetImageTypeInfo()
212 const Instruction* inst, in ValidateImageOperands() argument
218 const SpvOp opcode = inst->opcode(); in ValidateImageOperands()
219 const size_t num_words = inst->words().size(); in ValidateImageOperands()
233 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
240 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
252 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
256 const uint32_t type_id = _.GetTypeId(inst->word(word_index++)); in ValidateImageOperands()
258 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
264 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
270 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
278 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
284 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
289 const uint32_t type_id = _.GetTypeId(inst->word(word_index++)); in ValidateImageOperands()
292 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
298 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
306 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
312 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
319 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
323 const uint32_t dx_type_id = _.GetTypeId(inst->word(word_index++)); in ValidateImageOperands()
324 const uint32_t dy_type_id = _.GetTypeId(inst->word(word_index++)); in ValidateImageOperands()
327 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
336 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
342 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
348 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
355 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
360 const uint32_t id = inst->word(word_index++); in ValidateImageOperands()
363 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
369 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
376 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
384 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
388 const uint32_t id = inst->word(word_index++); in ValidateImageOperands()
391 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
399 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
409 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
415 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
420 const uint32_t id = inst->word(word_index++); in ValidateImageOperands()
426 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
436 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
443 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
449 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
458 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
465 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
469 const uint32_t type_id = _.GetTypeId(inst->word(word_index++)); in ValidateImageOperands()
471 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
478 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
483 const uint32_t type_id = _.GetTypeId(inst->word(word_index++)); in ValidateImageOperands()
485 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
491 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
497 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
505 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
512 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
518 const auto available_scope = inst->word(word_index++); in ValidateImageOperands()
519 if (auto error = ValidateMemoryScope(_, inst, available_scope)) in ValidateImageOperands()
526 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
534 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageOperands()
540 const auto visible_scope = inst->word(word_index++); in ValidateImageOperands()
541 if (auto error = ValidateMemoryScope(_, inst, visible_scope)) return error; in ValidateImageOperands()
548 spv_result_t ValidateImageCommon(ValidationState_t& _, const Instruction* inst, in ValidateImageCommon() argument
550 const SpvOp opcode = inst->opcode(); in ValidateImageCommon()
554 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageCommon()
559 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageCommon()
564 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageCommon()
574 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageCommon()
578 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageCommon()
582 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageCommon()
586 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageCommon()
597 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageCommon()
603 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageCommon()
639 spv_result_t GetActualResultType(ValidationState_t& _, const Instruction* inst, in GetActualResultType() argument
641 const SpvOp opcode = inst->opcode(); in GetActualResultType()
644 const Instruction* const type_inst = _.FindDef(inst->type_id()); in GetActualResultType()
648 return _.diag(SPV_ERROR_INVALID_DATA, inst) in GetActualResultType()
654 return _.diag(SPV_ERROR_INVALID_DATA, inst) in GetActualResultType()
661 *actual_result_type = inst->type_id(); in GetActualResultType()
674 spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) { in ValidateTypeImage() argument
675 assert(inst->type_id() == 0); in ValidateTypeImage()
678 if (!GetImageTypeInfo(_, inst->word(1), &info)) { in ValidateTypeImage()
679 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeImage()
687 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeImage()
696 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeImage()
705 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeImage()
710 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeImage()
715 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeImage()
720 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeImage()
726 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeImage()
731 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeImage()
742 const Instruction* inst) { in ValidateTypeSampledImage() argument
743 const uint32_t image_type = inst->word(2); in ValidateTypeSampledImage()
745 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateTypeSampledImage()
752 const Instruction* inst) { in ValidateSampledImage() argument
753 if (_.GetIdOpcode(inst->type_id()) != SpvOpTypeSampledImage) { in ValidateSampledImage()
754 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateSampledImage()
758 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateSampledImage()
760 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateSampledImage()
766 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateSampledImage()
775 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateSampledImage()
781 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateSampledImage()
787 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateSampledImage()
791 if (_.GetIdOpcode(_.GetOperandTypeId(inst, 3)) != SpvOpTypeSampler) { in ValidateSampledImage()
792 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateSampledImage()
803 std::vector<uint32_t> consumers = _.getSampledImageConsumers(inst->id()); in ValidateSampledImage()
808 if (consumer_instr->block() != inst->block()) { in ValidateSampledImage()
809 return _.diag(SPV_ERROR_INVALID_ID, inst) in ValidateSampledImage()
814 << _.getIdName(inst->id()) in ValidateSampledImage()
825 return _.diag(SPV_ERROR_INVALID_ID, inst) in ValidateSampledImage()
830 << " Found result <id> '" << _.getIdName(inst->id()) in ValidateSampledImage()
840 const Instruction* inst) { in ValidateImageTexelPointer() argument
841 const auto result_type = _.FindDef(inst->type_id()); in ValidateImageTexelPointer()
843 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
849 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
858 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
863 const auto image_ptr = _.FindDef(_.GetOperandTypeId(inst, 2)); in ValidateImageTexelPointer()
865 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
871 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
877 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
882 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
888 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
892 const uint32_t coord_type = _.GetOperandTypeId(inst, 3); in ValidateImageTexelPointer()
894 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
911 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
920 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
925 const uint32_t sample_type = _.GetOperandTypeId(inst, 4); in ValidateImageTexelPointer()
927 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
933 if (!_.GetConstantValUint64(inst->GetOperandAs<uint32_t>(4), &ms) || in ValidateImageTexelPointer()
935 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageTexelPointer()
943 spv_result_t ValidateImageLod(ValidationState_t& _, const Instruction* inst) { in ValidateImageLod() argument
944 const SpvOp opcode = inst->opcode(); in ValidateImageLod()
946 if (spv_result_t error = GetActualResultType(_, inst, &actual_result_type)) { in ValidateImageLod()
952 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageLod()
958 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageLod()
963 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateImageLod()
965 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageLod()
971 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageLod()
975 if (spv_result_t result = ValidateImageCommon(_, inst, info)) return result; in ValidateImageLod()
981 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageLod()
987 const uint32_t coord_type = _.GetOperandTypeId(inst, 3); in ValidateImageLod()
993 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageLod()
998 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageLod()
1006 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageLod()
1011 if (inst->words().size() <= 5) { in ValidateImageLod()
1016 const uint32_t mask = inst->word(5); in ValidateImageLod()
1018 ValidateImageOperands(_, inst, info, mask, /* word_index = */ 6)) in ValidateImageLod()
1025 const Instruction* inst) { in ValidateImageDrefLod() argument
1026 const SpvOp opcode = inst->opcode(); in ValidateImageDrefLod()
1028 if (spv_result_t error = GetActualResultType(_, inst, &actual_result_type)) { in ValidateImageDrefLod()
1034 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageDrefLod()
1039 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateImageDrefLod()
1041 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageDrefLod()
1047 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageDrefLod()
1051 if (spv_result_t result = ValidateImageCommon(_, inst, info)) return result; in ValidateImageDrefLod()
1054 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageDrefLod()
1059 const uint32_t coord_type = _.GetOperandTypeId(inst, 3); in ValidateImageDrefLod()
1061 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageDrefLod()
1068 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageDrefLod()
1073 const uint32_t dref_type = _.GetOperandTypeId(inst, 4); in ValidateImageDrefLod()
1075 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageDrefLod()
1079 if (inst->words().size() <= 6) { in ValidateImageDrefLod()
1084 const uint32_t mask = inst->word(6); in ValidateImageDrefLod()
1086 ValidateImageOperands(_, inst, info, mask, /* word_index = */ 7)) in ValidateImageDrefLod()
1092 spv_result_t ValidateImageFetch(ValidationState_t& _, const Instruction* inst) { in ValidateImageFetch() argument
1094 if (spv_result_t error = GetActualResultType(_, inst, &actual_result_type)) { in ValidateImageFetch()
1098 const SpvOp opcode = inst->opcode(); in ValidateImageFetch()
1101 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageFetch()
1107 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageFetch()
1112 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateImageFetch()
1114 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageFetch()
1120 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageFetch()
1128 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageFetch()
1135 return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image 'Dim' cannot be Cube"; in ValidateImageFetch()
1139 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageFetch()
1143 const uint32_t coord_type = _.GetOperandTypeId(inst, 3); in ValidateImageFetch()
1145 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageFetch()
1152 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageFetch()
1157 if (inst->words().size() <= 5) return SPV_SUCCESS; in ValidateImageFetch()
1159 const uint32_t mask = inst->word(5); in ValidateImageFetch()
1161 ValidateImageOperands(_, inst, info, mask, /* word_index = */ 6)) in ValidateImageFetch()
1168 const Instruction* inst) { in ValidateImageGather() argument
1170 if (spv_result_t error = GetActualResultType(_, inst, &actual_result_type)) in ValidateImageGather()
1173 const SpvOp opcode = inst->opcode(); in ValidateImageGather()
1176 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1182 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1187 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateImageGather()
1189 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1195 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1204 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1212 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1216 const uint32_t coord_type = _.GetOperandTypeId(inst, 3); in ValidateImageGather()
1218 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1225 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1231 const uint32_t component_index_type = _.GetOperandTypeId(inst, 4); in ValidateImageGather()
1234 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1240 const uint32_t dref_type = _.GetOperandTypeId(inst, 4); in ValidateImageGather()
1242 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageGather()
1247 if (inst->words().size() <= 6) return SPV_SUCCESS; in ValidateImageGather()
1249 const uint32_t mask = inst->word(6); in ValidateImageGather()
1251 ValidateImageOperands(_, inst, info, mask, /* word_index = */ 7)) in ValidateImageGather()
1257 spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) { in ValidateImageRead() argument
1258 const SpvOp opcode = inst->opcode(); in ValidateImageRead()
1260 if (spv_result_t error = GetActualResultType(_, inst, &actual_result_type)) { in ValidateImageRead()
1266 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageRead()
1274 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageRead()
1280 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateImageRead()
1282 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageRead()
1288 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageRead()
1294 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageRead()
1298 _.function(inst->function()->id()) in ValidateImageRead()
1309 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageRead()
1315 if (spv_result_t result = ValidateImageCommon(_, inst, info)) return result; in ValidateImageRead()
1317 const uint32_t coord_type = _.GetOperandTypeId(inst, 3); in ValidateImageRead()
1319 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageRead()
1326 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageRead()
1333 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageRead()
1338 if (inst->words().size() <= 5) return SPV_SUCCESS; in ValidateImageRead()
1340 const uint32_t mask = inst->word(5); in ValidateImageRead()
1342 ValidateImageOperands(_, inst, info, mask, /* word_index = */ 6)) in ValidateImageRead()
1348 spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) { in ValidateImageWrite() argument
1349 const uint32_t image_type = _.GetOperandTypeId(inst, 0); in ValidateImageWrite()
1351 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageWrite()
1357 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageWrite()
1362 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageWrite()
1366 if (spv_result_t result = ValidateImageCommon(_, inst, info)) return result; in ValidateImageWrite()
1368 const uint32_t coord_type = _.GetOperandTypeId(inst, 1); in ValidateImageWrite()
1370 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageWrite()
1374 const uint32_t min_coord_size = GetMinCoordSize(inst->opcode(), info); in ValidateImageWrite()
1377 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageWrite()
1384 const uint32_t texel_type = _.GetOperandTypeId(inst, 2); in ValidateImageWrite()
1387 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageWrite()
1394 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageWrite()
1402 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageWrite()
1410 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageWrite()
1416 if (inst->words().size() <= 4) return SPV_SUCCESS; in ValidateImageWrite()
1418 const uint32_t mask = inst->word(4); in ValidateImageWrite()
1420 ValidateImageOperands(_, inst, info, mask, /* word_index = */ 5)) in ValidateImageWrite()
1426 spv_result_t ValidateImage(ValidationState_t& _, const Instruction* inst) { in ValidateImage() argument
1427 const uint32_t result_type = inst->type_id(); in ValidateImage()
1429 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImage()
1433 const uint32_t sampled_image_type = _.GetOperandTypeId(inst, 2); in ValidateImage()
1438 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImage()
1443 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImage()
1451 const Instruction* inst) { in ValidateImageQuerySizeLod() argument
1452 const uint32_t result_type = inst->type_id(); in ValidateImageQuerySizeLod()
1454 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySizeLod()
1458 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateImageQuerySizeLod()
1460 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySizeLod()
1466 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySizeLod()
1483 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySizeLod()
1488 return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image 'MS' must be 0"; in ValidateImageQuerySizeLod()
1493 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySizeLod()
1498 const uint32_t lod_type = _.GetOperandTypeId(inst, 3); in ValidateImageQuerySizeLod()
1500 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySizeLod()
1507 const Instruction* inst) { in ValidateImageQuerySize() argument
1508 const uint32_t result_type = inst->type_id(); in ValidateImageQuerySize()
1510 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySize()
1514 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateImageQuerySize()
1516 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySize()
1522 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySize()
1541 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySize()
1548 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySize()
1555 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQuerySize()
1564 const Instruction* inst) { in ValidateImageQueryFormatOrOrder() argument
1565 if (!_.IsIntScalarType(inst->type_id())) { in ValidateImageQueryFormatOrOrder()
1566 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryFormatOrOrder()
1570 if (_.GetIdOpcode(_.GetOperandTypeId(inst, 2)) != SpvOpTypeImage) { in ValidateImageQueryFormatOrOrder()
1571 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryFormatOrOrder()
1578 const Instruction* inst) { in ValidateImageQueryLod() argument
1579 _.function(inst->function()->id()) in ValidateImageQueryLod()
1584 const uint32_t result_type = inst->type_id(); in ValidateImageQueryLod()
1586 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLod()
1591 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLod()
1595 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateImageQueryLod()
1597 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLod()
1603 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLod()
1609 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLod()
1613 const uint32_t coord_type = _.GetOperandTypeId(inst, 3); in ValidateImageQueryLod()
1617 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLod()
1622 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLod()
1630 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLod()
1638 const Instruction* inst) { in ValidateImageSparseLod() argument
1639 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageSparseLod()
1645 const Instruction* inst) { in ValidateImageQueryLevelsOrSamples() argument
1646 if (!_.IsIntScalarType(inst->type_id())) { in ValidateImageQueryLevelsOrSamples()
1647 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLevelsOrSamples()
1651 const uint32_t image_type = _.GetOperandTypeId(inst, 2); in ValidateImageQueryLevelsOrSamples()
1653 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLevelsOrSamples()
1659 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLevelsOrSamples()
1663 const SpvOp opcode = inst->opcode(); in ValidateImageQueryLevelsOrSamples()
1667 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageQueryLevelsOrSamples()
1673 return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image 'Dim' must be 2D"; in ValidateImageQueryLevelsOrSamples()
1677 return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Image 'MS' must be 1"; in ValidateImageQueryLevelsOrSamples()
1684 const Instruction* inst) { in ValidateImageSparseTexelsResident() argument
1685 if (!_.IsBoolScalarType(inst->type_id())) { in ValidateImageSparseTexelsResident()
1686 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageSparseTexelsResident()
1690 const uint32_t resident_code_type = _.GetOperandTypeId(inst, 2); in ValidateImageSparseTexelsResident()
1692 return _.diag(SPV_ERROR_INVALID_DATA, inst) in ValidateImageSparseTexelsResident()
1702 spv_result_t ImagePass(ValidationState_t& _, const Instruction* inst) { in ImagePass() argument
1703 const SpvOp opcode = inst->opcode(); in ImagePass()
1705 _.function(inst->function()->id()) in ImagePass()
1713 return ValidateTypeImage(_, inst); in ImagePass()
1715 return ValidateTypeSampledImage(_, inst); in ImagePass()
1717 return ValidateSampledImage(_, inst); in ImagePass()
1719 return ValidateImageTexelPointer(_, inst); in ImagePass()
1727 return ValidateImageLod(_, inst); in ImagePass()
1735 return ValidateImageDrefLod(_, inst); in ImagePass()
1739 return ValidateImageFetch(_, inst); in ImagePass()
1745 return ValidateImageGather(_, inst); in ImagePass()
1749 return ValidateImageRead(_, inst); in ImagePass()
1752 return ValidateImageWrite(_, inst); in ImagePass()
1755 return ValidateImage(_, inst); in ImagePass()
1759 return ValidateImageQueryFormatOrOrder(_, inst); in ImagePass()
1762 return ValidateImageQuerySizeLod(_, inst); in ImagePass()
1764 return ValidateImageQuerySize(_, inst); in ImagePass()
1766 return ValidateImageQueryLod(_, inst); in ImagePass()
1770 return ValidateImageQueryLevelsOrSamples(_, inst); in ImagePass()
1776 return ValidateImageSparseLod(_, inst); in ImagePass()
1779 return ValidateImageSparseTexelsResident(_, inst); in ImagePass()