MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / ValidVersion

Function ValidVersion

glslang/MachineIndependent/Initialize.cpp:475–490  ·  view source on GitHub ↗

See if the tabled versioning information allows the current version.

Source from the content-addressed store, hash-verified

473
474// See if the tabled versioning information allows the current version.
475bool 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

Callers 1

addTabledBuiltinsMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected