mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Remove parent widget parameter from shader view/edit/debug functions
This commit is contained in:
@@ -775,25 +775,24 @@ void CaptureContext::ShowStatisticsViewer()
|
||||
IShaderViewer *CaptureContext::EditShader(bool customShader, const QString &entryPoint,
|
||||
const QStringMap &files,
|
||||
IShaderViewer::SaveCallback saveCallback,
|
||||
IShaderViewer::CloseCallback closeCallback, QWidget *parent)
|
||||
IShaderViewer::CloseCallback closeCallback)
|
||||
{
|
||||
return ShaderViewer::EditShader(*this, customShader, entryPoint, files, saveCallback,
|
||||
closeCallback, parent);
|
||||
closeCallback, m_MainWindow->Widget());
|
||||
}
|
||||
|
||||
IShaderViewer *CaptureContext::DebugShader(const ShaderBindpointMapping *bind,
|
||||
const ShaderReflection *shader, ShaderStage stage,
|
||||
ShaderDebugTrace *trace, const QString &debugContext,
|
||||
QWidget *parent)
|
||||
ShaderDebugTrace *trace, const QString &debugContext)
|
||||
{
|
||||
return ShaderViewer::DebugShader(*this, bind, shader, stage, trace, debugContext, parent);
|
||||
return ShaderViewer::DebugShader(*this, bind, shader, stage, trace, debugContext,
|
||||
m_MainWindow->Widget());
|
||||
}
|
||||
|
||||
IShaderViewer *CaptureContext::ViewShader(const ShaderBindpointMapping *bind,
|
||||
const ShaderReflection *shader, ShaderStage stage,
|
||||
QWidget *parent)
|
||||
const ShaderReflection *shader, ShaderStage stage)
|
||||
{
|
||||
return ShaderViewer::ViewShader(*this, bind, shader, stage, parent);
|
||||
return ShaderViewer::ViewShader(*this, bind, shader, stage, m_MainWindow->Widget());
|
||||
}
|
||||
|
||||
IBufferViewer *CaptureContext::ViewBuffer(uint64_t byteOffset, uint64_t byteSize, ResourceId id,
|
||||
|
||||
@@ -148,14 +148,14 @@ public:
|
||||
|
||||
IShaderViewer *EditShader(bool customShader, const QString &entryPoint, const QStringMap &files,
|
||||
IShaderViewer::SaveCallback saveCallback,
|
||||
IShaderViewer::CloseCallback closeCallback, QWidget *parent) override;
|
||||
IShaderViewer::CloseCallback closeCallback) override;
|
||||
|
||||
IShaderViewer *DebugShader(const ShaderBindpointMapping *bind, const ShaderReflection *shader,
|
||||
ShaderStage stage, ShaderDebugTrace *trace,
|
||||
const QString &debugContext, QWidget *parent) override;
|
||||
const QString &debugContext) override;
|
||||
|
||||
IShaderViewer *ViewShader(const ShaderBindpointMapping *bind, const ShaderReflection *shader,
|
||||
ShaderStage stage, QWidget *parent) override;
|
||||
ShaderStage stage) override;
|
||||
|
||||
IBufferViewer *ViewBuffer(uint64_t byteOffset, uint64_t byteSize, ResourceId id,
|
||||
const QString &format = "") override;
|
||||
|
||||
@@ -392,17 +392,14 @@ struct ICaptureContext
|
||||
|
||||
virtual IShaderViewer *EditShader(bool customShader, const QString &entryPoint,
|
||||
const QStringMap &files, IShaderViewer::SaveCallback saveCallback,
|
||||
IShaderViewer::CloseCallback closeCallback, QWidget *parent) = 0;
|
||||
|
||||
IShaderViewer::CloseCallback closeCallback) = 0;
|
||||
virtual IShaderViewer *DebugShader(const ShaderBindpointMapping *bind,
|
||||
const ShaderReflection *shader, ShaderStage stage,
|
||||
ShaderDebugTrace *trace, const QString &debugContext,
|
||||
QWidget *parent) = 0;
|
||||
ShaderDebugTrace *trace, const QString &debugContext) = 0;
|
||||
|
||||
|
||||
virtual IShaderViewer *ViewShader(const ShaderBindpointMapping *bind,
|
||||
const ShaderReflection *shader, ShaderStage stage,
|
||||
QWidget *parent) = 0;
|
||||
|
||||
const ShaderReflection *shader, ShaderStage stage) = 0;
|
||||
virtual IBufferViewer *ViewBuffer(uint64_t byteOffset, uint64_t byteSize, ResourceId id,
|
||||
const QString &format = "") = 0;
|
||||
virtual IBufferViewer *ViewTextureAsBuffer(uint32_t arrayIdx, uint32_t mip, ResourceId id,
|
||||
|
||||
@@ -2763,8 +2763,8 @@ void BufferViewer::debugVertex()
|
||||
m_Ctx.CurPipelineState().GetBindpointMapping(ShaderStage::Pixel);
|
||||
|
||||
// viewer takes ownership of the trace
|
||||
IShaderViewer *s = m_Ctx.DebugShader(&bindMapping, shaderDetails, ShaderStage::Pixel, trace,
|
||||
debugContext, this);
|
||||
IShaderViewer *s =
|
||||
m_Ctx.DebugShader(&bindMapping, shaderDetails, ShaderStage::Pixel, trace, debugContext);
|
||||
|
||||
m_Ctx.AddDockWindow(s->Widget(), DockReference::AddTo, this);
|
||||
});
|
||||
|
||||
@@ -2160,8 +2160,7 @@ void D3D11PipelineStateViewer::shaderView_clicked()
|
||||
shaderStage = stage->stage;
|
||||
}
|
||||
|
||||
IShaderViewer *shad =
|
||||
m_Ctx.ViewShader(bindMap, shaderDetails, shaderStage, m_Ctx.GetMainWindow()->Widget());
|
||||
IShaderViewer *shad = m_Ctx.ViewShader(bindMap, shaderDetails, shaderStage);
|
||||
|
||||
m_Ctx.AddDockWindow(shad->Widget(), DockReference::AddTo, this);
|
||||
}
|
||||
|
||||
@@ -2104,8 +2104,8 @@ void D3D12PipelineStateViewer::shaderView_clicked()
|
||||
if(stage == NULL || stage->Object == ResourceId())
|
||||
return;
|
||||
|
||||
IShaderViewer *shad = m_Ctx.ViewShader(&stage->BindpointMapping, stage->ShaderDetails,
|
||||
stage->stage, m_Ctx.GetMainWindow()->Widget());
|
||||
IShaderViewer *shad =
|
||||
m_Ctx.ViewShader(&stage->BindpointMapping, stage->ShaderDetails, stage->stage);
|
||||
|
||||
m_Ctx.AddDockWindow(shad->Widget(), DockReference::AddTo, this);
|
||||
}
|
||||
|
||||
@@ -2214,8 +2214,7 @@ void GLPipelineStateViewer::shaderView_clicked()
|
||||
|
||||
ShaderReflection *shaderDetails = stage->ShaderDetails;
|
||||
|
||||
IShaderViewer *shad = m_Ctx.ViewShader(&stage->BindpointMapping, shaderDetails, stage->stage,
|
||||
m_Ctx.GetMainWindow()->Widget());
|
||||
IShaderViewer *shad = m_Ctx.ViewShader(&stage->BindpointMapping, shaderDetails, stage->stage);
|
||||
|
||||
m_Ctx.AddDockWindow(shad->Widget(), DockReference::AddTo, this);
|
||||
}
|
||||
|
||||
@@ -358,8 +358,7 @@ void PipelineStateViewer::EditShader(ShaderStage shaderType, ResourceId id,
|
||||
r->RemoveReplacement(id);
|
||||
GUIInvoke::call([ctx] { ctx->RefreshStatus(); });
|
||||
});
|
||||
},
|
||||
m_Ctx.GetMainWindow()->Widget());
|
||||
});
|
||||
|
||||
m_Ctx.AddDockWindow(sv->Widget(), DockReference::AddTo, this);
|
||||
}
|
||||
|
||||
@@ -2283,8 +2283,7 @@ void VulkanPipelineStateViewer::shaderView_clicked()
|
||||
|
||||
ShaderReflection *shaderDetails = stage->ShaderDetails;
|
||||
|
||||
IShaderViewer *shad = m_Ctx.ViewShader(&stage->BindpointMapping, shaderDetails, stage->stage,
|
||||
m_Ctx.GetMainWindow()->Widget());
|
||||
IShaderViewer *shad = m_Ctx.ViewShader(&stage->BindpointMapping, shaderDetails, stage->stage);
|
||||
|
||||
m_Ctx.AddDockWindow(shad->Widget(), DockReference::AddTo, this);
|
||||
}
|
||||
|
||||
@@ -659,8 +659,8 @@ void PixelHistoryView::startDebug(EventTag tag)
|
||||
m_Ctx.CurPipelineState().GetBindpointMapping(ShaderStage::Pixel);
|
||||
|
||||
// viewer takes ownership of the trace
|
||||
IShaderViewer *s = m_Ctx.DebugShader(&bindMapping, shaderDetails, ShaderStage::Pixel, trace,
|
||||
debugContext, m_Ctx.GetMainWindow()->Widget());
|
||||
IShaderViewer *s =
|
||||
m_Ctx.DebugShader(&bindMapping, shaderDetails, ShaderStage::Pixel, trace, debugContext);
|
||||
|
||||
m_Ctx.AddDockWindow(s->Widget(), DockReference::AddTo, m_Ctx.GetMainWindow()->Widget());
|
||||
});
|
||||
|
||||
@@ -3300,8 +3300,8 @@ void TextureViewer::on_debugPixelContext_clicked()
|
||||
m_Ctx.CurPipelineState().GetBindpointMapping(ShaderStage::Pixel);
|
||||
|
||||
// viewer takes ownership of the trace
|
||||
IShaderViewer *s = m_Ctx.DebugShader(&bindMapping, shaderDetails, ShaderStage::Pixel, trace,
|
||||
debugContext, this);
|
||||
IShaderViewer *s =
|
||||
m_Ctx.DebugShader(&bindMapping, shaderDetails, ShaderStage::Pixel, trace, debugContext);
|
||||
|
||||
m_Ctx.AddDockWindow(s->Widget(), DockReference::AddTo, this);
|
||||
});
|
||||
@@ -3619,8 +3619,7 @@ void TextureViewer::on_customEdit_clicked()
|
||||
}
|
||||
},
|
||||
|
||||
[this, key](ICaptureContext *ctx) { m_CustomShaderEditor.remove(key); },
|
||||
m_Ctx.GetMainWindow()->Widget());
|
||||
[this, key](ICaptureContext *ctx) { m_CustomShaderEditor.remove(key); });
|
||||
|
||||
m_CustomShaderEditor[key] = s;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user