mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2025-01-16 19:14:14 +00:00
Turn module_capabilities_ into a spv_capability_mask_t.
This commit is contained in:
parent
549d78f77f
commit
59436bb6b7
@ -289,10 +289,7 @@ class ValidationState_t {
|
||||
|
||||
Functions module_functions_;
|
||||
|
||||
// We are using vector to map the ID of the capability to its availability.
|
||||
// The size of the vector needs to be the maximum ID plus one to cover the
|
||||
// entire range of the capability.
|
||||
std::vector<bool> module_capabilities_;
|
||||
spv_capability_mask_t module_capabilities_; // Module's declared capabilities.
|
||||
|
||||
// Definitions and uses of all the IDs in the module.
|
||||
UseDefTracker usedefs_;
|
||||
|
@ -217,7 +217,7 @@ ValidationState_t::ValidationState_t(spv_diagnostic* diagnostic,
|
||||
operand_names_{},
|
||||
current_layout_section_(kLayoutCapabilities),
|
||||
module_functions_(*this),
|
||||
module_capabilities_(kCapabilitiesMaxValue + 1, false),
|
||||
module_capabilities_(0u),
|
||||
grammar_(context) {}
|
||||
|
||||
spv_result_t ValidationState_t::forwardDeclareId(uint32_t id) {
|
||||
@ -295,7 +295,7 @@ bool ValidationState_t::in_block() const {
|
||||
}
|
||||
|
||||
void ValidationState_t::registerCapability(SpvCapability cap) {
|
||||
module_capabilities_[cap] = true;
|
||||
module_capabilities_ |= SPV_CAPABILITY_AS_MASK(cap);
|
||||
spv_operand_desc desc;
|
||||
if (SPV_SUCCESS ==
|
||||
grammar_.lookupOperand(SPV_OPERAND_TYPE_CAPABILITY, cap, &desc))
|
||||
@ -304,7 +304,7 @@ void ValidationState_t::registerCapability(SpvCapability cap) {
|
||||
}
|
||||
|
||||
bool ValidationState_t::hasCapability(SpvCapability cap) const {
|
||||
return module_capabilities_[cap];
|
||||
return module_capabilities_ & SPV_CAPABILITY_AS_MASK(cap);
|
||||
}
|
||||
|
||||
bool ValidationState_t::HasAnyOf(spv_capability_mask_t capabilities) const {
|
||||
|
Loading…
Reference in New Issue
Block a user