mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +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:
parent
ff39819086
commit
d898eff3be
@ -171,6 +171,8 @@ namespace dxvk {
|
||||
spv::StorageClass storageClass = spv::StorageClassMax;
|
||||
};
|
||||
|
||||
uint32_t spirvVersion = code.data()[1];
|
||||
|
||||
std::unordered_map<uint32_t, SpirvTypeInfo> types;
|
||||
std::unordered_map<uint32_t, uint32_t> constants;
|
||||
std::unordered_set<uint32_t> candidates;
|
||||
@ -214,6 +216,9 @@ namespace dxvk {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ins.opCode() == spv::OpFunction)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!inputVarId)
|
||||
@ -292,21 +297,25 @@ namespace dxvk {
|
||||
code.endInsertion();
|
||||
|
||||
// Remove variable from interface list
|
||||
for (auto ins : code) {
|
||||
if (ins.opCode() == spv::OpEntryPoint) {
|
||||
uint32_t argIdx = 2 + code.strLen(ins.chr(2));
|
||||
if (spirvVersion < spvVersion(1, 4)) {
|
||||
for (auto ins : code) {
|
||||
if (ins.opCode() == spv::OpEntryPoint) {
|
||||
uint32_t argIdx = 2 + code.strLen(ins.chr(2));
|
||||
|
||||
while (argIdx < ins.length()) {
|
||||
if (ins.arg(argIdx) == inputVarId) {
|
||||
ins.setArg(0, spv::OpEntryPoint | ((ins.length() - 1) << spv::WordCountShift));
|
||||
while (argIdx < ins.length()) {
|
||||
if (ins.arg(argIdx) == inputVarId) {
|
||||
ins.setArg(0, spv::OpEntryPoint | ((ins.length() - 1) << spv::WordCountShift));
|
||||
|
||||
code.beginInsertion(ins.offset() + argIdx);
|
||||
code.erase(1);
|
||||
code.endInsertion();
|
||||
break;
|
||||
code.beginInsertion(ins.offset() + argIdx);
|
||||
code.erase(1);
|
||||
code.endInsertion();
|
||||
break;
|
||||
}
|
||||
|
||||
argIdx += 1;
|
||||
}
|
||||
|
||||
argIdx += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "../spirv/spirv_code_buffer.h"
|
||||
#include "../spirv/spirv_compression.h"
|
||||
#include "../spirv/spirv_module.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user