devtools: add search to shader list

This commit is contained in:
Vinicius Rangel 2024-12-26 03:24:55 -03:00
parent f299ba3b57
commit 0e2a175633
No known key found for this signature in database
GPG Key ID: A5B154D904B761D9
2 changed files with 8 additions and 0 deletions

View File

@ -229,9 +229,15 @@ void ShaderList::Draw() {
return;
}
InputTextEx("##search_shader", "Search by name", search_box, sizeof(search_box), {},
ImGuiInputTextFlags_None, nullptr, nullptr);
auto width = GetContentRegionAvail().x;
int i = 0;
for (const auto& shader : DebugState.shader_dump_list) {
if (search_box[0] != '\0' && !shader.name.contains(search_box)) {
continue;
}
char name[128];
if (shader.is_patched) {
snprintf(name, sizeof(name), "%s (PATCH ON)", shader.name.c_str());

View File

@ -31,6 +31,8 @@ class ShaderList {
std::vector<Selection> open_shaders{};
char search_box[128]{};
public:
bool open = false;