mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[spirv] Add hasCapability method
This commit is contained in:
parent
3a993d0c5c
commit
c1073455bf
@ -38,17 +38,24 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SpirvModule::hasCapability(
|
||||||
|
spv::Capability capability) {
|
||||||
|
for (auto ins : m_capabilities) {
|
||||||
|
if (ins.opCode() == spv::OpCapability && ins.arg(1) == capability)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void SpirvModule::enableCapability(
|
void SpirvModule::enableCapability(
|
||||||
spv::Capability capability) {
|
spv::Capability capability) {
|
||||||
// Scan the generated instructions to check
|
// Scan the generated instructions to check
|
||||||
// whether we already enabled the capability.
|
// whether we already enabled the capability.
|
||||||
for (auto ins : m_capabilities) {
|
if (!hasCapability(capability)) {
|
||||||
if (ins.opCode() == spv::OpCapability && ins.arg(1) == capability)
|
m_capabilities.putIns (spv::OpCapability, 2);
|
||||||
return;
|
m_capabilities.putWord(capability);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_capabilities.putIns (spv::OpCapability, 2);
|
|
||||||
m_capabilities.putWord(capability);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,6 +65,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
uint32_t allocateId();
|
uint32_t allocateId();
|
||||||
|
|
||||||
|
bool hasCapability(
|
||||||
|
spv::Capability capability);
|
||||||
|
|
||||||
void enableCapability(
|
void enableCapability(
|
||||||
spv::Capability capability);
|
spv::Capability capability);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user