| 385 | } |
| 386 | |
| 387 | bool Function::IsCompatibleWithExecutionModel(spv::ExecutionModel model, |
| 388 | std::string* reason) const { |
| 389 | bool return_value = true; |
| 390 | std::stringstream ss_reason; |
| 391 | |
| 392 | for (const auto& is_compatible : execution_model_limitations_) { |
| 393 | std::string message; |
| 394 | if (!is_compatible(model, &message)) { |
| 395 | if (!reason) return false; |
| 396 | return_value = false; |
| 397 | if (!message.empty()) { |
| 398 | ss_reason << message << "\n"; |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | if (!return_value && reason) { |
| 404 | *reason = ss_reason.str(); |
| 405 | } |
| 406 | |
| 407 | return return_value; |
| 408 | } |
| 409 | |
| 410 | bool Function::CheckLimitations(const ValidationState_t& _, |
| 411 | const Function* entry_point, |
no test coverage detected