mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 05:20:45 +00:00
Implement GL pipeline state viewer for Qt
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,9 @@ namespace Ui
|
||||
class GLPipelineStateViewer;
|
||||
}
|
||||
|
||||
class RDTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
|
||||
class GLPipelineStateViewer : public QFrame, public ILogViewerForm
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -45,7 +48,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_viAttrs_itemActivated(QTreeWidgetItem *item, int column);
|
||||
void on_viBuffers_itemActivated(QTreeWidgetItem *item, int column);
|
||||
void on_viAttrs_mouseMove(QMouseEvent *event);
|
||||
void on_viBuffers_mouseMove(QMouseEvent *event);
|
||||
|
||||
// manual slots
|
||||
void shaderView_clicked();
|
||||
void shaderEdit_clicked();
|
||||
void shaderSave_clicked();
|
||||
void resource_itemActivated(QTreeWidgetItem *item, int column);
|
||||
void ubo_itemActivated(QTreeWidgetItem *item, int column);
|
||||
void vertex_leave(QEvent *e);
|
||||
|
||||
private:
|
||||
Ui::GLPipelineStateViewer *ui;
|
||||
CaptureContext *m_Ctx;
|
||||
|
||||
enum class GLReadWriteType
|
||||
{
|
||||
Atomic,
|
||||
SSBO,
|
||||
Image,
|
||||
};
|
||||
|
||||
QString MakeGenericValueString(uint32_t compCount, FormatComponentType compType,
|
||||
const GLPipelineState::VertexInput::VertexAttribute &val);
|
||||
GLReadWriteType GetGLReadWriteType(ShaderResource res);
|
||||
|
||||
void setShaderState(const GLPipelineState::ShaderStage &stage, QLabel *shader, RDTreeWidget *tex,
|
||||
RDTreeWidget *samp, RDTreeWidget *ubo, RDTreeWidget *sub, RDTreeWidget *rw);
|
||||
void clearShaderState(QLabel *shader, RDTreeWidget *tex, RDTreeWidget *samp, RDTreeWidget *ubo,
|
||||
RDTreeWidget *sub, RDTreeWidget *rw);
|
||||
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 GLPipelineState::ShaderStage *stageForSender(QWidget *widget);
|
||||
|
||||
template <typename viewType>
|
||||
void setViewDetails(QTreeWidgetItem *node, const viewType &view, FetchTexture *tex);
|
||||
|
||||
template <typename viewType>
|
||||
void setViewDetails(QTreeWidgetItem *node, const viewType &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
@@ -1563,8 +1563,9 @@ void VulkanPipelineStateViewer::setState()
|
||||
length = buf->length;
|
||||
}
|
||||
|
||||
QTreeWidgetItem *node = makeTreeNode({"Index", name, "Index", (qulonglong)state.IA.ibuffer.offs,
|
||||
draw->indexByteWidth, (qulonglong)length, ""});
|
||||
QTreeWidgetItem *node =
|
||||
makeTreeNode({"Index", name, "Index", (qulonglong)state.IA.ibuffer.offs,
|
||||
draw != NULL ? draw->indexByteWidth : 0, (qulonglong)length, ""});
|
||||
|
||||
ui->viBuffers->setHoverIcons(node, action, action_hover);
|
||||
|
||||
|
||||
@@ -225,19 +225,12 @@ struct GLPipelineState
|
||||
struct Viewport
|
||||
{
|
||||
Viewport()
|
||||
: Left(0.0f),
|
||||
Bottom(0.0f),
|
||||
Width(0.0f),
|
||||
Height(0.0f),
|
||||
MinDepth(0.0f),
|
||||
MaxDepth(0.0f),
|
||||
Enabled(true)
|
||||
: Left(0.0f), Bottom(0.0f), Width(0.0f), Height(0.0f), MinDepth(0.0f), MaxDepth(0.0f)
|
||||
{
|
||||
}
|
||||
float Left, Bottom;
|
||||
float Width, Height;
|
||||
double MinDepth, MaxDepth;
|
||||
bool32 Enabled;
|
||||
};
|
||||
rdctype::array<Viewport> Viewports;
|
||||
|
||||
|
||||
@@ -236,7 +236,6 @@ namespace renderdoc
|
||||
public float Left, Bottom;
|
||||
public float Width, Height;
|
||||
public double MinDepth, MaxDepth;
|
||||
public bool Enabled;
|
||||
};
|
||||
[CustomMarshalAs(CustomUnmanagedType.TemplatedArray)]
|
||||
public Viewport[] Viewports;
|
||||
|
||||
@@ -3138,12 +3138,12 @@ namespace renderdocui.Windows.PipelineState
|
||||
int i = 0;
|
||||
foreach (var v in rs.Viewports)
|
||||
{
|
||||
rows.Add(new object[] { i, v.Enabled, v.Left, v.Bottom, v.Width, v.Height, v.MinDepth, v.MaxDepth });
|
||||
rows.Add(new object[] { i, v.Left, v.Bottom, v.Width, v.Height, v.MinDepth, v.MaxDepth });
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
ExportHTMLTable(writer, new string[] { "Slot", "Enabled", "Left", "Bottom", "Width", "Height", "Min Depth", "Max Depth" }, rows.ToArray());
|
||||
ExportHTMLTable(writer, new string[] { "Slot", "Left", "Bottom", "Width", "Height", "Min Depth", "Max Depth" }, rows.ToArray());
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user