mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Default to D3D11 pipeline state at the last minute
* If we default to D3D11 at construction time, if we have persist data (very likely) and it's for another API then we'll have to destroy the D3D11 viewer and recreate the other API's viewer.
This commit is contained in:
@@ -94,8 +94,6 @@ PipelineStateViewer::PipelineStateViewer(ICaptureContext &ctx, QWidget *parent)
|
||||
for(size_t i = 0; i < ARRAY_COUNT(editMenus); i++)
|
||||
editMenus[i] = new QMenu(this);
|
||||
|
||||
setToD3D11();
|
||||
|
||||
m_Ctx.AddCaptureViewer(this);
|
||||
}
|
||||
|
||||
@@ -648,6 +646,16 @@ void PipelineStateViewer::MakeShaderVariablesHLSL(bool cbufferContents,
|
||||
}
|
||||
}
|
||||
|
||||
void PipelineStateViewer::showEvent(QShowEvent *event)
|
||||
{
|
||||
// we didn't set any default pipeline state in case it would be overridden by the persist data.
|
||||
// But if we don't have any persist data and we're about to show, default to D3D11.
|
||||
if(m_Current == NULL)
|
||||
{
|
||||
setToD3D11();
|
||||
}
|
||||
}
|
||||
|
||||
QString PipelineStateViewer::GenerateHLSLStub(const ShaderBindpointMapping &bindpointMapping,
|
||||
const ShaderReflection *shaderDetails,
|
||||
const QString &entryFunc)
|
||||
|
||||
@@ -86,6 +86,8 @@ public slots:
|
||||
void shaderEdit_clicked();
|
||||
|
||||
private:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
Ui::PipelineStateViewer *ui;
|
||||
ICaptureContext &m_Ctx;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user