Remove old shader bindpoint mapping handling entirely

This commit is contained in:
baldurk
2024-04-10 18:58:52 +01:00
parent acc533ec60
commit 205ed0e6fa
53 changed files with 879 additions and 6343 deletions
-3
View File
@@ -171,7 +171,6 @@ fail:
DEFINE_SAFE_EQUALITY(ActionDescription)
DEFINE_SAFE_EQUALITY(CounterResult)
DEFINE_SAFE_EQUALITY(APIEvent)
DEFINE_SAFE_EQUALITY(Bindpoint)
DEFINE_SAFE_EQUALITY(BufferDescription)
DEFINE_SAFE_EQUALITY(CaptureFileFormat)
DEFINE_SAFE_EQUALITY(ConstantBlock)
@@ -200,5 +199,3 @@ DEFINE_SAFE_EQUALITY(Scissor)
DEFINE_SAFE_EQUALITY(ColorBlend)
DEFINE_SAFE_EQUALITY(BoundVBuffer)
DEFINE_SAFE_EQUALITY(VertexInputAttribute)
DEFINE_SAFE_EQUALITY(BoundResource)
DEFINE_SAFE_EQUALITY(BoundResourceArray)
-14
View File
@@ -365,7 +365,6 @@ TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ActionDescription)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, GPUCounter)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, CounterResult)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, APIEvent)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, Bindpoint)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BufferDescription)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, CaptureFileFormat)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ConstantBlock)
@@ -402,8 +401,6 @@ TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ColorBlend)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BoundVBuffer)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, Offset)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, VertexInputAttribute)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BoundResource)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BoundResourceArray)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, FloatVector)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, GraphicsAPI)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, GPUDevice)
@@ -419,8 +416,6 @@ TEMPLATE_ARRAY_INSTANTIATE(rdcarray, DescriptorAccess)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, DescriptorLogicalLocation)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, UsedDescriptor)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, Attachment)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, BindingElement)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, DescriptorBinding)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, DynamicOffset)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, DescriptorSet)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, ImageData)
@@ -431,26 +426,17 @@ TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, VertexBuffer)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, VertexAttribute)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, VertexBinding)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, VKPipe, ViewportScissor)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, ConstantBuffer)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, Layout)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, Sampler)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, StreamOutBind)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, VertexBuffer)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D11Pipe, View)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, ConstantBuffer)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, Layout)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, ResourceData)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, ResourceState)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, RootSignatureRange)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, Sampler)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, StreamOutBind)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, VertexBuffer)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, View)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Attachment)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Buffer)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, ImageLoadStore)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Sampler)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, Texture)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, VertexBuffer)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, VertexAttribute)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, TextureCompleteness)
+1 -1
View File
@@ -3315,7 +3315,7 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
// update with the current cbuffer for the current slot
if(IsCBufferView())
{
UsedDescriptor cb = m_Ctx.CurPipelineState().GetConstantBlockDescriptor(
UsedDescriptor cb = m_Ctx.CurPipelineState().GetConstantBlock(
m_CBufferSlot.stage, m_CBufferSlot.slot, m_CBufferSlot.arrayIdx);
m_BufferID = cb.descriptor.resource;
m_ByteOffset = cb.descriptor.byteOffset;
@@ -1602,7 +1602,7 @@ void D3D11PipelineStateViewer::setState()
ui->targetOutputs,
};
rdcarray<Descriptor> outputs = m_Ctx.CurPipelineState().GetOutputTargetDescriptors();
rdcarray<Descriptor> outputs = m_Ctx.CurPipelineState().GetOutputTargets();
for(uint32_t i = 0; i < outputs.size(); i++)
{
addResourceRow(D3D11ViewTag(D3D11ViewTag::OMTarget, i, outputs[i]), NULL, NULL,
@@ -1779,9 +1779,8 @@ void D3D11PipelineStateViewer::setState()
}
}
addResourceRow(
D3D11ViewTag(D3D11ViewTag::OMDepth, 0, m_Ctx.CurPipelineState().GetDepthTargetDescriptor()),
NULL, NULL, ui->targetOutputs);
addResourceRow(D3D11ViewTag(D3D11ViewTag::OMDepth, 0, m_Ctx.CurPipelineState().GetDepthTarget()),
NULL, NULL, ui->targetOutputs);
ui->vsClasses->parentWidget()->setVisible(ui->vsClasses->topLevelItemCount() > 0);
ui->hsClasses->parentWidget()->setVisible(ui->hsClasses->topLevelItemCount() > 0);
@@ -2822,8 +2821,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe
QList<QVariantList> rows;
const rdcarray<UsedDescriptor> &samplers =
m_Ctx.CurPipelineState().GetSamplerDescriptors(sh.stage);
const rdcarray<UsedDescriptor> &samplers = m_Ctx.CurPipelineState().GetSamplers(sh.stage);
for(int i = 0; i < samplers.count(); i++)
{
@@ -2895,8 +2893,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe
QList<QVariantList> rows;
const rdcarray<UsedDescriptor> &cblocks =
m_Ctx.CurPipelineState().GetConstantBlockDescriptors(sh.stage);
const rdcarray<UsedDescriptor> &cblocks = m_Ctx.CurPipelineState().GetConstantBlocks(sh.stage);
for(int i = 0; i < cblocks.count(); i++)
{
@@ -3188,7 +3185,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe
QList<QVariantList> rows;
rdcarray<Descriptor> rts = m_Ctx.CurPipelineState().GetOutputTargetDescriptors();
rdcarray<Descriptor> rts = m_Ctx.CurPipelineState().GetOutputTargets();
for(int i = 0; i < rts.count(); i++)
{
if(rts[i].view == ResourceId())
@@ -3280,8 +3277,7 @@ void D3D11PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D11Pipe
else if(om.stencilReadOnly)
extra = tr("Stencil Read-Only");
rows.push_back(
exportViewHTML(m_Ctx.CurPipelineState().GetDepthTargetDescriptor(), 0, NULL, extra));
rows.push_back(exportViewHTML(m_Ctx.CurPipelineState().GetDepthTarget(), 0, NULL, extra));
m_Common.exportHTMLTable(xml,
{
@@ -587,7 +587,7 @@ ResourceId D3D12PipelineStateViewer::GetResource(RDTreeWidgetItem *item)
return cb.descriptor.resource;
return m_Ctx.CurPipelineState()
.GetConstantBlockDescriptor(stage->stage, cb.index, cb.arrayElement)
.GetConstantBlock(stage->stage, cb.index, cb.arrayElement)
.descriptor.resource;
}
@@ -2011,7 +2011,7 @@ void D3D12PipelineStateViewer::setState()
ui->targetOutputs->beginUpdate();
ui->targetOutputs->clear();
{
rdcarray<Descriptor> rts = m_Ctx.CurPipelineState().GetOutputTargetDescriptors();
rdcarray<Descriptor> rts = m_Ctx.CurPipelineState().GetOutputTargets();
for(uint32_t i = 0; i < rts.size(); i++)
{
DescriptorAccess access;
@@ -2023,7 +2023,7 @@ void D3D12PipelineStateViewer::setState()
targets[i] = true;
}
Descriptor depth = m_Ctx.CurPipelineState().GetDepthTargetDescriptor();
Descriptor depth = m_Ctx.CurPipelineState().GetDepthTarget();
addResourceRow(D3D12ViewTag(D3D12ViewTag::OMDepth, DescriptorAccess(), depth), NULL, false,
ui->targetOutputs);
}
@@ -2838,7 +2838,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe
QList<QVariantList> rowsSampler;
QList<QVariantList> rowsCB;
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetConstantBlockDescriptors(sh.stage))
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetConstantBlocks(sh.stage))
{
if(used.access.stage != sh.stage)
continue;
@@ -2886,7 +2886,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe
rowsCB.push_back({regname, name, (qulonglong)offset, (qulonglong)length, numvars});
}
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetSamplerDescriptors(sh.stage))
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetSamplers(sh.stage))
{
if(used.access.stage != sh.stage)
continue;
@@ -2990,7 +2990,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe
}
}
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetReadOnlyDescriptors(sh.stage))
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetReadOnlyResources(sh.stage))
{
if(used.access.stage != sh.stage)
continue;
@@ -3005,7 +3005,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe
rowsRO.push_back(row);
}
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetReadWriteDescriptors(sh.stage))
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetReadWriteResources(sh.stage))
{
if(used.access.stage != sh.stage)
continue;
@@ -3324,7 +3324,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe
QList<QVariantList> rows;
rdcarray<Descriptor> rts = m_Ctx.CurPipelineState().GetOutputTargetDescriptors();
rdcarray<Descriptor> rts = m_Ctx.CurPipelineState().GetOutputTargets();
for(uint32_t i = 0; i < rts.size(); i++)
{
if(rts[i].resource == ResourceId())
@@ -3367,7 +3367,7 @@ void D3D12PipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const D3D12Pipe
else if(om.stencilReadOnly)
extra = tr("Stencil Read-Only");
Descriptor depth = m_Ctx.CurPipelineState().GetDepthTargetDescriptor();
Descriptor depth = m_Ctx.CurPipelineState().GetDepthTarget();
m_Common.exportHTMLTable(xml,
{
@@ -549,7 +549,7 @@ ResourceId GLPipelineStateViewer::GetResource(RDTreeWidgetItem *item)
int cb = tag.value<int>();
return m_Ctx.CurPipelineState().GetConstantBlockDescriptor(stage->stage, cb, 0).descriptor.resource;
return m_Ctx.CurPipelineState().GetConstantBlock(stage->stage, cb, 0).descriptor.resource;
}
return ResourceId();
@@ -566,7 +566,7 @@ ResourceId VulkanPipelineStateViewer::GetResource(RDTreeWidgetItem *item)
return cb.descriptor.resource;
return m_Ctx.CurPipelineState()
.GetConstantBlockDescriptor(stage->stage, cb.index, cb.arrayElement)
.GetConstantBlock(stage->stage, cb.index, cb.arrayElement)
.descriptor.resource;
}
@@ -3394,7 +3394,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::
QList<QVariantList> rwRows;
QList<QVariantList> sampRows;
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetConstantBlockDescriptors(sh.stage))
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetConstantBlocks(sh.stage))
{
if(used.access.stage != sh.stage)
continue;
@@ -3483,7 +3483,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::
{slotname, name, (qulonglong)byteOffset, (qulonglong)length, numvars, bindByteSize});
}
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetReadOnlyDescriptors(sh.stage))
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetReadOnlyResources(sh.stage))
{
if(used.access.stage != sh.stage)
continue;
@@ -3506,7 +3506,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::
exportDescriptorHTML(used, sh.reflection, descriptor, dynamicOffset, roRows);
}
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetReadWriteDescriptors(sh.stage))
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetReadWriteResources(sh.stage))
{
if(used.access.stage != sh.stage)
continue;
@@ -3529,7 +3529,7 @@ void VulkanPipelineStateViewer::exportHTML(QXmlStreamWriter &xml, const VKPipe::
exportDescriptorHTML(used, sh.reflection, descriptor, dynamicOffset, rwRows);
}
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetSamplerDescriptors(sh.stage))
for(const UsedDescriptor &used : m_Ctx.CurPipelineState().GetSamplers(sh.stage))
{
if(used.access.stage != sh.stage)
continue;
+4 -4
View File
@@ -187,9 +187,9 @@ ShaderMessageViewer::ShaderMessageViewer(ICaptureContext &ctx, ShaderStageMask s
// only display sample information if one of the targets is multisampled
m_Multisampled = false;
rdcarray<Descriptor> outs = pipe.GetOutputTargetDescriptors();
outs.push_back(pipe.GetDepthTargetDescriptor());
outs.push_back(pipe.GetDepthResolveTargetDescriptor());
rdcarray<Descriptor> outs = pipe.GetOutputTargets();
outs.push_back(pipe.GetDepthTarget());
outs.push_back(pipe.GetDepthResolveTarget());
for(const Descriptor &o : outs)
{
if(o.resource == ResourceId())
@@ -498,7 +498,7 @@ ShaderMessageViewer::ShaderMessageViewer(ICaptureContext &ctx, ShaderStageMask s
// select an actual output. Prefer the first colour output, but if there's no colour output
// pick depth.
rdcarray<Descriptor> cols = m_Ctx.CurPipelineState().GetOutputTargetDescriptors();
rdcarray<Descriptor> cols = m_Ctx.CurPipelineState().GetOutputTargets();
bool hascol = false;
for(size_t i = 0; i < cols.size(); i++)
hascol |= cols[i].resource != ResourceId();
+5 -5
View File
@@ -387,8 +387,8 @@ void ShaderViewer::editShader(ResourceId id, ShaderStage stage, const QString &e
void ShaderViewer::cacheResources()
{
m_ReadOnlyResources = m_Ctx.CurPipelineState().GetReadOnlyDescriptors(m_Stage, false);
m_ReadWriteResources = m_Ctx.CurPipelineState().GetReadWriteDescriptors(m_Stage, false);
m_ReadOnlyResources = m_Ctx.CurPipelineState().GetReadOnlyResources(m_Stage, false);
m_ReadWriteResources = m_Ctx.CurPipelineState().GetReadWriteResources(m_Stage, false);
}
void ShaderViewer::debugShader(const ShaderReflection *shader, ResourceId pipeline,
@@ -2600,7 +2600,7 @@ QString ShaderViewer::stringRep(const ShaderVariable &var, uint32_t row)
else if(type == VarType::ReadWriteResource)
resList = m_ReadWriteResources;
else if(type == VarType::Sampler)
resList = m_Ctx.CurPipelineState().GetSamplerDescriptors(m_Stage);
resList = m_Ctx.CurPipelineState().GetSamplers(m_Stage);
int32_t bindIdx = resList.indexOf(varBind);
@@ -3913,7 +3913,7 @@ void ShaderViewer::updateDebugState()
}
}
rdcarray<UsedDescriptor> samplers = m_Ctx.CurPipelineState().GetSamplerDescriptors(m_Stage);
rdcarray<UsedDescriptor> samplers = m_Ctx.CurPipelineState().GetSamplers(m_Stage);
for(int i = 0; i < m_Trace->samplers.count(); i++)
{
@@ -4594,7 +4594,7 @@ RDTreeWidgetItem *ShaderViewer::makeSourceVariableNode(const SourceVariableMappi
typeName = lit("Sampler");
rdcarray<UsedDescriptor> samplers = m_Ctx.CurPipelineState().GetSamplerDescriptors(m_Stage);
rdcarray<UsedDescriptor> samplers = m_Ctx.CurPipelineState().GetSamplers(m_Stage);
ShaderBindIndex bind = reg->GetBindIndex();
int32_t bindIdx = samplers.indexOf(bind);
+7 -7
View File
@@ -259,7 +259,7 @@ rdcarray<Descriptor> Following::GetOutputTargets(ICaptureContext &ctx)
}
else
{
rdcarray<Descriptor> ret = ctx.CurPipelineState().GetOutputTargetDescriptors();
rdcarray<Descriptor> ret = ctx.CurPipelineState().GetOutputTargets();
if(ret.isEmpty() && curAction != NULL && (curAction->flags & ActionFlags::Present))
{
@@ -285,7 +285,7 @@ Descriptor Following::GetDepthTarget(ICaptureContext &ctx)
if(copy || clear || compute)
return Descriptor();
else
return ctx.CurPipelineState().GetDepthTargetDescriptor();
return ctx.CurPipelineState().GetDepthTarget();
}
Descriptor Following::GetDepthResolveTarget(ICaptureContext &ctx)
@@ -296,7 +296,7 @@ Descriptor Following::GetDepthResolveTarget(ICaptureContext &ctx)
if(copy || clear || compute)
return Descriptor();
else
return ctx.CurPipelineState().GetDepthResolveTargetDescriptor();
return ctx.CurPipelineState().GetDepthResolveTarget();
}
rdcarray<UsedDescriptor> Following::GetReadWriteResources(ICaptureContext &ctx, ShaderStage stage,
@@ -315,11 +315,11 @@ rdcarray<UsedDescriptor> Following::GetReadWriteResources(ICaptureContext &ctx,
if(stage != ShaderStage::Pixel && stage != ShaderStage::Compute)
return rdcarray<UsedDescriptor>();
return ctx.CurPipelineState().GetReadWriteDescriptors(ShaderStage::Compute, onlyUsed);
return ctx.CurPipelineState().GetReadWriteResources(ShaderStage::Compute, onlyUsed);
}
else
{
return ctx.CurPipelineState().GetReadWriteDescriptors(stage, onlyUsed);
return ctx.CurPipelineState().GetReadWriteResources(stage, onlyUsed);
}
}
@@ -346,11 +346,11 @@ rdcarray<UsedDescriptor> Following::GetReadOnlyResources(ICaptureContext &ctx, S
if(stage != ShaderStage::Pixel && stage != ShaderStage::Compute)
return rdcarray<UsedDescriptor>();
return ctx.CurPipelineState().GetReadOnlyDescriptors(ShaderStage::Compute, onlyUsed);
return ctx.CurPipelineState().GetReadOnlyResources(ShaderStage::Compute, onlyUsed);
}
else
{
return ctx.CurPipelineState().GetReadOnlyDescriptors(stage, onlyUsed);
return ctx.CurPipelineState().GetReadOnlyResources(stage, onlyUsed);
}
}