1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxvk] Store enabled SPIR-V capabilities explicitly

This commit is contained in:
Philip Rebohle 2019-04-04 02:46:59 +02:00
parent f32200b668
commit f49863f321
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 9 additions and 9 deletions

View File

@ -119,6 +119,9 @@ namespace dxvk {
if (ins.arg(2) == spv::DecorationIndex && ins.arg(1) == o1VarId)
m_o1IdxOffset = ins.offset() + 3;
}
if (ins.opCode() == spv::OpCapability)
m_capabilities.push_back(spv::Capability(ins.arg(1)));
}
}
@ -129,16 +132,11 @@ namespace dxvk {
bool DxvkShader::hasCapability(spv::Capability cap) {
for (auto ins : m_code) {
// OpCapability instructions come first
if (ins.opCode() != spv::OpCapability)
return false;
auto entry = std::find(
m_capabilities.begin(),
m_capabilities.end(), cap);
if (ins.arg(1) == cap)
return true;
}
return false;
return entry != m_capabilities.end();
}

View File

@ -255,6 +255,8 @@ namespace dxvk {
DxvkShaderConstData m_constData;
DxvkShaderKey m_key;
std::vector<spv::Capability> m_capabilities;
size_t m_o1IdxOffset = 0;
size_t m_o1LocOffset = 0;