mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add option to make shader search paths non-recursive
* For very large shader symbol stores especially those on network drives, the bad behaviour that PIX has to recursively search all possible subdirectories and enumerate all files can be really slow. Most of the time a file is identified by its hash filename and looked up directly - if that isn't a hit, in many cases users would rather a fast exit to having no symbols.
This commit is contained in:
@@ -618,7 +618,15 @@ void SettingsDialog::on_chooseSearchPaths_clicked()
|
||||
listEditor.setWindowTitle(tr("Shader debug info search paths"));
|
||||
listEditor.setWindowFlags(listEditor.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
OrderedListEditor list(tr("Search Path"), ItemButton::BrowseFolder);
|
||||
OrderedListEditor::CustomProp customProp = {
|
||||
tr("Recursive"),
|
||||
tr("Recursively search through all subdirectories"
|
||||
"under this path to find matching debug files"),
|
||||
true,
|
||||
};
|
||||
|
||||
OrderedListEditor list(tr("Search Path"),
|
||||
OrderedItemExtras::BrowseFolder | OrderedItemExtras::Delete, customProp);
|
||||
|
||||
QVBoxLayout layout;
|
||||
QDialogButtonBox okCancel;
|
||||
@@ -630,21 +638,37 @@ void SettingsDialog::on_chooseSearchPaths_clicked()
|
||||
QObject::connect(&okCancel, &QDialogButtonBox::rejected, &listEditor, &QDialog::reject);
|
||||
|
||||
listEditor.setLayout(&layout);
|
||||
listEditor.resize(750, 500);
|
||||
|
||||
const SDObject *getPaths = RENDERDOC_GetConfigSetting("DXBC.Debug.SearchDirPaths");
|
||||
|
||||
QStringList items;
|
||||
QList<bool> recursive;
|
||||
|
||||
for(const SDObject *c : *getPaths)
|
||||
{
|
||||
items << c->data.str;
|
||||
recursive << true;
|
||||
}
|
||||
|
||||
list.setItems(items);
|
||||
const SDObject *getLimitedPaths =
|
||||
RENDERDOC_GetConfigSetting("Replay.Shader.LimitedSearchDirPaths");
|
||||
|
||||
for(const SDObject *c : *getLimitedPaths)
|
||||
{
|
||||
int idx = items.indexOf(c->data.str);
|
||||
if(idx >= 0)
|
||||
recursive[idx] = false;
|
||||
}
|
||||
|
||||
list.setItemsAndProp(items, recursive);
|
||||
|
||||
int res = RDDialog::show(&listEditor);
|
||||
|
||||
if(res)
|
||||
{
|
||||
items = list.getItems();
|
||||
recursive = list.getItemProps();
|
||||
|
||||
SDObject *setPaths = RENDERDOC_SetConfigSetting("DXBC.Debug.SearchDirPaths");
|
||||
|
||||
@@ -654,6 +678,20 @@ void SettingsDialog::on_chooseSearchPaths_clicked()
|
||||
for(int i = 0; i < items.size(); i++)
|
||||
setPaths->AddAndOwnChild(makeSDString("$el"_lit, items[i]));
|
||||
|
||||
SDObject *setLimitedPaths = RENDERDOC_SetConfigSetting("Replay.Shader.LimitedSearchDirPaths");
|
||||
|
||||
QStringList limited;
|
||||
|
||||
for(int i = 0; i < recursive.count() && i < items.count(); i++)
|
||||
if(recursive[i] == false)
|
||||
limited << items[i];
|
||||
|
||||
setLimitedPaths->DeleteChildren();
|
||||
setLimitedPaths->ReserveChildren(limited.size());
|
||||
|
||||
for(int i = 0; i < limited.size(); i++)
|
||||
setLimitedPaths->AddAndOwnChild(makeSDString("$el"_lit, limited[i]));
|
||||
|
||||
RENDERDOC_SaveConfigSettings();
|
||||
}
|
||||
}
|
||||
@@ -665,7 +703,7 @@ void SettingsDialog::on_chooseIgnores_clicked()
|
||||
listEditor.setWindowTitle(tr("Ignored DLLs for callstack symbol resolution"));
|
||||
listEditor.setWindowFlags(listEditor.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
OrderedListEditor list(tr("Ignored DLL"), ItemButton::Delete);
|
||||
OrderedListEditor list(tr("Ignored DLL"), OrderedItemExtras::Delete);
|
||||
|
||||
list.setAllowAddition(false);
|
||||
|
||||
@@ -761,7 +799,7 @@ void SettingsDialog::on_TextureViewer_ChooseShaderDirectories_clicked()
|
||||
listEditor.setWindowTitle(tr("Custom shaders search directories"));
|
||||
listEditor.setWindowFlags(listEditor.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
OrderedListEditor list(tr("Shaders Directory"), ItemButton::BrowseFolder);
|
||||
OrderedListEditor list(tr("Shaders Directory"), OrderedItemExtras::BrowseFolder);
|
||||
|
||||
QVBoxLayout layout;
|
||||
QDialogButtonBox okCancel;
|
||||
|
||||
Reference in New Issue
Block a user