See if the tabled versioning information allows the current version.
| 473 | |
| 474 | // See if the tabled versioning information allows the current version. |
| 475 | bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile, const SpvVersion& /* spVersion */) |
| 476 | { |
| 477 | // nullptr means always valid |
| 478 | if (function.versioning.empty()) |
| 479 | return true; |
| 480 | |
| 481 | // check for what is said about our current profile |
| 482 | for (const auto& v : function.versioning) { |
| 483 | if ((v.profiles & profile) != 0) { |
| 484 | if (v.minCoreVersion <= version || (v.numExtensions > 0 && v.minExtendedVersion <= version)) |
| 485 | return true; |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | return false; |
| 490 | } |
| 491 | |
| 492 | // Relate a single table of built-ins to their AST operator. |
| 493 | // This can get called redundantly (especially for the common built-ins, when |
no test coverage detected