mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Remove nested structs from Vulkan pipeline state and move to namespace
This commit is contained in:
@@ -537,7 +537,7 @@ void CaptureContext::CloseLogfile()
|
||||
CurD3D11PipelineState = D3D11Pipe::State();
|
||||
CurD3D12PipelineState = D3D12PipelineState();
|
||||
CurGLPipelineState = GLPipe::State();
|
||||
CurVulkanPipelineState = VulkanPipelineState();
|
||||
CurVulkanPipelineState = VKPipe::State();
|
||||
CurPipelineState.SetStates(m_APIProps, NULL, NULL, NULL, NULL);
|
||||
|
||||
DebugMessages.clear();
|
||||
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
D3D11Pipe::State CurD3D11PipelineState;
|
||||
D3D12PipelineState CurD3D12PipelineState;
|
||||
GLPipe::State CurGLPipelineState;
|
||||
VulkanPipelineState CurVulkanPipelineState;
|
||||
VKPipe::State CurVulkanPipelineState;
|
||||
CommonPipelineState CurPipelineState;
|
||||
|
||||
PersistantConfig &Config;
|
||||
|
||||
@@ -31,7 +31,7 @@ QString CommonPipelineState::GetImageLayout(ResourceId id)
|
||||
{
|
||||
if(IsLogVK())
|
||||
{
|
||||
for(const VulkanPipelineState::ImageData &i : m_Vulkan->images)
|
||||
for(const VKPipe::ImageData &i : m_Vulkan->images)
|
||||
{
|
||||
if(i.image == id)
|
||||
return ToQStr(i.layouts[0].name);
|
||||
@@ -881,9 +881,8 @@ void CommonPipelineState::GetConstantBuffer(ShaderStage stage, uint32_t BufIdx,
|
||||
}
|
||||
else if(IsLogVK())
|
||||
{
|
||||
VulkanPipelineState::Pipeline &pipe =
|
||||
stage == ShaderStage::Compute ? m_Vulkan->compute : m_Vulkan->graphics;
|
||||
const VulkanPipelineState::Shader &s = GetVulkanStage(stage);
|
||||
VKPipe::Pipeline &pipe = stage == ShaderStage::Compute ? m_Vulkan->compute : m_Vulkan->graphics;
|
||||
const VKPipe::Shader &s = GetVulkanStage(stage);
|
||||
|
||||
if(s.ShaderDetails != NULL && BufIdx < (uint32_t)s.ShaderDetails->ConstantBlocks.count)
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ class CommonPipelineState
|
||||
public:
|
||||
CommonPipelineState() {}
|
||||
void SetStates(APIProperties props, D3D11Pipe::State *d3d11, D3D12PipelineState *d3d12,
|
||||
GLPipe::State *gl, VulkanPipelineState *vk)
|
||||
GLPipe::State *gl, VKPipe::State *vk)
|
||||
{
|
||||
m_APIProps = props;
|
||||
m_D3D11 = d3d11;
|
||||
@@ -174,7 +174,7 @@ private:
|
||||
D3D11Pipe::State *m_D3D11 = NULL;
|
||||
D3D12PipelineState *m_D3D12 = NULL;
|
||||
GLPipe::State *m_GL = NULL;
|
||||
VulkanPipelineState *m_Vulkan = NULL;
|
||||
VKPipe::State *m_Vulkan = NULL;
|
||||
APIProperties m_APIProps;
|
||||
|
||||
const D3D11Pipe::Shader &GetD3D11Stage(ShaderStage stage)
|
||||
@@ -234,7 +234,7 @@ private:
|
||||
return m_GL->m_CS;
|
||||
}
|
||||
|
||||
const VulkanPipelineState::Shader &GetVulkanStage(ShaderStage stage)
|
||||
const VKPipe::Shader &GetVulkanStage(ShaderStage stage)
|
||||
{
|
||||
if(stage == ShaderStage::Vertex)
|
||||
return m_Vulkan->m_VS;
|
||||
|
||||
@@ -368,7 +368,7 @@ void VulkanPipelineStateViewer::setViewDetails(QTreeWidgetItem *node, const bind
|
||||
bool viewdetails = false;
|
||||
|
||||
{
|
||||
for(const VulkanPipelineState::ImageData &im : m_Ctx.CurVulkanPipelineState.images)
|
||||
for(const VKPipe::ImageData &im : m_Ctx.CurVulkanPipelineState.images)
|
||||
{
|
||||
if(im.image == tex->ID)
|
||||
{
|
||||
@@ -479,7 +479,7 @@ bool VulkanPipelineStateViewer::showNode(bool usedSlot, bool filledSlot)
|
||||
return false;
|
||||
}
|
||||
|
||||
const VulkanPipelineState::Shader *VulkanPipelineStateViewer::stageForSender(QWidget *widget)
|
||||
const VKPipe::Shader *VulkanPipelineStateViewer::stageForSender(QWidget *widget)
|
||||
{
|
||||
if(!m_Ctx.LogLoaded())
|
||||
return NULL;
|
||||
@@ -578,9 +578,8 @@ void VulkanPipelineStateViewer::clearState()
|
||||
ui->stencils->clear();
|
||||
}
|
||||
|
||||
QVariantList VulkanPipelineStateViewer::makeSampler(
|
||||
const QString &bindset, const QString &slotname,
|
||||
const VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement &descriptor)
|
||||
QVariantList VulkanPipelineStateViewer::makeSampler(const QString &bindset, const QString &slotname,
|
||||
const VKPipe::BindingElement &descriptor)
|
||||
{
|
||||
QString addressing = "";
|
||||
QString addPrefix = "";
|
||||
@@ -664,9 +663,8 @@ QVariantList VulkanPipelineStateViewer::makeSampler(
|
||||
}
|
||||
|
||||
void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails,
|
||||
const VulkanPipelineState::Shader &stage, int bindset,
|
||||
int bind, const VulkanPipelineState::Pipeline &pipe,
|
||||
RDTreeWidget *resources,
|
||||
const VKPipe::Shader &stage, int bindset, int bind,
|
||||
const VKPipe::Pipeline &pipe, RDTreeWidget *resources,
|
||||
QMap<ResourceId, SamplerData> &samplers)
|
||||
{
|
||||
const ShaderResource *shaderRes = NULL;
|
||||
@@ -708,8 +706,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails,
|
||||
}
|
||||
}
|
||||
|
||||
const rdctype::array<VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement>
|
||||
*slotBinds = NULL;
|
||||
const rdctype::array<VKPipe::BindingElement> *slotBinds = NULL;
|
||||
BindType bindType = BindType::Unknown;
|
||||
ShaderStageMask stageBits = ShaderStageMask::Unknown;
|
||||
|
||||
@@ -793,8 +790,7 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails,
|
||||
|
||||
for(int idx = 0; idx < arrayLength; idx++)
|
||||
{
|
||||
const VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement *descriptorBind =
|
||||
NULL;
|
||||
const VKPipe::BindingElement *descriptorBind = NULL;
|
||||
if(slotBinds != NULL)
|
||||
descriptorBind = &(*slotBinds)[idx];
|
||||
|
||||
@@ -1044,9 +1040,8 @@ void VulkanPipelineStateViewer::addResourceRow(ShaderReflection *shaderDetails,
|
||||
}
|
||||
|
||||
void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDetails,
|
||||
const VulkanPipelineState::Shader &stage,
|
||||
int bindset, int bind,
|
||||
const VulkanPipelineState::Pipeline &pipe,
|
||||
const VKPipe::Shader &stage, int bindset,
|
||||
int bind, const VKPipe::Pipeline &pipe,
|
||||
RDTreeWidget *ubos)
|
||||
{
|
||||
const ConstantBlock *cblock = NULL;
|
||||
@@ -1074,8 +1069,7 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta
|
||||
slot = ~0U;
|
||||
}
|
||||
|
||||
const rdctype::array<VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement>
|
||||
*slotBinds = NULL;
|
||||
const rdctype::array<VKPipe::BindingElement> *slotBinds = NULL;
|
||||
BindType bindType = BindType::ConstantBuffer;
|
||||
ShaderStageMask stageBits = ShaderStageMask::Unknown;
|
||||
|
||||
@@ -1140,8 +1134,7 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta
|
||||
|
||||
for(int idx = 0; idx < arrayLength; idx++)
|
||||
{
|
||||
const VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement *descriptorBind =
|
||||
NULL;
|
||||
const VKPipe::BindingElement *descriptorBind = NULL;
|
||||
if(slotBinds != NULL)
|
||||
descriptorBind = &(*slotBinds)[idx];
|
||||
|
||||
@@ -1223,10 +1216,9 @@ void VulkanPipelineStateViewer::addConstantBlockRow(ShaderReflection *shaderDeta
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanPipelineStateViewer::setShaderState(const VulkanPipelineState::Shader &stage,
|
||||
const VulkanPipelineState::Pipeline &pipe,
|
||||
QLabel *shader, RDTreeWidget *resources,
|
||||
RDTreeWidget *ubos)
|
||||
void VulkanPipelineStateViewer::setShaderState(const VKPipe::Shader &stage,
|
||||
const VKPipe::Pipeline &pipe, QLabel *shader,
|
||||
RDTreeWidget *resources, RDTreeWidget *ubos)
|
||||
{
|
||||
ShaderReflection *shaderDetails = stage.ShaderDetails;
|
||||
|
||||
@@ -1432,7 +1424,7 @@ void VulkanPipelineStateViewer::setState()
|
||||
|
||||
m_CombinedImageSamplers.clear();
|
||||
|
||||
const VulkanPipelineState &state = m_Ctx.CurVulkanPipelineState;
|
||||
const VKPipe::State &state = m_Ctx.CurVulkanPipelineState;
|
||||
const FetchDrawcall *draw = m_Ctx.CurDrawcall();
|
||||
|
||||
bool showDisabled = ui->showDisabled->isChecked();
|
||||
@@ -1456,7 +1448,7 @@ void VulkanPipelineStateViewer::setState()
|
||||
ui->viAttrs->clear();
|
||||
{
|
||||
int i = 0;
|
||||
for(const VulkanPipelineState::VertexInput::Attribute &a : state.VI.attrs)
|
||||
for(const VKPipe::VertexAttribute &a : state.VI.attrs)
|
||||
{
|
||||
bool filledSlot = true;
|
||||
bool usedSlot = false;
|
||||
@@ -1607,9 +1599,8 @@ void VulkanPipelineStateViewer::setState()
|
||||
int i = 0;
|
||||
for(; i < qMax(state.VI.vbuffers.count, state.VI.binds.count); i++)
|
||||
{
|
||||
const VulkanPipelineState::VertexInput::VertexBuffer *vbuff =
|
||||
(i < state.VI.vbuffers.count ? &state.VI.vbuffers[i] : NULL);
|
||||
const VulkanPipelineState::VertexInput::Binding *bind = NULL;
|
||||
const VKPipe::VB *vbuff = (i < state.VI.vbuffers.count ? &state.VI.vbuffers[i] : NULL);
|
||||
const VKPipe::VertexBinding *bind = NULL;
|
||||
|
||||
for(int b = 0; b < state.VI.binds.count; b++)
|
||||
{
|
||||
@@ -1727,7 +1718,7 @@ void VulkanPipelineStateViewer::setState()
|
||||
|
||||
{
|
||||
int i = 0;
|
||||
for(const VulkanPipelineState::ViewState::ViewportScissor &v : state.VP.viewportScissors)
|
||||
for(const VKPipe::ViewportScissor &v : state.VP.viewportScissors)
|
||||
{
|
||||
QTreeWidgetItem *node =
|
||||
makeTreeNode({i, v.vp.x, v.vp.y, v.vp.width, v.vp.height, v.vp.minDepth, v.vp.maxDepth});
|
||||
@@ -1781,8 +1772,7 @@ void VulkanPipelineStateViewer::setState()
|
||||
ui->framebuffer->clear();
|
||||
{
|
||||
int i = 0;
|
||||
for(const VulkanPipelineState::CurrentPass::Framebuffer::Attachment &p :
|
||||
state.Pass.framebuffer.attachments)
|
||||
for(const VKPipe::Attachment &p : state.Pass.framebuffer.attachments)
|
||||
{
|
||||
int colIdx = -1;
|
||||
for(int c = 0; c < state.Pass.renderpass.colorAttachments.count; c++)
|
||||
@@ -1885,7 +1875,7 @@ void VulkanPipelineStateViewer::setState()
|
||||
ui->blends->clear();
|
||||
{
|
||||
int i = 0;
|
||||
for(const VulkanPipelineState::ColorBlend::Attachment &blend : state.CB.attachments)
|
||||
for(const VKPipe::Blend &blend : state.CB.attachments)
|
||||
{
|
||||
bool filledSlot = true;
|
||||
bool usedSlot = (targets[i]);
|
||||
@@ -2025,7 +2015,7 @@ QString VulkanPipelineStateViewer::formatMembers(int indent, const QString &name
|
||||
|
||||
void VulkanPipelineStateViewer::resource_itemActivated(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
const VulkanPipelineState::Shader *stage = stageForSender(item->treeWidget());
|
||||
const VKPipe::Shader *stage = stageForSender(item->treeWidget());
|
||||
|
||||
if(stage == NULL)
|
||||
return;
|
||||
@@ -2125,7 +2115,7 @@ void VulkanPipelineStateViewer::resource_itemActivated(QTreeWidgetItem *item, in
|
||||
|
||||
void VulkanPipelineStateViewer::ubo_itemActivated(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
const VulkanPipelineState::Shader *stage = stageForSender(item->treeWidget());
|
||||
const VKPipe::Shader *stage = stageForSender(item->treeWidget());
|
||||
|
||||
if(stage == NULL)
|
||||
return;
|
||||
@@ -2189,7 +2179,7 @@ void VulkanPipelineStateViewer::highlightIABind(int slot)
|
||||
{
|
||||
int idx = ((slot + 1) * 21) % 32; // space neighbouring colours reasonably distinctly
|
||||
|
||||
const VulkanPipelineState::VertexInput &VI = m_Ctx.CurVulkanPipelineState.VI;
|
||||
const VKPipe::VertexInput &VI = m_Ctx.CurVulkanPipelineState.VI;
|
||||
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f);
|
||||
|
||||
@@ -2248,7 +2238,7 @@ void VulkanPipelineStateViewer::on_viAttrs_mouseMove(QMouseEvent *e)
|
||||
|
||||
vertex_leave(NULL);
|
||||
|
||||
const VulkanPipelineState::VertexInput &VI = m_Ctx.CurVulkanPipelineState.VI;
|
||||
const VKPipe::VertexInput &VI = m_Ctx.CurVulkanPipelineState.VI;
|
||||
|
||||
if(idx.isValid())
|
||||
{
|
||||
@@ -2341,8 +2331,7 @@ void VulkanPipelineStateViewer::on_pipeFlow_stageSelected(int index)
|
||||
|
||||
void VulkanPipelineStateViewer::shaderView_clicked()
|
||||
{
|
||||
const VulkanPipelineState::Shader *stage =
|
||||
stageForSender(qobject_cast<QWidget *>(QObject::sender()));
|
||||
const VKPipe::Shader *stage = stageForSender(qobject_cast<QWidget *>(QObject::sender()));
|
||||
|
||||
if(stage == NULL || stage->Object == ResourceId())
|
||||
return;
|
||||
@@ -2363,7 +2352,7 @@ void VulkanPipelineStateViewer::shaderView_clicked()
|
||||
void VulkanPipelineStateViewer::shaderEdit_clicked()
|
||||
{
|
||||
QWidget *sender = qobject_cast<QWidget *>(QObject::sender());
|
||||
const VulkanPipelineState::Shader *stage = stageForSender(sender);
|
||||
const VKPipe::Shader *stage = stageForSender(sender);
|
||||
|
||||
if(!stage || stage->Object == ResourceId())
|
||||
return;
|
||||
@@ -2488,8 +2477,7 @@ QString VulkanPipelineStateViewer::disassembleSPIRV(const ShaderReflection *shad
|
||||
|
||||
void VulkanPipelineStateViewer::shaderSave_clicked()
|
||||
{
|
||||
const VulkanPipelineState::Shader *stage =
|
||||
stageForSender(qobject_cast<QWidget *>(QObject::sender()));
|
||||
const VKPipe::Shader *stage = stageForSender(qobject_cast<QWidget *>(QObject::sender()));
|
||||
|
||||
if(stage == NULL)
|
||||
return;
|
||||
|
||||
@@ -83,19 +83,16 @@ private:
|
||||
CaptureContext &m_Ctx;
|
||||
PipelineStateViewer &m_Common;
|
||||
|
||||
QVariantList makeSampler(
|
||||
const QString &bindset, const QString &slotname,
|
||||
const VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement &descriptor);
|
||||
void addResourceRow(ShaderReflection *shaderDetails, const VulkanPipelineState::Shader &stage,
|
||||
int bindset, int bind, const VulkanPipelineState::Pipeline &pipe,
|
||||
RDTreeWidget *resources, QMap<ResourceId, SamplerData> &samplers);
|
||||
void addConstantBlockRow(ShaderReflection *shaderDetails,
|
||||
const VulkanPipelineState::Shader &stage, int bindset, int bind,
|
||||
const VulkanPipelineState::Pipeline &pipe, RDTreeWidget *ubos);
|
||||
QVariantList makeSampler(const QString &bindset, const QString &slotname,
|
||||
const VKPipe::BindingElement &descriptor);
|
||||
void addResourceRow(ShaderReflection *shaderDetails, const VKPipe::Shader &stage, int bindset,
|
||||
int bind, const VKPipe::Pipeline &pipe, RDTreeWidget *resources,
|
||||
QMap<ResourceId, SamplerData> &samplers);
|
||||
void addConstantBlockRow(ShaderReflection *shaderDetails, const VKPipe::Shader &stage,
|
||||
int bindset, int bind, const VKPipe::Pipeline &pipe, RDTreeWidget *ubos);
|
||||
|
||||
void setShaderState(const VulkanPipelineState::Shader &stage,
|
||||
const VulkanPipelineState::Pipeline &pipe, QLabel *shader, RDTreeWidget *res,
|
||||
RDTreeWidget *ubo);
|
||||
void setShaderState(const VKPipe::Shader &stage, const VKPipe::Pipeline &pipe, QLabel *shader,
|
||||
RDTreeWidget *res, RDTreeWidget *ubo);
|
||||
void clearShaderState(QLabel *shader, RDTreeWidget *res, RDTreeWidget *ubo);
|
||||
void setState();
|
||||
void clearState();
|
||||
@@ -106,7 +103,7 @@ private:
|
||||
|
||||
QString formatMembers(int indent, const QString &nameprefix,
|
||||
const rdctype::array<ShaderConstant> &vars);
|
||||
const VulkanPipelineState::Shader *stageForSender(QWidget *widget);
|
||||
const VKPipe::Shader *stageForSender(QWidget *widget);
|
||||
|
||||
QString disassembleSPIRV(const ShaderReflection *shaderDetails);
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ struct IReplayRenderer
|
||||
virtual bool GetD3D11PipelineState(D3D11Pipe::State *state) = 0;
|
||||
virtual bool GetD3D12PipelineState(D3D12PipelineState *state) = 0;
|
||||
virtual bool GetGLPipelineState(GLPipe::State *state) = 0;
|
||||
virtual bool GetVulkanPipelineState(VulkanPipelineState *state) = 0;
|
||||
virtual bool GetVulkanPipelineState(VKPipe::State *state) = 0;
|
||||
|
||||
virtual ResourceId BuildCustomShader(const char *entry, const char *source,
|
||||
const uint32_t compileFlags, ShaderStage type,
|
||||
@@ -304,7 +304,7 @@ ReplayRenderer_GetD3D12PipelineState(IReplayRenderer *rend, D3D12PipelineState *
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetGLPipelineState(IReplayRenderer *rend,
|
||||
GLPipe::State *state);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC
|
||||
ReplayRenderer_GetVulkanPipelineState(IReplayRenderer *rend, VulkanPipelineState *state);
|
||||
ReplayRenderer_GetVulkanPipelineState(IReplayRenderer *rend, VKPipe::State *state);
|
||||
|
||||
extern "C" RENDERDOC_API void RENDERDOC_CC ReplayRenderer_BuildCustomShader(
|
||||
IReplayRenderer *rend, const char *entry, const char *source, const uint32_t compileFlags,
|
||||
|
||||
+335
-293
@@ -24,344 +24,386 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
struct VulkanPipelineState
|
||||
namespace VKPipe
|
||||
{
|
||||
struct Pipeline
|
||||
struct BindingElement
|
||||
{
|
||||
BindingElement()
|
||||
: immutableSampler(false),
|
||||
customSamplerName(false),
|
||||
baseMip(0),
|
||||
baseLayer(0),
|
||||
offset(0),
|
||||
size(0),
|
||||
mipBias(0.0f),
|
||||
maxAniso(0.0f),
|
||||
compareEnable(false),
|
||||
minlod(0.0f),
|
||||
maxlod(0.0f),
|
||||
borderEnable(false),
|
||||
unnormalized(false)
|
||||
{
|
||||
Pipeline() : flags(0) {}
|
||||
ResourceId obj;
|
||||
uint32_t flags;
|
||||
swizzle[0] = TextureSwizzle::Red;
|
||||
swizzle[1] = TextureSwizzle::Green;
|
||||
swizzle[2] = TextureSwizzle::Blue;
|
||||
swizzle[3] = TextureSwizzle::Alpha;
|
||||
}
|
||||
|
||||
struct DescriptorSet
|
||||
{
|
||||
ResourceId layout;
|
||||
ResourceId descset;
|
||||
ResourceId view; // bufferview, imageview, attachmentview
|
||||
ResourceId res; // buffer, image, attachment
|
||||
ResourceId sampler;
|
||||
bool32 immutableSampler;
|
||||
|
||||
struct DescriptorBinding
|
||||
{
|
||||
uint32_t descriptorCount;
|
||||
BindType type;
|
||||
ShaderStageMask stageFlags;
|
||||
rdctype::str SamplerName;
|
||||
bool32 customSamplerName;
|
||||
|
||||
struct BindingElement
|
||||
{
|
||||
BindingElement()
|
||||
: immutableSampler(false),
|
||||
customSamplerName(false),
|
||||
baseMip(0),
|
||||
baseLayer(0),
|
||||
offset(0),
|
||||
size(0),
|
||||
mipBias(0.0f),
|
||||
maxAniso(0.0f),
|
||||
compareEnable(false),
|
||||
minlod(0.0f),
|
||||
maxlod(0.0f),
|
||||
borderEnable(false),
|
||||
unnormalized(false)
|
||||
{
|
||||
swizzle[0] = TextureSwizzle::Red;
|
||||
swizzle[1] = TextureSwizzle::Green;
|
||||
swizzle[2] = TextureSwizzle::Blue;
|
||||
swizzle[3] = TextureSwizzle::Alpha;
|
||||
}
|
||||
// image views
|
||||
ResourceFormat viewfmt;
|
||||
TextureSwizzle swizzle[4];
|
||||
uint32_t baseMip;
|
||||
uint32_t baseLayer;
|
||||
uint32_t numMip;
|
||||
uint32_t numLayer;
|
||||
|
||||
ResourceId view; // bufferview, imageview, attachmentview
|
||||
ResourceId res; // buffer, image, attachment
|
||||
ResourceId sampler;
|
||||
bool32 immutableSampler;
|
||||
// buffers
|
||||
uint64_t offset;
|
||||
uint64_t size;
|
||||
|
||||
rdctype::str SamplerName;
|
||||
bool32 customSamplerName;
|
||||
// sampler info
|
||||
rdctype::str mag, min, mip;
|
||||
rdctype::str addrU, addrV, addrW;
|
||||
float mipBias;
|
||||
float maxAniso;
|
||||
bool32 compareEnable;
|
||||
rdctype::str comparison;
|
||||
float minlod, maxlod;
|
||||
bool32 borderEnable;
|
||||
rdctype::str border;
|
||||
bool32 unnormalized;
|
||||
};
|
||||
|
||||
// image views
|
||||
ResourceFormat viewfmt;
|
||||
TextureSwizzle swizzle[4];
|
||||
uint32_t baseMip;
|
||||
uint32_t baseLayer;
|
||||
uint32_t numMip;
|
||||
uint32_t numLayer;
|
||||
struct DescriptorBinding
|
||||
{
|
||||
uint32_t descriptorCount;
|
||||
BindType type;
|
||||
ShaderStageMask stageFlags;
|
||||
|
||||
// buffers
|
||||
uint64_t offset;
|
||||
uint64_t size;
|
||||
// may only be one element if not an array
|
||||
rdctype::array<BindingElement> binds;
|
||||
};
|
||||
|
||||
// sampler info
|
||||
rdctype::str mag, min, mip;
|
||||
rdctype::str addrU, addrV, addrW;
|
||||
float mipBias;
|
||||
float maxAniso;
|
||||
bool32 compareEnable;
|
||||
rdctype::str comparison;
|
||||
float minlod, maxlod;
|
||||
bool32 borderEnable;
|
||||
rdctype::str border;
|
||||
bool32 unnormalized;
|
||||
};
|
||||
struct DescriptorSet
|
||||
{
|
||||
ResourceId layout;
|
||||
ResourceId descset;
|
||||
|
||||
// may only be one element if not an array
|
||||
rdctype::array<BindingElement> binds;
|
||||
};
|
||||
rdctype::array<DescriptorBinding> bindings;
|
||||
};
|
||||
rdctype::array<DescriptorBinding> bindings;
|
||||
};
|
||||
|
||||
rdctype::array<DescriptorSet> DescSets;
|
||||
} compute, graphics;
|
||||
struct Pipeline
|
||||
{
|
||||
Pipeline() : flags(0) {}
|
||||
ResourceId obj;
|
||||
uint32_t flags;
|
||||
|
||||
struct InputAssembly
|
||||
rdctype::array<DescriptorSet> DescSets;
|
||||
};
|
||||
|
||||
struct IB
|
||||
{
|
||||
IB() : offs(0) {}
|
||||
ResourceId buf;
|
||||
uint64_t offs;
|
||||
};
|
||||
|
||||
struct InputAssembly
|
||||
{
|
||||
InputAssembly() : primitiveRestartEnable(false) {}
|
||||
bool32 primitiveRestartEnable;
|
||||
|
||||
IB ibuffer;
|
||||
};
|
||||
|
||||
struct VertexAttribute
|
||||
{
|
||||
VertexAttribute() : location(0), binding(0), format(), byteoffset(0) {}
|
||||
uint32_t location;
|
||||
uint32_t binding;
|
||||
ResourceFormat format;
|
||||
uint32_t byteoffset;
|
||||
};
|
||||
|
||||
struct VertexBinding
|
||||
{
|
||||
VertexBinding() : vbufferBinding(0), bytestride(0), perInstance(false) {}
|
||||
uint32_t vbufferBinding;
|
||||
uint32_t bytestride;
|
||||
bool32 perInstance;
|
||||
};
|
||||
|
||||
struct VB
|
||||
{
|
||||
VB() : offset(0) {}
|
||||
ResourceId buffer;
|
||||
uint64_t offset;
|
||||
};
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
rdctype::array<VertexAttribute> attrs;
|
||||
rdctype::array<VertexBinding> binds;
|
||||
rdctype::array<VB> vbuffers;
|
||||
};
|
||||
|
||||
struct SpecInfo
|
||||
{
|
||||
SpecInfo() : specID(0) {}
|
||||
uint32_t specID;
|
||||
rdctype::array<byte> data;
|
||||
};
|
||||
|
||||
struct Shader
|
||||
{
|
||||
Shader() : Object(), customName(false), ShaderDetails(NULL), stage(ShaderStage::Vertex) {}
|
||||
ResourceId Object;
|
||||
rdctype::str entryPoint;
|
||||
|
||||
rdctype::str ShaderName;
|
||||
bool32 customName;
|
||||
ShaderReflection *ShaderDetails;
|
||||
|
||||
// this is no longer dynamic, like GL, but it's also not trivial, like D3D11.
|
||||
// this contains the mapping between the shader objects in the reflection data
|
||||
// and the descriptor set and binding that they use
|
||||
ShaderBindpointMapping BindpointMapping;
|
||||
|
||||
ShaderStage stage;
|
||||
|
||||
rdctype::array<SpecInfo> specialization;
|
||||
};
|
||||
|
||||
struct Tessellation
|
||||
{
|
||||
Tessellation() : numControlPoints(0) {}
|
||||
uint32_t numControlPoints;
|
||||
};
|
||||
|
||||
struct Viewport
|
||||
{
|
||||
Viewport() : x(0), y(0), width(0), height(0), minDepth(0), maxDepth(0) {}
|
||||
float x, y, width, height, minDepth, maxDepth;
|
||||
};
|
||||
|
||||
struct Scissor
|
||||
{
|
||||
Scissor() : x(0), y(0), width(0), height(0) {}
|
||||
int32_t x, y, width, height;
|
||||
};
|
||||
|
||||
struct ViewportScissor
|
||||
{
|
||||
Viewport vp;
|
||||
Scissor scissor;
|
||||
};
|
||||
|
||||
struct ViewState
|
||||
{
|
||||
rdctype::array<ViewportScissor> viewportScissors;
|
||||
};
|
||||
|
||||
struct Raster
|
||||
{
|
||||
Raster()
|
||||
: depthClampEnable(false),
|
||||
rasterizerDiscardEnable(false),
|
||||
FrontCCW(false),
|
||||
fillMode(FillMode::Solid),
|
||||
cullMode(CullMode::NoCull),
|
||||
depthBias(0),
|
||||
depthBiasClamp(0),
|
||||
slopeScaledDepthBias(0),
|
||||
lineWidth(0)
|
||||
{
|
||||
InputAssembly() : primitiveRestartEnable(false) {}
|
||||
bool32 primitiveRestartEnable;
|
||||
}
|
||||
|
||||
struct IndexBuffer
|
||||
{
|
||||
IndexBuffer() : offs(0) {}
|
||||
ResourceId buf;
|
||||
uint64_t offs;
|
||||
} ibuffer;
|
||||
} IA;
|
||||
bool32 depthClampEnable, rasterizerDiscardEnable, FrontCCW;
|
||||
FillMode fillMode;
|
||||
CullMode cullMode;
|
||||
|
||||
struct VertexInput
|
||||
// dynamic
|
||||
float depthBias, depthBiasClamp, slopeScaledDepthBias, lineWidth;
|
||||
};
|
||||
|
||||
struct MultiSample
|
||||
{
|
||||
MultiSample() : rasterSamples(0), sampleShadingEnable(false), minSampleShading(0), sampleMask(~0U)
|
||||
{
|
||||
struct Attribute
|
||||
{
|
||||
Attribute() : location(0), binding(0), format(), byteoffset(0) {}
|
||||
uint32_t location;
|
||||
uint32_t binding;
|
||||
ResourceFormat format;
|
||||
uint32_t byteoffset;
|
||||
};
|
||||
rdctype::array<Attribute> attrs;
|
||||
}
|
||||
uint32_t rasterSamples;
|
||||
bool32 sampleShadingEnable;
|
||||
float minSampleShading;
|
||||
uint32_t sampleMask;
|
||||
};
|
||||
|
||||
struct Binding
|
||||
{
|
||||
Binding() : vbufferBinding(0), bytestride(0), perInstance(false) {}
|
||||
uint32_t vbufferBinding;
|
||||
uint32_t bytestride;
|
||||
bool32 perInstance;
|
||||
};
|
||||
rdctype::array<Binding> binds;
|
||||
struct BlendOp
|
||||
{
|
||||
rdctype::str Source;
|
||||
rdctype::str Destination;
|
||||
rdctype::str Operation;
|
||||
};
|
||||
|
||||
struct VertexBuffer
|
||||
{
|
||||
VertexBuffer() : offset(0) {}
|
||||
ResourceId buffer;
|
||||
uint64_t offset;
|
||||
};
|
||||
rdctype::array<VertexBuffer> vbuffers;
|
||||
} VI;
|
||||
struct Blend
|
||||
{
|
||||
Blend() : blendEnable(false), writeMask(0) {}
|
||||
bool32 blendEnable;
|
||||
|
||||
struct Shader
|
||||
BlendOp blend, alphaBlend;
|
||||
|
||||
uint8_t writeMask;
|
||||
};
|
||||
|
||||
struct ColorBlend
|
||||
{
|
||||
ColorBlend() : alphaToCoverageEnable(false), alphaToOneEnable(false), logicOpEnable(false)
|
||||
{
|
||||
Shader() : Object(), customName(false), ShaderDetails(NULL), stage(ShaderStage::Vertex) {}
|
||||
ResourceId Object;
|
||||
rdctype::str entryPoint;
|
||||
blendConst[0] = blendConst[1] = blendConst[2] = blendConst[3] = 0.0f;
|
||||
}
|
||||
|
||||
rdctype::str ShaderName;
|
||||
bool32 customName;
|
||||
ShaderReflection *ShaderDetails;
|
||||
bool32 alphaToCoverageEnable, alphaToOneEnable, logicOpEnable;
|
||||
rdctype::str logicOp;
|
||||
|
||||
// this is no longer dynamic, like GL, but it's also not trivial, like D3D11.
|
||||
// this contains the mapping between the shader objects in the reflection data
|
||||
// and the descriptor set and binding that they use
|
||||
ShaderBindpointMapping BindpointMapping;
|
||||
rdctype::array<Blend> attachments;
|
||||
|
||||
ShaderStage stage;
|
||||
// dynamic
|
||||
float blendConst[4];
|
||||
};
|
||||
|
||||
struct SpecInfo
|
||||
{
|
||||
SpecInfo() : specID(0) {}
|
||||
uint32_t specID;
|
||||
rdctype::array<byte> data;
|
||||
};
|
||||
rdctype::array<SpecInfo> specialization;
|
||||
} m_VS, m_TCS, m_TES, m_GS, m_FS, m_CS;
|
||||
struct StencilOp
|
||||
{
|
||||
StencilOp() : ref(0), compareMask(0xff), writeMask(0xff) {}
|
||||
rdctype::str failOp;
|
||||
rdctype::str depthFailOp;
|
||||
rdctype::str passOp;
|
||||
rdctype::str func;
|
||||
|
||||
struct Tessellation
|
||||
// dynamic
|
||||
uint32_t ref, compareMask, writeMask;
|
||||
};
|
||||
|
||||
struct DepthStencil
|
||||
{
|
||||
DepthStencil()
|
||||
: depthTestEnable(false),
|
||||
depthWriteEnable(false),
|
||||
depthBoundsEnable(false),
|
||||
stencilTestEnable(false),
|
||||
minDepthBounds(0),
|
||||
maxDepthBounds(0)
|
||||
{
|
||||
Tessellation() : numControlPoints(0) {}
|
||||
uint32_t numControlPoints;
|
||||
} Tess;
|
||||
}
|
||||
|
||||
struct ViewState
|
||||
bool32 depthTestEnable, depthWriteEnable, depthBoundsEnable;
|
||||
rdctype::str depthCompareOp;
|
||||
|
||||
bool32 stencilTestEnable;
|
||||
|
||||
StencilOp front, back;
|
||||
|
||||
// dynamic
|
||||
float minDepthBounds, maxDepthBounds;
|
||||
};
|
||||
|
||||
struct RenderPass
|
||||
{
|
||||
RenderPass() : depthstencilAttachment(-1) {}
|
||||
ResourceId obj;
|
||||
// VKTODOMED renderpass and subpass information here
|
||||
|
||||
rdctype::array<uint32_t> inputAttachments;
|
||||
rdctype::array<uint32_t> colorAttachments;
|
||||
int32_t depthstencilAttachment;
|
||||
};
|
||||
|
||||
struct Attachment
|
||||
{
|
||||
Attachment() : baseMip(0), baseLayer(0), numMip(1), numLayer(1)
|
||||
{
|
||||
struct ViewportScissor
|
||||
{
|
||||
struct Viewport
|
||||
{
|
||||
Viewport() : x(0), y(0), width(0), height(0), minDepth(0), maxDepth(0) {}
|
||||
float x, y, width, height, minDepth, maxDepth;
|
||||
} vp;
|
||||
swizzle[0] = TextureSwizzle::Red;
|
||||
swizzle[1] = TextureSwizzle::Green;
|
||||
swizzle[2] = TextureSwizzle::Blue;
|
||||
swizzle[3] = TextureSwizzle::Alpha;
|
||||
}
|
||||
ResourceId view;
|
||||
ResourceId img;
|
||||
|
||||
struct Scissor
|
||||
{
|
||||
Scissor() : x(0), y(0), width(0), height(0) {}
|
||||
int32_t x, y, width, height;
|
||||
} scissor;
|
||||
};
|
||||
ResourceFormat viewfmt;
|
||||
TextureSwizzle swizzle[4];
|
||||
uint32_t baseMip;
|
||||
uint32_t baseLayer;
|
||||
uint32_t numMip;
|
||||
uint32_t numLayer;
|
||||
};
|
||||
|
||||
rdctype::array<ViewportScissor> viewportScissors;
|
||||
} VP;
|
||||
struct Framebuffer
|
||||
{
|
||||
Framebuffer() : width(0), height(0), layers(0) {}
|
||||
ResourceId obj;
|
||||
|
||||
struct Raster
|
||||
{
|
||||
Raster()
|
||||
: depthClampEnable(false),
|
||||
rasterizerDiscardEnable(false),
|
||||
FrontCCW(false),
|
||||
fillMode(FillMode::Solid),
|
||||
cullMode(CullMode::NoCull),
|
||||
depthBias(0),
|
||||
depthBiasClamp(0),
|
||||
slopeScaledDepthBias(0),
|
||||
lineWidth(0)
|
||||
{
|
||||
}
|
||||
rdctype::array<Attachment> attachments;
|
||||
|
||||
bool32 depthClampEnable, rasterizerDiscardEnable, FrontCCW;
|
||||
FillMode fillMode;
|
||||
CullMode cullMode;
|
||||
uint32_t width, height, layers;
|
||||
};
|
||||
|
||||
// dynamic
|
||||
float depthBias, depthBiasClamp, slopeScaledDepthBias, lineWidth;
|
||||
} RS;
|
||||
struct RenderArea
|
||||
{
|
||||
RenderArea() : x(0), y(0), width(0), height(0) {}
|
||||
int32_t x, y, width, height;
|
||||
};
|
||||
|
||||
struct MultiSample
|
||||
{
|
||||
MultiSample()
|
||||
: rasterSamples(0), sampleShadingEnable(false), minSampleShading(0), sampleMask(~0U)
|
||||
{
|
||||
}
|
||||
uint32_t rasterSamples;
|
||||
bool32 sampleShadingEnable;
|
||||
float minSampleShading;
|
||||
uint32_t sampleMask;
|
||||
} MSAA;
|
||||
struct CurrentPass
|
||||
{
|
||||
RenderPass renderpass;
|
||||
Framebuffer framebuffer;
|
||||
RenderArea renderArea;
|
||||
};
|
||||
|
||||
struct ColorBlend
|
||||
{
|
||||
ColorBlend() : alphaToCoverageEnable(false), alphaToOneEnable(false), logicOpEnable(false)
|
||||
{
|
||||
blendConst[0] = blendConst[1] = blendConst[2] = blendConst[3] = 0.0f;
|
||||
}
|
||||
struct ImageLayout
|
||||
{
|
||||
uint32_t baseMip;
|
||||
uint32_t baseLayer;
|
||||
uint32_t numMip;
|
||||
uint32_t numLayer;
|
||||
rdctype::str name;
|
||||
};
|
||||
|
||||
bool32 alphaToCoverageEnable, alphaToOneEnable, logicOpEnable;
|
||||
rdctype::str logicOp;
|
||||
struct ImageData
|
||||
{
|
||||
ResourceId image;
|
||||
|
||||
struct Attachment
|
||||
{
|
||||
Attachment() : blendEnable(false), writeMask(0) {}
|
||||
bool32 blendEnable;
|
||||
rdctype::array<ImageLayout> layouts;
|
||||
};
|
||||
|
||||
struct BlendOp
|
||||
{
|
||||
rdctype::str Source;
|
||||
rdctype::str Destination;
|
||||
rdctype::str Operation;
|
||||
} blend, alphaBlend;
|
||||
struct State
|
||||
{
|
||||
Pipeline compute, graphics;
|
||||
|
||||
uint8_t writeMask;
|
||||
};
|
||||
rdctype::array<Attachment> attachments;
|
||||
InputAssembly IA;
|
||||
VertexInput VI;
|
||||
|
||||
// dynamic
|
||||
float blendConst[4];
|
||||
} CB;
|
||||
Shader m_VS, m_TCS, m_TES, m_GS, m_FS, m_CS;
|
||||
|
||||
struct DepthStencil
|
||||
{
|
||||
DepthStencil()
|
||||
: depthTestEnable(false),
|
||||
depthWriteEnable(false),
|
||||
depthBoundsEnable(false),
|
||||
stencilTestEnable(false),
|
||||
minDepthBounds(0),
|
||||
maxDepthBounds(0)
|
||||
{
|
||||
}
|
||||
Tessellation Tess;
|
||||
|
||||
bool32 depthTestEnable, depthWriteEnable, depthBoundsEnable;
|
||||
rdctype::str depthCompareOp;
|
||||
ViewState VP;
|
||||
Raster RS;
|
||||
|
||||
bool32 stencilTestEnable;
|
||||
struct StencilOp
|
||||
{
|
||||
StencilOp() : ref(0), compareMask(0xff), writeMask(0xff) {}
|
||||
rdctype::str failOp;
|
||||
rdctype::str depthFailOp;
|
||||
rdctype::str passOp;
|
||||
rdctype::str func;
|
||||
MultiSample MSAA;
|
||||
ColorBlend CB;
|
||||
DepthStencil DS;
|
||||
|
||||
// dynamic
|
||||
uint32_t ref, compareMask, writeMask;
|
||||
} front, back;
|
||||
CurrentPass Pass;
|
||||
|
||||
// dynamic
|
||||
float minDepthBounds, maxDepthBounds;
|
||||
} DS;
|
||||
|
||||
struct CurrentPass
|
||||
{
|
||||
struct RenderPass
|
||||
{
|
||||
RenderPass() : depthstencilAttachment(-1) {}
|
||||
ResourceId obj;
|
||||
// VKTODOMED renderpass and subpass information here
|
||||
|
||||
rdctype::array<uint32_t> inputAttachments;
|
||||
rdctype::array<uint32_t> colorAttachments;
|
||||
int32_t depthstencilAttachment;
|
||||
} renderpass;
|
||||
|
||||
struct Framebuffer
|
||||
{
|
||||
Framebuffer() : width(0), height(0), layers(0) {}
|
||||
ResourceId obj;
|
||||
|
||||
struct Attachment
|
||||
{
|
||||
Attachment() : baseMip(0), baseLayer(0), numMip(1), numLayer(1)
|
||||
{
|
||||
swizzle[0] = TextureSwizzle::Red;
|
||||
swizzle[1] = TextureSwizzle::Green;
|
||||
swizzle[2] = TextureSwizzle::Blue;
|
||||
swizzle[3] = TextureSwizzle::Alpha;
|
||||
}
|
||||
ResourceId view;
|
||||
ResourceId img;
|
||||
|
||||
ResourceFormat viewfmt;
|
||||
TextureSwizzle swizzle[4];
|
||||
uint32_t baseMip;
|
||||
uint32_t baseLayer;
|
||||
uint32_t numMip;
|
||||
uint32_t numLayer;
|
||||
};
|
||||
rdctype::array<Attachment> attachments;
|
||||
|
||||
uint32_t width, height, layers;
|
||||
} framebuffer;
|
||||
|
||||
struct RenderArea
|
||||
{
|
||||
RenderArea() : x(0), y(0), width(0), height(0) {}
|
||||
int32_t x, y, width, height;
|
||||
} renderArea;
|
||||
} Pass;
|
||||
|
||||
struct ImageData
|
||||
{
|
||||
ResourceId image;
|
||||
|
||||
struct ImageLayout
|
||||
{
|
||||
uint32_t baseMip;
|
||||
uint32_t baseLayer;
|
||||
uint32_t numMip;
|
||||
uint32_t numLayer;
|
||||
rdctype::str name;
|
||||
};
|
||||
rdctype::array<ImageLayout> layouts;
|
||||
};
|
||||
rdctype::array<ImageData> images;
|
||||
};
|
||||
|
||||
}; // namespace VKPipe
|
||||
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
void SavePipelineState() {}
|
||||
D3D12PipelineState GetD3D12PipelineState() { return D3D12PipelineState(); }
|
||||
GLPipe::State GetGLPipelineState() { return GLPipe::State(); }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return VulkanPipelineState(); }
|
||||
VKPipe::State GetVulkanPipelineState() { return VKPipe::State(); }
|
||||
void ReplayLog(uint32_t endEventID, ReplayLogType replayType) {}
|
||||
vector<uint32_t> GetPassEvents(uint32_t eventID) { return vector<uint32_t>(); }
|
||||
vector<EventUsage> GetUsage(ResourceId id) { return vector<EventUsage>(); }
|
||||
|
||||
@@ -972,9 +972,7 @@ void Serialiser::Serialise(const char *name, GLPipe::State &el)
|
||||
#pragma region Vulkan pipeline state
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(
|
||||
const char *name,
|
||||
VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::BindingElement &el)
|
||||
{
|
||||
Serialise("", el.view);
|
||||
Serialise("", el.res);
|
||||
@@ -1014,8 +1012,7 @@ void Serialiser::Serialise(
|
||||
};
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name,
|
||||
VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::DescriptorBinding &el)
|
||||
{
|
||||
Serialise("", el.descriptorCount);
|
||||
Serialise("", el.type);
|
||||
@@ -1027,7 +1024,7 @@ void Serialiser::Serialise(const char *name,
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::Pipeline::DescriptorSet &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::DescriptorSet &el)
|
||||
{
|
||||
Serialise("", el.layout);
|
||||
Serialise("", el.descset);
|
||||
@@ -1038,7 +1035,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::Pipeline::Desc
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::Pipeline &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::Pipeline &el)
|
||||
{
|
||||
Serialise("", el.obj);
|
||||
Serialise("", el.flags);
|
||||
@@ -1049,7 +1046,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::Pipeline &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::VertexInput::Attribute &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::VertexAttribute &el)
|
||||
{
|
||||
Serialise("", el.location);
|
||||
Serialise("", el.binding);
|
||||
@@ -1060,7 +1057,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::VertexInput::A
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::VertexInput &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::VertexInput &el)
|
||||
{
|
||||
Serialise("", el.attrs);
|
||||
Serialise("", el.binds);
|
||||
@@ -1070,7 +1067,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::VertexInput &e
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::Shader::SpecInfo &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::SpecInfo &el)
|
||||
{
|
||||
Serialise("", el.specID);
|
||||
Serialise("", el.data);
|
||||
@@ -1079,7 +1076,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::Shader::SpecIn
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::Shader &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::Shader &el)
|
||||
{
|
||||
Serialise("", el.Object);
|
||||
Serialise("", el.entryPoint);
|
||||
@@ -1098,7 +1095,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::Shader &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::ViewState &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::ViewState &el)
|
||||
{
|
||||
Serialise("", el.viewportScissors);
|
||||
|
||||
@@ -1106,7 +1103,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::ViewState &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::ColorBlend::Attachment &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::Blend &el)
|
||||
{
|
||||
Serialise("", el.blendEnable);
|
||||
|
||||
@@ -1124,7 +1121,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::ColorBlend::At
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::ColorBlend &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::ColorBlend &el)
|
||||
{
|
||||
Serialise("", el.alphaToCoverageEnable);
|
||||
Serialise("", el.alphaToOneEnable);
|
||||
@@ -1139,8 +1136,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::ColorBlend &el
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name,
|
||||
VulkanPipelineState::CurrentPass::Framebuffer::Attachment &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::Attachment &el)
|
||||
{
|
||||
Serialise("", el.view);
|
||||
Serialise("", el.img);
|
||||
@@ -1157,7 +1153,7 @@ void Serialiser::Serialise(const char *name,
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::DepthStencil &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::DepthStencil &el)
|
||||
{
|
||||
Serialise("", el.depthTestEnable);
|
||||
Serialise("", el.depthWriteEnable);
|
||||
@@ -1189,7 +1185,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::DepthStencil &
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::CurrentPass &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::CurrentPass &el)
|
||||
{
|
||||
Serialise("", el.renderpass.obj);
|
||||
Serialise("", el.renderpass.inputAttachments);
|
||||
@@ -1208,7 +1204,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::CurrentPass &e
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::ImageData::ImageLayout &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::ImageLayout &el)
|
||||
{
|
||||
Serialise("", el.baseMip);
|
||||
Serialise("", el.baseLayer);
|
||||
@@ -1220,7 +1216,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::ImageData::Ima
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState::ImageData &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::ImageData &el)
|
||||
{
|
||||
Serialise("", el.image);
|
||||
Serialise("", el.layouts);
|
||||
@@ -1229,7 +1225,7 @@ void Serialiser::Serialise(const char *name, VulkanPipelineState::ImageData &el)
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, VulkanPipelineState &el)
|
||||
void Serialiser::Serialise(const char *name, VKPipe::State &el)
|
||||
{
|
||||
Serialise("", el.compute);
|
||||
Serialise("", el.graphics);
|
||||
@@ -1883,55 +1879,47 @@ string ToStrHelper<false, GLPipe::Hints>::Get(const GLPipe::Hints &el)
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, VulkanPipelineState::CurrentPass::RenderArea>::Get(
|
||||
const VulkanPipelineState::CurrentPass::RenderArea &el)
|
||||
string ToStrHelper<false, VKPipe::RenderArea>::Get(const VKPipe::RenderArea &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, VulkanPipelineState::InputAssembly>::Get(
|
||||
const VulkanPipelineState::InputAssembly &el)
|
||||
string ToStrHelper<false, VKPipe::InputAssembly>::Get(const VKPipe::InputAssembly &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, VulkanPipelineState::Tessellation>::Get(
|
||||
const VulkanPipelineState::Tessellation &el)
|
||||
string ToStrHelper<false, VKPipe::Tessellation>::Get(const VKPipe::Tessellation &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, VulkanPipelineState::Raster>::Get(const VulkanPipelineState::Raster &el)
|
||||
string ToStrHelper<false, VKPipe::Raster>::Get(const VKPipe::Raster &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, VulkanPipelineState::MultiSample>::Get(
|
||||
const VulkanPipelineState::MultiSample &el)
|
||||
string ToStrHelper<false, VKPipe::MultiSample>::Get(const VKPipe::MultiSample &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement>::Get(
|
||||
const VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement &el)
|
||||
string ToStrHelper<false, VKPipe::BindingElement>::Get(const VKPipe::BindingElement &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, VulkanPipelineState::VertexInput::Binding>::Get(
|
||||
const VulkanPipelineState::VertexInput::Binding &el)
|
||||
string ToStrHelper<false, VKPipe::VertexBinding>::Get(const VKPipe::VertexBinding &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, VulkanPipelineState::VertexInput::VertexBuffer>::Get(
|
||||
const VulkanPipelineState::VertexInput::VertexBuffer &el)
|
||||
string ToStrHelper<false, VKPipe::VB>::Get(const VKPipe::VB &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
template <>
|
||||
string ToStrHelper<false, VulkanPipelineState::ViewState::ViewportScissor>::Get(
|
||||
const VulkanPipelineState::ViewState::ViewportScissor &el)
|
||||
string ToStrHelper<false, VKPipe::ViewportScissor>::Get(const VKPipe::ViewportScissor &el)
|
||||
{
|
||||
return "<...>";
|
||||
}
|
||||
@@ -2390,7 +2378,7 @@ void ReplayProxy::SavePipelineState()
|
||||
m_D3D11PipelineState = D3D11Pipe::State();
|
||||
m_D3D12PipelineState = D3D12PipelineState();
|
||||
m_GLPipelineState = GLPipe::State();
|
||||
m_VulkanPipelineState = VulkanPipelineState();
|
||||
m_VulkanPipelineState = VKPipe::State();
|
||||
}
|
||||
|
||||
m_FromReplaySerialiser->Serialise("", m_D3D11PipelineState);
|
||||
|
||||
@@ -400,7 +400,7 @@ public:
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return m_D3D11PipelineState; }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return m_D3D12PipelineState; }
|
||||
GLPipe::State GetGLPipelineState() { return m_GLPipelineState; }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return m_VulkanPipelineState; }
|
||||
VKPipe::State GetVulkanPipelineState() { return m_VulkanPipelineState; }
|
||||
void ReplayLog(uint32_t endEventID, ReplayLogType replayType);
|
||||
|
||||
vector<uint32_t> GetPassEvents(uint32_t eventID);
|
||||
@@ -554,5 +554,5 @@ private:
|
||||
D3D11Pipe::State m_D3D11PipelineState;
|
||||
D3D12PipelineState m_D3D12PipelineState;
|
||||
GLPipe::State m_GLPipelineState;
|
||||
VulkanPipelineState m_VulkanPipelineState;
|
||||
VKPipe::State m_VulkanPipelineState;
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return m_CurPipelineState; }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return D3D12PipelineState(); }
|
||||
GLPipe::State GetGLPipelineState() { return GLPipe::State(); }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return VulkanPipelineState(); }
|
||||
VKPipe::State GetVulkanPipelineState() { return VKPipe::State(); }
|
||||
void FreeTargetResource(ResourceId id);
|
||||
void FreeCustomShader(ResourceId id);
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return D3D11Pipe::State(); }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return m_PipelineState; }
|
||||
GLPipe::State GetGLPipelineState() { return GLPipe::State(); }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return VulkanPipelineState(); }
|
||||
VKPipe::State GetVulkanPipelineState() { return VKPipe::State(); }
|
||||
void FreeTargetResource(ResourceId id);
|
||||
void FreeCustomShader(ResourceId id);
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return D3D11Pipe::State(); }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return D3D12PipelineState(); }
|
||||
GLPipe::State GetGLPipelineState() { return m_CurPipelineState; }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return VulkanPipelineState(); }
|
||||
VKPipe::State GetVulkanPipelineState() { return VKPipe::State(); }
|
||||
void FreeTargetResource(ResourceId id);
|
||||
|
||||
void ReadLogInitialisation();
|
||||
|
||||
@@ -3167,7 +3167,7 @@ void VulkanReplay::SavePipelineState()
|
||||
|
||||
VulkanResourceManager *rm = m_pDriver->GetResourceManager();
|
||||
|
||||
m_VulkanPipelineState = VulkanPipelineState();
|
||||
m_VulkanPipelineState = VKPipe::State();
|
||||
|
||||
// General pipeline properties
|
||||
m_VulkanPipelineState.compute.obj = rm->GetOriginalID(state.compute.pipeline);
|
||||
@@ -3179,7 +3179,7 @@ void VulkanReplay::SavePipelineState()
|
||||
|
||||
m_VulkanPipelineState.compute.flags = p.flags;
|
||||
|
||||
VulkanPipelineState::Shader &stage = m_VulkanPipelineState.m_CS;
|
||||
VKPipe::Shader &stage = m_VulkanPipelineState.m_CS;
|
||||
|
||||
int i = 5; // 5 is the CS idx (VS, TCS, TES, GS, FS, CS)
|
||||
{
|
||||
@@ -3246,7 +3246,7 @@ void VulkanReplay::SavePipelineState()
|
||||
}
|
||||
|
||||
// Shader Stages
|
||||
VulkanPipelineState::Shader *stages[] = {
|
||||
VKPipe::Shader *stages[] = {
|
||||
&m_VulkanPipelineState.m_VS, &m_VulkanPipelineState.m_TCS, &m_VulkanPipelineState.m_TES,
|
||||
&m_VulkanPipelineState.m_GS, &m_VulkanPipelineState.m_FS,
|
||||
};
|
||||
@@ -3492,7 +3492,7 @@ void VulkanReplay::SavePipelineState()
|
||||
create_array_uninit(m_VulkanPipelineState.compute.DescSets, state.compute.descSets.size());
|
||||
|
||||
{
|
||||
rdctype::array<VulkanPipelineState::Pipeline::DescriptorSet> *dsts[] = {
|
||||
rdctype::array<VKPipe::DescriptorSet> *dsts[] = {
|
||||
&m_VulkanPipelineState.graphics.DescSets, &m_VulkanPipelineState.compute.DescSets,
|
||||
};
|
||||
|
||||
@@ -3505,7 +3505,7 @@ void VulkanReplay::SavePipelineState()
|
||||
for(size_t i = 0; i < srcs[p]->size(); i++)
|
||||
{
|
||||
ResourceId src = (*srcs[p])[i].descSet;
|
||||
VulkanPipelineState::Pipeline::DescriptorSet &dst = (*dsts[p])[i];
|
||||
VKPipe::DescriptorSet &dst = (*dsts[p])[i];
|
||||
|
||||
ResourceId layoutId = m_pDriver->m_DescriptorSetState[src].layout;
|
||||
|
||||
@@ -3581,8 +3581,7 @@ void VulkanReplay::SavePipelineState()
|
||||
|
||||
if(dst.bindings[b].binds[a].sampler != ResourceId())
|
||||
{
|
||||
VulkanPipelineState::Pipeline::DescriptorSet::DescriptorBinding::BindingElement &el =
|
||||
dst.bindings[b].binds[a];
|
||||
VKPipe::BindingElement &el = dst.bindings[b].binds[a];
|
||||
const VulkanCreationInfo::Sampler &sampl = c.m_Sampler[el.sampler];
|
||||
|
||||
ResourceId liveId = el.sampler;
|
||||
@@ -3731,7 +3730,7 @@ void VulkanReplay::SavePipelineState()
|
||||
size_t i = 0;
|
||||
for(auto it = m_pDriver->m_ImageLayouts.begin(); it != m_pDriver->m_ImageLayouts.end(); ++it)
|
||||
{
|
||||
VulkanPipelineState::ImageData &img = m_VulkanPipelineState.images[i];
|
||||
VKPipe::ImageData &img = m_VulkanPipelineState.images[i];
|
||||
|
||||
img.image = rm->GetOriginalID(it->first);
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
D3D11Pipe::State GetD3D11PipelineState() { return D3D11Pipe::State(); }
|
||||
D3D12PipelineState GetD3D12PipelineState() { return D3D12PipelineState(); }
|
||||
GLPipe::State GetGLPipelineState() { return GLPipe::State(); }
|
||||
VulkanPipelineState GetVulkanPipelineState() { return m_VulkanPipelineState; }
|
||||
VKPipe::State GetVulkanPipelineState() { return m_VulkanPipelineState; }
|
||||
void FreeTargetResource(ResourceId id);
|
||||
|
||||
void ReadLogInitialisation();
|
||||
@@ -315,7 +315,7 @@ private:
|
||||
VulkanResourceManager *m_ResourceManager;
|
||||
};
|
||||
|
||||
VulkanPipelineState m_VulkanPipelineState;
|
||||
VKPipe::State m_VulkanPipelineState;
|
||||
|
||||
map<uint64_t, OutputWindow> m_OutputWindows;
|
||||
uint64_t m_OutputWinID;
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
virtual D3D11Pipe::State GetD3D11PipelineState() = 0;
|
||||
virtual D3D12PipelineState GetD3D12PipelineState() = 0;
|
||||
virtual GLPipe::State GetGLPipelineState() = 0;
|
||||
virtual VulkanPipelineState GetVulkanPipelineState() = 0;
|
||||
virtual VKPipe::State GetVulkanPipelineState() = 0;
|
||||
|
||||
virtual FetchFrameRecord GetFrameRecord() = 0;
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ bool ReplayRenderer::GetGLPipelineState(GLPipe::State *state)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ReplayRenderer::GetVulkanPipelineState(VulkanPipelineState *state)
|
||||
bool ReplayRenderer::GetVulkanPipelineState(VKPipe::State *state)
|
||||
{
|
||||
if(state)
|
||||
{
|
||||
@@ -1658,7 +1658,7 @@ void ReplayRenderer::FetchPipelineState()
|
||||
}
|
||||
|
||||
{
|
||||
VulkanPipelineState::Shader *stages[] = {
|
||||
VKPipe::Shader *stages[] = {
|
||||
&m_VulkanPipelineState.m_VS, &m_VulkanPipelineState.m_TCS, &m_VulkanPipelineState.m_TES,
|
||||
&m_VulkanPipelineState.m_GS, &m_VulkanPipelineState.m_FS, &m_VulkanPipelineState.m_CS,
|
||||
};
|
||||
@@ -1734,7 +1734,7 @@ extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetGLPipelineState(I
|
||||
return rend->GetGLPipelineState(state);
|
||||
}
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC
|
||||
ReplayRenderer_GetVulkanPipelineState(IReplayRenderer *rend, VulkanPipelineState *state)
|
||||
ReplayRenderer_GetVulkanPipelineState(IReplayRenderer *rend, VKPipe::State *state)
|
||||
{
|
||||
return rend->GetVulkanPipelineState(state);
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
bool GetD3D11PipelineState(D3D11Pipe::State *state);
|
||||
bool GetD3D12PipelineState(D3D12PipelineState *state);
|
||||
bool GetGLPipelineState(GLPipe::State *state);
|
||||
bool GetVulkanPipelineState(VulkanPipelineState *state);
|
||||
bool GetVulkanPipelineState(VKPipe::State *state);
|
||||
|
||||
ResourceId BuildCustomShader(const char *entry, const char *source, const uint32_t compileFlags,
|
||||
ShaderStage type, rdctype::str *errors);
|
||||
@@ -212,7 +212,7 @@ private:
|
||||
D3D11Pipe::State m_D3D11PipelineState;
|
||||
D3D12PipelineState m_D3D12PipelineState;
|
||||
GLPipe::State m_GLPipelineState;
|
||||
VulkanPipelineState m_VulkanPipelineState;
|
||||
VKPipe::State m_VulkanPipelineState;
|
||||
|
||||
std::vector<ReplayOutput *> m_Outputs;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user