vk_pipeline_cache: Fix invalid iterator
This commit is contained in:
parent
97770e258d
commit
d36292873b
|
@ -92,8 +92,7 @@ struct BufferResource {
|
|||
|
||||
u64 GetKey(const Info& info) const {
|
||||
const auto sharp = GetVsharp(info);
|
||||
const u32 stride = sharp.GetStride();
|
||||
u64 key = stride | (sharp.data_format << 14) | (sharp.num_format << 18);
|
||||
u64 key = sharp.GetStride();
|
||||
if (!is_written) {
|
||||
key <<= 1;
|
||||
key |= IsStorage(sharp);
|
||||
|
|
|
@ -73,6 +73,7 @@ private:
|
|||
|
||||
Program* program = it_pgm->second;
|
||||
const auto& info = program->info;
|
||||
vk::ShaderModule module{};
|
||||
|
||||
// Compile specialized module with current runtime state.
|
||||
const auto it = std::ranges::find(program->modules, stage_key, &Program::Module::first);
|
||||
|
@ -80,14 +81,15 @@ private:
|
|||
auto new_info = MakeShaderInfo(stage, pgm->user_data, info.pgm_base, info.pgm_hash,
|
||||
liverpool->regs);
|
||||
const size_t perm_idx = program->modules.size();
|
||||
const auto module = CompileModule(new_info, pgm->Code(), perm_idx, binding);
|
||||
module = CompileModule(new_info, pgm->Code(), perm_idx, binding);
|
||||
program->modules.emplace_back(stage_key, module);
|
||||
} else {
|
||||
binding += info.NumBindings();
|
||||
module = it->second;
|
||||
}
|
||||
|
||||
const u64 full_hash = HashCombine(hash, stage_key);
|
||||
return std::make_tuple(&info, it->second, full_hash);
|
||||
return std::make_tuple(&info, module, full_hash);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue