| 663 | } |
| 664 | |
| 665 | spv_result_t ValidateCopyLogical(ValidationState_t& _, |
| 666 | const Instruction* inst) { |
| 667 | const auto result_type = _.FindDef(inst->type_id()); |
| 668 | const auto source = _.FindDef(inst->GetOperandAs<uint32_t>(2u)); |
| 669 | const auto source_type = _.FindDef(source->type_id()); |
| 670 | if (!source_type || !result_type || source_type == result_type) { |
| 671 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 672 | << "Result Type must not equal the Operand type"; |
| 673 | } |
| 674 | |
| 675 | if (!_.LogicallyMatch(source_type, result_type, false)) { |
| 676 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 677 | << "Result Type does not logically match the Operand type"; |
| 678 | } |
| 679 | |
| 680 | if (_.HasCapability(spv::Capability::Shader) && |
| 681 | _.ContainsLimitedUseIntOrFloatType(inst->type_id())) { |
| 682 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 683 | << "Cannot copy composites of 8- or 16-bit types"; |
| 684 | } |
| 685 | |
| 686 | return SPV_SUCCESS; |
| 687 | } |
| 688 | |
| 689 | spv_result_t ValidateCompositeConstructCoopMatQCOM(ValidationState_t& _, |
| 690 | const Instruction* inst) { |
no test coverage detected