mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Store enabled SPIR-V capabilities explicitly
This commit is contained in:
parent
f32200b668
commit
f49863f321
@ -119,6 +119,9 @@ namespace dxvk {
|
|||||||
if (ins.arg(2) == spv::DecorationIndex && ins.arg(1) == o1VarId)
|
if (ins.arg(2) == spv::DecorationIndex && ins.arg(1) == o1VarId)
|
||||||
m_o1IdxOffset = ins.offset() + 3;
|
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) {
|
bool DxvkShader::hasCapability(spv::Capability cap) {
|
||||||
for (auto ins : m_code) {
|
auto entry = std::find(
|
||||||
// OpCapability instructions come first
|
m_capabilities.begin(),
|
||||||
if (ins.opCode() != spv::OpCapability)
|
m_capabilities.end(), cap);
|
||||||
return false;
|
|
||||||
|
|
||||||
if (ins.arg(1) == cap)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return entry != m_capabilities.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -255,6 +255,8 @@ namespace dxvk {
|
|||||||
DxvkShaderConstData m_constData;
|
DxvkShaderConstData m_constData;
|
||||||
DxvkShaderKey m_key;
|
DxvkShaderKey m_key;
|
||||||
|
|
||||||
|
std::vector<spv::Capability> m_capabilities;
|
||||||
|
|
||||||
size_t m_o1IdxOffset = 0;
|
size_t m_o1IdxOffset = 0;
|
||||||
size_t m_o1LocOffset = 0;
|
size_t m_o1LocOffset = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user