| 119 | return SPV_SUCCESS; |
| 120 | } |
| 121 | spv_result_t ValidateReportIntersection(ValidationState_t& _, |
| 122 | const Instruction* inst) { |
| 123 | _.function(inst->function()->id()) |
| 124 | ->RegisterExecutionModelLimitation( |
| 125 | [](spv::ExecutionModel model, std::string* message) { |
| 126 | if (model != spv::ExecutionModel::IntersectionKHR) { |
| 127 | if (message) { |
| 128 | *message = |
| 129 | "OpReportIntersectionKHR requires IntersectionKHR " |
| 130 | "execution model"; |
| 131 | } |
| 132 | return false; |
| 133 | } |
| 134 | return true; |
| 135 | }); |
| 136 | |
| 137 | const uint32_t result_type = inst->type_id(); |
| 138 | if (!_.IsBoolScalarType(result_type)) { |
| 139 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 140 | << "expected Result Type to be bool scalar type"; |
| 141 | } |
| 142 | |
| 143 | const uint32_t hit = _.GetOperandTypeId(inst, 2); |
| 144 | if (!_.IsFloatScalarType(hit, 32)) { |
| 145 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 146 | << "Hit must be a 32-bit int scalar"; |
| 147 | } |
| 148 | |
| 149 | const uint32_t hit_kind = _.GetOperandTypeId(inst, 3); |
| 150 | if (!_.IsUnsignedIntScalarType(hit_kind) || _.GetBitWidth(hit_kind) != 32) { |
| 151 | return _.diag(SPV_ERROR_INVALID_DATA, inst) |
| 152 | << "Hit Kind must be a 32-bit unsigned int scalar"; |
| 153 | } |
| 154 | return SPV_SUCCESS; |
| 155 | } |
| 156 | |
| 157 | spv_result_t ValidateExecuteCallable(ValidationState_t& _, |
| 158 | const Instruction* inst) { |
no test coverage detected