Update GL pipeline state viewer to use new descriptor access

This commit is contained in:
baldurk
2024-03-21 17:19:48 +00:00
parent e08107ebe8
commit 317c670fd5
6 changed files with 1064 additions and 829 deletions
@@ -73,11 +73,13 @@ public:
m_bold = bold;
dataChanged(0, Qt::FontRole);
}
inline bool bold() const { return m_bold; }
inline void setItalic(bool italic)
{
m_italic = italic;
dataChanged(0, Qt::FontRole);
}
inline bool italic() const { return m_italic; }
inline void setTreeColor(QColor col) { m_treeCol = col; }
inline void setBackgroundColor(QColor background) { setBackground(QBrush(background)); }
inline void setForegroundColor(QColor foreground) { setForeground(QBrush(foreground)); }
@@ -72,26 +72,6 @@ struct D3D11ViewTag
Q_DECLARE_METATYPE(D3D11ViewTag);
struct ScopedTreeUpdater
{
ScopedTreeUpdater(RDTreeWidget *widget) : m_Widget(widget)
{
vs = m_Widget->verticalScrollBar()->value();
m_Widget->beginUpdate();
m_Widget->clear();
}
~ScopedTreeUpdater()
{
m_Widget->clearSelection();
m_Widget->endUpdate();
m_Widget->verticalScrollBar()->setValue(vs);
}
RDTreeWidget *m_Widget;
int vs;
};
D3D11PipelineStateViewer::D3D11PipelineStateViewer(ICaptureContext &ctx,
PipelineStateViewer &common, QWidget *parent)
: QFrame(parent), ui(new Ui::D3D11PipelineStateViewer), m_Ctx(ctx), m_Common(common)
File diff suppressed because it is too large Load Diff
@@ -39,6 +39,13 @@ class RDTreeWidget;
class RDTreeWidgetItem;
class PipelineStateViewer;
enum class GLReadWriteType
{
Atomic,
SSBO,
Image,
};
class GLPipelineStateViewer : public QFrame, public ICaptureViewer
{
Q_OBJECT
@@ -81,24 +88,30 @@ private:
ICaptureContext &m_Ctx;
PipelineStateViewer &m_Common;
enum class GLReadWriteType
{
Atomic,
SSBO,
Image,
};
QString MakeGenericValueString(uint32_t compCount, CompType compType,
const GLPipe::VertexAttribute &val);
GLReadWriteType GetGLReadWriteType(ShaderResource res);
void setShaderState(const GLPipe::Shader &stage, RDLabel *shader, RDTreeWidget *tex,
RDTreeWidget *samp, RDTreeWidget *ubo, RDTreeWidget *sub, RDTreeWidget *rw);
void setShaderState(const GLPipe::Shader &stage, RDLabel *shader, RDTreeWidget *sub);
void addUBORow(const Descriptor &descriptor, uint32_t reg, uint32_t index,
const ConstantBlock *shaderBind, bool usedSlot, RDTreeWidget *ubos);
void addImageSamplerRow(const Descriptor &descriptor, const SamplerDescriptor &samplerDescriptor,
uint32_t reg, const ShaderResource *shaderTex,
const ShaderSampler *shaderSamp, bool usedSlot,
const GLPipe::TextureCompleteness *texCompleteness,
RDTreeWidgetItem *textures, RDTreeWidgetItem *samplers);
void addReadWriteRow(const Descriptor &descriptor, uint32_t reg, uint32_t index,
const ShaderResource *shaderBind, bool usedSlot,
const GLPipe::TextureCompleteness *texCompleteness,
RDTreeWidgetItem *readwrites);
void clearShaderState(RDLabel *shader, RDTreeWidget *tex, RDTreeWidget *samp, RDTreeWidget *ubo,
RDTreeWidget *sub, RDTreeWidget *rw);
void setState();
void clearState();
bool isInactiveRow(RDTreeWidgetItem *node);
void setInactiveRow(RDTreeWidgetItem *node);
void setEmptyRow(RDTreeWidgetItem *node);
void highlightIABind(int slot);
@@ -110,7 +123,7 @@ private:
void setViewDetails(RDTreeWidgetItem *node, TextureDescription *tex, uint32_t firstMip,
uint32_t numMips, uint32_t firstSlice, uint32_t numSlices,
const GLPipe::Texture *texBinding = NULL);
const GLPipe::TextureCompleteness *texCompleteness = NULL);
void exportHTML(QXmlStreamWriter &xml, const GLPipe::VertexInput &vtx);
void exportHTML(QXmlStreamWriter &xml, const GLPipe::Shader &sh);
@@ -118,6 +131,10 @@ private:
void exportHTML(QXmlStreamWriter &xml, const GLPipe::Rasterizer &rs);
void exportHTML(QXmlStreamWriter &xml, const GLPipe::FrameBuffer &fb);
rdcarray<DescriptorLogicalLocation> m_Locations;
rdcarray<Descriptor> m_Descriptors;
rdcarray<SamplerDescriptor> m_SamplerDescriptors;
// keep track of the VB nodes (we want to be able to highlight them easily on hover)
QList<RDTreeWidgetItem *> m_VBNodes;
// list of empty VB nodes that shouldn't be highlighted on hover
@@ -26,6 +26,7 @@
#include <QMenu>
#include <QMouseEvent>
#include <QPainter>
#include <QScrollBar>
#include <QStylePainter>
#include <QSvgRenderer>
#include <QToolButton>
@@ -1546,3 +1547,17 @@ void PipelineStateViewer::SelectPipelineStage(PipelineStage stage)
else if(m_Vulkan)
m_Vulkan->SelectPipelineStage(stage);
}
ScopedTreeUpdater::ScopedTreeUpdater(RDTreeWidget *widget) : m_Widget(widget)
{
vs = m_Widget->verticalScrollBar()->value();
m_Widget->beginUpdate();
m_Widget->clear();
}
ScopedTreeUpdater::~ScopedTreeUpdater()
{
m_Widget->clearSelection();
m_Widget->endUpdate();
m_Widget->verticalScrollBar()->setValue(vs);
}
@@ -50,6 +50,15 @@ class VulkanPipelineStateViewer;
class PipelineStateViewer;
struct ScopedTreeUpdater
{
ScopedTreeUpdater(RDTreeWidget *widget);
~ScopedTreeUpdater();
RDTreeWidget *m_Widget;
int vs;
};
class RDPreviewTooltip : public QFrame, public ITreeViewTipDisplay
{
private: