mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-24 06:36:08 +00:00
Set up D3D12 pipeline state view in Qt
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,10 @@ namespace Ui
|
||||
class D3D12PipelineStateViewer;
|
||||
}
|
||||
|
||||
class RDTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
struct ViewTag;
|
||||
|
||||
class D3D12PipelineStateViewer : public QFrame, public ILogViewerForm
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -45,7 +49,63 @@ public:
|
||||
void OnSelectedEventChanged(uint32_t eventID) {}
|
||||
void OnEventChanged(uint32_t eventID);
|
||||
|
||||
private slots:
|
||||
// automatic slots
|
||||
void on_showDisabled_toggled(bool checked);
|
||||
void on_showEmpty_toggled(bool checked);
|
||||
void on_exportHTML_clicked();
|
||||
void on_meshView_clicked();
|
||||
void on_iaLayouts_itemActivated(QTreeWidgetItem *item, int column);
|
||||
void on_iaBuffers_itemActivated(QTreeWidgetItem *item, int column);
|
||||
void on_iaLayouts_mouseMove(QMouseEvent *event);
|
||||
void on_iaBuffers_mouseMove(QMouseEvent *event);
|
||||
|
||||
// manual slots
|
||||
void shaderView_clicked();
|
||||
void shaderEdit_clicked();
|
||||
void shaderSave_clicked();
|
||||
void resource_itemActivated(QTreeWidgetItem *item, int column);
|
||||
void cbuffer_itemActivated(QTreeWidgetItem *item, int column);
|
||||
void vertex_leave(QEvent *e);
|
||||
|
||||
private:
|
||||
Ui::D3D12PipelineStateViewer *ui;
|
||||
CaptureContext *m_Ctx;
|
||||
|
||||
enum D3DBufferViewFlags
|
||||
{
|
||||
RawBuffer = 0x1,
|
||||
AppendBuffer = 0x2,
|
||||
CounterBuffer = 0x4,
|
||||
};
|
||||
|
||||
void setShaderState(const D3D12PipelineState::ShaderStage &stage, QLabel *shader, RDTreeWidget *tex,
|
||||
RDTreeWidget *samp, RDTreeWidget *cbuffer, RDTreeWidget *uavs);
|
||||
|
||||
void addResourceRow(const ViewTag &view, const D3D12PipelineState::ShaderStage *stage,
|
||||
RDTreeWidget *resources);
|
||||
|
||||
void clearShaderState(QLabel *shader, RDTreeWidget *tex, RDTreeWidget *samp,
|
||||
RDTreeWidget *cbuffer, RDTreeWidget *uavs);
|
||||
void setState();
|
||||
void clearState();
|
||||
|
||||
void setInactiveRow(QTreeWidgetItem *node);
|
||||
void setEmptyRow(QTreeWidgetItem *node);
|
||||
void highlightIABind(int slot);
|
||||
|
||||
QString formatMembers(int indent, const QString &nameprefix,
|
||||
const rdctype::array<ShaderConstant> &vars);
|
||||
const D3D12PipelineState::ShaderStage *stageForSender(QWidget *widget);
|
||||
|
||||
bool HasImportantViewParams(const D3D12PipelineState::ResourceView &view, FetchTexture *tex);
|
||||
bool HasImportantViewParams(const D3D12PipelineState::ResourceView &view, FetchBuffer *buf);
|
||||
|
||||
void setViewDetails(QTreeWidgetItem *node, const ViewTag &view, FetchTexture *tex);
|
||||
void setViewDetails(QTreeWidgetItem *node, const ViewTag &view, FetchBuffer *buf);
|
||||
|
||||
bool showNode(bool usedSlot, bool filledSlot);
|
||||
|
||||
// keep track of the VB nodes (we want to be able to highlight them easily on hover)
|
||||
QList<QTreeWidgetItem *> m_VBNodes;
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -360,7 +360,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
|
||||
TreelistView.NodeCollection parent = list.Nodes;
|
||||
|
||||
string rootel = r.Immediate ? String.Format("#{0} Direct", r.RootElement) : rootel = String.Format("#{0} Table[{1}]", r.RootElement, r.TableIndex);
|
||||
string rootel = r.Immediate ? String.Format("#{0} Direct", r.RootElement) : String.Format("#{0} Table[{1}]", r.RootElement, r.TableIndex);
|
||||
|
||||
bool filledSlot = r.Resource != ResourceId.Null;
|
||||
bool usedSlot = (bind != null && bind.used);
|
||||
@@ -1371,7 +1371,7 @@ namespace renderdocui.Windows.PipelineState
|
||||
format = "Viewed as " + state.m_OM.DepthTarget.Format.ToString();
|
||||
}
|
||||
|
||||
if (HasImportantViewParams(state.m_OM.DepthTarget, texs[t]))
|
||||
if (HasImportantViewParams(state.m_OM.DepthTarget, texs[t]) || state.m_OM.DepthReadOnly || state.m_OM.StencilReadOnly)
|
||||
viewDetails = true;
|
||||
|
||||
tag = new ViewTexTag(state.m_OM.DepthTarget, texs[t], false, null);
|
||||
@@ -1589,6 +1589,14 @@ namespace renderdocui.Windows.PipelineState
|
||||
text += String.Format("The texture is format {0}, the view treats it as {1}.\n",
|
||||
tex.tex.format, tex.view.Format);
|
||||
|
||||
if (m_Core.CurD3D12PipelineState.m_OM.DepthTarget.Resource == tex.tex.ID)
|
||||
{
|
||||
if(m_Core.CurD3D12PipelineState.m_OM.DepthReadOnly)
|
||||
text += "Depth component is read-only\n";
|
||||
if (m_Core.CurD3D12PipelineState.m_OM.StencilReadOnly)
|
||||
text += "Stencil component is read-only\n";
|
||||
}
|
||||
|
||||
if (tex.tex.mips > 1 && (tex.tex.mips != tex.view.NumMipLevels || tex.view.HighestMip > 0))
|
||||
{
|
||||
if (tex.view.NumMipLevels == 1)
|
||||
|
||||
Reference in New Issue
Block a user