Remove redundant instOffset/vertOffset parameters from DebugVertex()

This commit is contained in:
baldurk
2020-02-20 19:07:29 +00:00
parent de7f9d8e1c
commit c23825292d
16 changed files with 27 additions and 41 deletions
+1 -2
View File
@@ -3807,8 +3807,7 @@ void BufferViewer::debugVertex()
ShaderDebugTrace *trace = NULL;
m_Ctx.Replay().AsyncInvoke([this, &done, &trace, vertid, index](IReplayController *r) {
trace = r->DebugVertex(vertid, m_Config.curInstance, index, m_Ctx.CurDrawcall()->instanceOffset,
m_Ctx.CurDrawcall()->vertexOffset);
trace = r->DebugVertex(vertid, m_Config.curInstance, index);
if(trace->debugger == NULL)
{
+1 -4
View File
@@ -835,14 +835,11 @@ bucket when the pixel values are divided between ``minval`` and ``maxval``.
:param int instid: The instance ID as a 0-based index up to the number of instances in the draw.
:param int idx: The actual index used to look up vertex inputs, either from the vertex ID for non-
indexed draws or drawn from the index buffer. This must have all drawcall offsets applied.
:param int instOffset: The value from :data:`DrawcallDescription.instanceOffset`.
:param int vertOffset: The value from :data:`DrawcallDescription.vertexOffset`.
:return: The resulting trace resulting from debugging. Destroy with
:meth:`FreeTrace`.
:rtype: ShaderDebugTrace
)");
virtual ShaderDebugTrace *DebugVertex(uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset) = 0;
virtual ShaderDebugTrace *DebugVertex(uint32_t vertid, uint32_t instid, uint32_t idx) = 0;
DOCUMENT(R"(Retrieve a debugging trace from running a pixel shader.
+1 -2
View File
@@ -257,8 +257,7 @@ public:
{
return rdcarray<PixelModification>();
}
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset)
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx)
{
return new ShaderDebugTrace();
}
+5 -8
View File
@@ -1454,8 +1454,7 @@ rdcarray<PixelModification> ReplayProxy::PixelHistory(rdcarray<EventUsage> event
template <typename ParamSerialiser, typename ReturnSerialiser>
ShaderDebugTrace *ReplayProxy::Proxied_DebugVertex(ParamSerialiser &paramser,
ReturnSerialiser &retser, uint32_t eventId,
uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset)
uint32_t vertid, uint32_t instid, uint32_t idx)
{
const ReplayProxyPacket expectedPacket = eReplayProxy_DebugVertex;
ReplayProxyPacket packet = eReplayProxy_DebugVertex;
@@ -1467,15 +1466,13 @@ ShaderDebugTrace *ReplayProxy::Proxied_DebugVertex(ParamSerialiser &paramser,
SERIALISE_ELEMENT(vertid);
SERIALISE_ELEMENT(instid);
SERIALISE_ELEMENT(idx);
SERIALISE_ELEMENT(instOffset);
SERIALISE_ELEMENT(vertOffset);
END_PARAMS();
}
{
REMOTE_EXECUTION();
if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored)
ret = m_Remote->DebugVertex(eventId, vertid, instid, idx, instOffset, vertOffset);
ret = m_Remote->DebugVertex(eventId, vertid, instid, idx);
else
ret = new ShaderDebugTrace;
}
@@ -1486,9 +1483,9 @@ ShaderDebugTrace *ReplayProxy::Proxied_DebugVertex(ParamSerialiser &paramser,
}
ShaderDebugTrace *ReplayProxy::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid,
uint32_t idx, uint32_t instOffset, uint32_t vertOffset)
uint32_t idx)
{
PROXY_FUNCTION(DebugVertex, eventId, vertid, instid, idx, instOffset, vertOffset);
PROXY_FUNCTION(DebugVertex, eventId, vertid, instid, idx);
}
template <typename ParamSerialiser, typename ReturnSerialiser>
@@ -2778,7 +2775,7 @@ bool ReplayProxy::Tick(int type)
}
case eReplayProxy_ReplaceResource: ReplaceResource(ResourceId(), ResourceId()); break;
case eReplayProxy_RemoveReplacement: RemoveReplacement(ResourceId()); break;
case eReplayProxy_DebugVertex: DebugVertex(0, 0, 0, 0, 0, 0); break;
case eReplayProxy_DebugVertex: DebugVertex(0, 0, 0, 0); break;
case eReplayProxy_DebugPixel: DebugPixel(0, 0, 0, 0, 0); break;
case eReplayProxy_DebugThread:
{
+1 -1
View File
@@ -523,7 +523,7 @@ public:
ResourceId target, uint32_t x, uint32_t y, const Subresource &sub,
CompType typeCast);
IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace *, DebugVertex, uint32_t eventId, uint32_t vertid,
uint32_t instid, uint32_t idx, uint32_t instOffset, uint32_t vertOffset);
uint32_t instid, uint32_t idx);
IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace *, DebugPixel, uint32_t eventId, uint32_t x,
uint32_t y, uint32_t sample, uint32_t primitive);
IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace *, DebugThread, uint32_t eventId,
+1 -2
View File
@@ -231,8 +231,7 @@ public:
rdcarray<PixelModification> PixelHistory(rdcarray<EventUsage> events, ResourceId target, uint32_t x,
uint32_t y, const Subresource &sub, CompType typeCast);
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset);
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx);
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
uint32_t primitive);
ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
+7 -6
View File
@@ -1770,7 +1770,7 @@ void AddCBuffersToGlobalState(const DXBCBytecode::Program &program, D3D11DebugMa
}
ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid,
uint32_t idx, uint32_t instOffset, uint32_t vertOffset)
uint32_t idx)
{
using namespace DXBCBytecode;
using namespace DXBCDebug;
@@ -1844,19 +1844,20 @@ ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui
UINT i = *it;
if(rs->IA.VBs[i])
{
GetDebugManager()->GetBufferData(rs->IA.VBs[i],
rs->IA.Offsets[i] + rs->IA.Strides[i] * (vertOffset + idx),
rs->IA.Strides[i], vertData[i]);
GetDebugManager()->GetBufferData(
rs->IA.VBs[i], rs->IA.Offsets[i] + rs->IA.Strides[i] * (draw->vertexOffset + idx),
rs->IA.Strides[i], vertData[i]);
for(UINT isr = 1; isr <= MaxStepRate; isr++)
{
GetDebugManager()->GetBufferData(
rs->IA.VBs[i], rs->IA.Offsets[i] + rs->IA.Strides[i] * (instOffset + (instid / isr)),
rs->IA.VBs[i],
rs->IA.Offsets[i] + rs->IA.Strides[i] * (draw->instanceOffset + (instid / isr)),
rs->IA.Strides[i], instData[i * MaxStepRate + isr - 1]);
}
GetDebugManager()->GetBufferData(rs->IA.VBs[i],
rs->IA.Offsets[i] + rs->IA.Strides[i] * instOffset,
rs->IA.Offsets[i] + rs->IA.Strides[i] * draw->instanceOffset,
rs->IA.Strides[i], staticData[i]);
}
}
+1 -2
View File
@@ -186,8 +186,7 @@ public:
rdcarray<PixelModification> PixelHistory(rdcarray<EventUsage> events, ResourceId target, uint32_t x,
uint32_t y, const Subresource &sub, CompType typeCast);
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset);
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx);
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
uint32_t primitive);
ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
+1 -1
View File
@@ -1135,7 +1135,7 @@ void GatherConstantBuffers(WrappedID3D12Device *pDevice, const DXBCBytecode::Pro
}
ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid,
uint32_t idx, uint32_t instOffset, uint32_t vertOffset)
uint32_t idx)
{
RDCUNIMPLEMENTED("Vertex debugging not yet implemented for D3D12");
return new ShaderDebugTrace();
+1 -1
View File
@@ -3455,7 +3455,7 @@ rdcarray<PixelModification> GLReplay::PixelHistory(rdcarray<EventUsage> events,
}
ShaderDebugTrace *GLReplay::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid,
uint32_t idx, uint32_t instOffset, uint32_t vertOffset)
uint32_t idx)
{
GLNOTIMP("DebugVertex");
return new ShaderDebugTrace();
+1 -2
View File
@@ -217,8 +217,7 @@ public:
rdcarray<PixelModification> PixelHistory(rdcarray<EventUsage> events, ResourceId target, uint32_t x,
uint32_t y, const Subresource &sub, CompType typeCast);
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset);
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx);
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
uint32_t primitive);
ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
+1 -1
View File
@@ -3871,7 +3871,7 @@ void VulkanReplay::RefreshDerivedReplacements()
}
ShaderDebugTrace *VulkanReplay::DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid,
uint32_t idx, uint32_t instOffset, uint32_t vertOffset)
uint32_t idx)
{
VULKANNOTIMP("DebugVertex");
return new ShaderDebugTrace();
+1 -2
View File
@@ -367,8 +367,7 @@ public:
rdcarray<PixelModification> PixelHistory(rdcarray<EventUsage> events, ResourceId target, uint32_t x,
uint32_t y, const Subresource &sub, CompType typeCast);
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset);
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx);
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
uint32_t primitive);
ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
+2 -4
View File
@@ -1621,13 +1621,11 @@ rdcarray<uint32_t> ReplayController::GetHistogram(ResourceId textureId, const Su
return hist;
}
ShaderDebugTrace *ReplayController::DebugVertex(uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset)
ShaderDebugTrace *ReplayController::DebugVertex(uint32_t vertid, uint32_t instid, uint32_t idx)
{
CHECK_REPLAY_THREAD();
ShaderDebugTrace *ret =
m_pDevice->DebugVertex(m_EventID, vertid, instid, idx, instOffset, vertOffset);
ShaderDebugTrace *ret = m_pDevice->DebugVertex(m_EventID, vertid, instid, idx);
SetFrameEvent(m_EventID, true);
+1 -2
View File
@@ -185,8 +185,7 @@ public:
float minval, float maxval, bool channels[4]);
rdcarray<PixelModification> PixelHistory(ResourceId target, uint32_t x, uint32_t y,
const Subresource &sub, CompType typeCast);
ShaderDebugTrace *DebugVertex(uint32_t vertid, uint32_t instid, uint32_t idx, uint32_t instOffset,
uint32_t vertOffset);
ShaderDebugTrace *DebugVertex(uint32_t vertid, uint32_t instid, uint32_t idx);
ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive);
ShaderDebugTrace *DebugThread(const uint32_t groupid[3], const uint32_t threadid[3]);
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
+1 -1
View File
@@ -180,7 +180,7 @@ public:
uint32_t x, uint32_t y, const Subresource &sub,
CompType typeCast) = 0;
virtual ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid,
uint32_t idx, uint32_t instOffset, uint32_t vertOffset) = 0;
uint32_t idx) = 0;
virtual ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
uint32_t primitive) = 0;
virtual ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],