1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-07 16:54:14 +01:00

[dxvk] Don't remove private inpurs from interface list in SPIR-V 1.4+

And if we have to, exit after one iteration since otherwise our iterator
gets invalidated.
This commit is contained in:
Philip Rebohle 2022-07-17 03:53:40 +02:00
parent ff39819086
commit d898eff3be
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 21 additions and 11 deletions

View File

@ -171,6 +171,8 @@ namespace dxvk {
spv::StorageClass storageClass = spv::StorageClassMax; spv::StorageClass storageClass = spv::StorageClassMax;
}; };
uint32_t spirvVersion = code.data()[1];
std::unordered_map<uint32_t, SpirvTypeInfo> types; std::unordered_map<uint32_t, SpirvTypeInfo> types;
std::unordered_map<uint32_t, uint32_t> constants; std::unordered_map<uint32_t, uint32_t> constants;
std::unordered_set<uint32_t> candidates; std::unordered_set<uint32_t> candidates;
@ -214,6 +216,9 @@ namespace dxvk {
break; break;
} }
} }
if (ins.opCode() == spv::OpFunction)
break;
} }
if (!inputVarId) if (!inputVarId)
@ -292,6 +297,7 @@ namespace dxvk {
code.endInsertion(); code.endInsertion();
// Remove variable from interface list // Remove variable from interface list
if (spirvVersion < spvVersion(1, 4)) {
for (auto ins : code) { for (auto ins : code) {
if (ins.opCode() == spv::OpEntryPoint) { if (ins.opCode() == spv::OpEntryPoint) {
uint32_t argIdx = 2 + code.strLen(ins.chr(2)); uint32_t argIdx = 2 + code.strLen(ins.chr(2));
@ -308,6 +314,9 @@ namespace dxvk {
argIdx += 1; argIdx += 1;
} }
break;
}
} }
} }

View File

@ -9,6 +9,7 @@
#include "../spirv/spirv_code_buffer.h" #include "../spirv/spirv_code_buffer.h"
#include "../spirv/spirv_compression.h" #include "../spirv/spirv_compression.h"
#include "../spirv/spirv_module.h"
namespace dxvk { namespace dxvk {