Devtools - Shader editing (#1705)

* devtools: shader editing and compiling

* devtools: patch shader at runtime

* devtools: shader editing load patch even with config disabled
This commit is contained in:
Vinicius Rangel 2024-12-09 17:11:11 -03:00 committed by GitHub
parent f623613d12
commit f1b23c616e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 466 additions and 103 deletions

View file

@ -177,9 +177,10 @@ void DebugStateImpl::PushRegsDump(uintptr_t base_addr, uintptr_t header_addr,
}
}
void DebugStateImpl::CollectShader(const std::string& name, std::span<const u32> spv,
std::span<const u32> raw_code) {
shader_dump_list.emplace_back(name, std::vector<u32>{spv.begin(), spv.end()},
std::vector<u32>{raw_code.begin(), raw_code.end()});
std::ranges::sort(shader_dump_list, {}, &ShaderDump::name);
void DebugStateImpl::CollectShader(const std::string& name, vk::ShaderModule module,
std::span<const u32> spv, std::span<const u32> raw_code,
std::span<const u32> patch_spv, bool is_patched) {
shader_dump_list.emplace_back(name, module, std::vector<u32>{spv.begin(), spv.end()},
std::vector<u32>{raw_code.begin(), raw_code.end()},
std::vector<u32>{patch_spv.begin(), patch_spv.end()}, is_patched);
}