mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-14 18:46:48 +00:00
Scroll shader viewer to entry point file & line using debug info
This commit is contained in:
@@ -480,8 +480,11 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR
|
||||
m_FileScintillas.reserve(m_ShaderDetails->debugInfo.files.count());
|
||||
|
||||
QWidget *sel = NULL;
|
||||
int32_t entryFile = m_ShaderDetails->debugInfo.entryLocation.fileIndex;
|
||||
int32_t i = -1;
|
||||
for(const ShaderSourceFile &f : m_ShaderDetails->debugInfo.files)
|
||||
{
|
||||
i++;
|
||||
if(f.contents.isEmpty())
|
||||
{
|
||||
m_FileScintillas.push_back(NULL);
|
||||
@@ -496,6 +499,18 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR
|
||||
if(sel == NULL)
|
||||
sel = scintilla;
|
||||
|
||||
if(i == entryFile)
|
||||
{
|
||||
sel = scintilla;
|
||||
|
||||
if(m_ShaderDetails->debugInfo.entryLocation.lineStart > 0)
|
||||
{
|
||||
GUIInvoke::defer(scintilla, [scintilla, this]() {
|
||||
ensureLineScrolled(scintilla, m_ShaderDetails->debugInfo.entryLocation.lineStart);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
m_FileScintillas.push_back(scintilla);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user