mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-05 11:57:53 +00:00
Change DebugPixel() to take a DebugShaderInputs struct
DebugShaderInputs struct contains existing the parameters: sample primitive and a new parameter view Default constructor for DebugShaderInputs sets the parameters to NoPreference (~0U).
This commit is contained in:
1 parent
5516f67227
commit
7934d1d16e
39 files changed
+151
-85
No files matched your search
@@ -80,3 +80,9 @@ Pixel History
|
||||
|
||||
.. autoclass:: PixelValue
|
||||
:members:
|
||||
|
||||
Shader Debuging
|
||||
---------------
|
||||
|
||||
.. autoclass:: DebugPixelInputs
|
||||
:members:
|
||||
@@ -767,8 +767,10 @@ void PixelHistoryView::startDebug(EventTag tag)
|
||||
ShaderDebugTrace *trace = NULL;
|
||||
|
||||
m_Ctx.Replay().AsyncInvoke([this, &trace, &done, tag](IReplayController *r) {
|
||||
trace = r->DebugPixel((uint32_t)m_Pixel.x(), (uint32_t)m_Pixel.y(),
|
||||
m_Display.subresource.sample, tag.primitive);
|
||||
DebugPixelInputs inputs;
|
||||
inputs.sample = m_Display.subresource.sample;
|
||||
inputs.primitive = tag.primitive;
|
||||
trace = r->DebugPixel((uint32_t)m_Pixel.x(), (uint32_t)m_Pixel.y(), inputs);
|
||||
|
||||
if(trace->debugger == NULL)
|
||||
{
|
||||
|
||||
@@ -337,13 +337,22 @@ ShaderMessageViewer::ShaderMessageViewer(ICaptureContext &ctx, ShaderStageMask s
|
||||
|
||||
m_Ctx.Replay().AsyncInvoke([&trace, &done, msg](IReplayController *r) {
|
||||
if(msg.stage == ShaderStage::Compute)
|
||||
{
|
||||
trace = r->DebugThread(msg.location.compute.workgroup, msg.location.compute.thread);
|
||||
}
|
||||
else if(msg.stage == ShaderStage::Vertex)
|
||||
{
|
||||
trace = r->DebugVertex(msg.location.vertex.vertexIndex, msg.location.vertex.instance,
|
||||
msg.location.vertex.vertexIndex, msg.location.vertex.view);
|
||||
}
|
||||
else if(msg.stage == ShaderStage::Pixel)
|
||||
trace = r->DebugPixel(msg.location.pixel.x, msg.location.pixel.y,
|
||||
msg.location.pixel.sample, msg.location.pixel.primitive);
|
||||
{
|
||||
DebugPixelInputs inputs;
|
||||
inputs.sample = msg.location.pixel.sample;
|
||||
inputs.primitive = msg.location.pixel.primitive;
|
||||
inputs.view = msg.location.pixel.view;
|
||||
trace = r->DebugPixel(msg.location.pixel.x, msg.location.pixel.y, inputs);
|
||||
}
|
||||
|
||||
if(trace && trace->debugger == NULL)
|
||||
{
|
||||
|
||||
@@ -4099,7 +4099,9 @@ void TextureViewer::on_debugPixelContext_clicked()
|
||||
ShaderDebugTrace *trace = NULL;
|
||||
|
||||
m_Ctx.Replay().AsyncInvoke([this, &trace, &done, x, y](IReplayController *r) {
|
||||
trace = r->DebugPixel((uint32_t)x, (uint32_t)y, m_TexDisplay.subresource.sample, ~0U);
|
||||
DebugPixelInputs inputs;
|
||||
inputs.sample = m_TexDisplay.subresource.sample;
|
||||
trace = r->DebugPixel((uint32_t)x, (uint32_t)y, inputs);
|
||||
|
||||
if(trace->debugger == NULL)
|
||||
{
|
||||
|
||||
@@ -2235,3 +2235,23 @@ struct Thumbnail
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(Thumbnail);
|
||||
|
||||
DOCUMENT(
|
||||
"Contains the properties used to select which fragment to debug, used as an input to "
|
||||
"DebugPixel.");
|
||||
struct DebugPixelInputs
|
||||
{
|
||||
DOCUMENT("");
|
||||
DebugPixelInputs() : sample(~0U), primitive(~0U), view(~0U) {}
|
||||
DebugPixelInputs(const DebugPixelInputs &) = default;
|
||||
DebugPixelInputs &operator=(const DebugPixelInputs &) = default;
|
||||
|
||||
DOCUMENT("The multi-sampled sample.");
|
||||
uint32_t sample;
|
||||
DOCUMENT("The primitive index.");
|
||||
uint32_t primitive;
|
||||
DOCUMENT("The layered or multiview rendering view index.");
|
||||
uint32_t view;
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(DebugPixelInputs);
|
||||
@@ -967,15 +967,16 @@ bucket when the pixel values are divided between ``minval`` and ``maxval``.
|
||||
|
||||
:param int x: The x co-ordinate.
|
||||
:param int y: The y co-ordinate.
|
||||
:param int sample: The multi-sampled sample. Ignored if non-multisampled texture.
|
||||
:param int primitive: Debug the pixel from this primitive if there's ambiguity. If set to
|
||||
:param DebugPixelInputs inputs: Specific properties to select which fragment to debug e.g.
|
||||
sample: The multi-sampled sample. Ignored if non-multisampled texture.
|
||||
primitive: Debug the pixel from this primitive if there's ambiguity. If set to
|
||||
:data:`NoPreference` then a random fragment writing to the given co-ordinate is debugged.
|
||||
:return: The resulting trace resulting from debugging. Destroy with
|
||||
:meth:`FreeTrace`.
|
||||
view: Debug the fragment writing to this view for layered or multiview rendering,
|
||||
ignored if set to :data:`NoPreference`.
|
||||
:return: The resulting trace resulting from debugging. Destroy with :meth:`FreeTrace`.
|
||||
:rtype: ShaderDebugTrace
|
||||
)");
|
||||
virtual ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive) = 0;
|
||||
virtual ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, const DebugPixelInputs &inputs) = 0;
|
||||
|
||||
DOCUMENT(R"(Retrieve a debugging trace from running a compute thread.
|
||||
|
||||
|
||||
@@ -318,8 +318,8 @@ public:
|
||||
{
|
||||
return new ShaderDebugTrace();
|
||||
}
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive)
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs)
|
||||
{
|
||||
return new ShaderDebugTrace();
|
||||
}
|
||||
|
||||
@@ -1577,7 +1577,7 @@ ShaderDebugTrace *ReplayProxy::DebugVertex(uint32_t eventId, uint32_t vertid, ui
|
||||
template <typename ParamSerialiser, typename ReturnSerialiser>
|
||||
ShaderDebugTrace *ReplayProxy::Proxied_DebugPixel(ParamSerialiser ¶mser, ReturnSerialiser &retser,
|
||||
uint32_t eventId, uint32_t x, uint32_t y,
|
||||
uint32_t sample, uint32_t primitive)
|
||||
const DebugPixelInputs &inputs)
|
||||
{
|
||||
const ReplayProxyPacket expectedPacket = eReplayProxy_DebugPixel;
|
||||
ReplayProxyPacket packet = eReplayProxy_DebugPixel;
|
||||
@@ -1588,15 +1588,14 @@ ShaderDebugTrace *ReplayProxy::Proxied_DebugPixel(ParamSerialiser ¶mser, Ret
|
||||
SERIALISE_ELEMENT(eventId);
|
||||
SERIALISE_ELEMENT(x);
|
||||
SERIALISE_ELEMENT(y);
|
||||
SERIALISE_ELEMENT(sample);
|
||||
SERIALISE_ELEMENT(primitive);
|
||||
SERIALISE_ELEMENT(inputs);
|
||||
END_PARAMS();
|
||||
}
|
||||
|
||||
{
|
||||
REMOTE_EXECUTION();
|
||||
if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored)
|
||||
ret = m_Remote->DebugPixel(eventId, x, y, sample, primitive);
|
||||
ret = m_Remote->DebugPixel(eventId, x, y, inputs);
|
||||
else
|
||||
ret = new ShaderDebugTrace;
|
||||
}
|
||||
@@ -1606,10 +1605,10 @@ ShaderDebugTrace *ReplayProxy::Proxied_DebugPixel(ParamSerialiser ¶mser, Ret
|
||||
return ret;
|
||||
}
|
||||
|
||||
ShaderDebugTrace *ReplayProxy::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive)
|
||||
ShaderDebugTrace *ReplayProxy::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs)
|
||||
{
|
||||
PROXY_FUNCTION(DebugPixel, eventId, x, y, sample, primitive);
|
||||
PROXY_FUNCTION(DebugPixel, eventId, x, y, inputs);
|
||||
}
|
||||
|
||||
template <typename ParamSerialiser, typename ReturnSerialiser>
|
||||
@@ -2948,7 +2947,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); break;
|
||||
case eReplayProxy_DebugPixel: DebugPixel(0, 0, 0, 0, 0); break;
|
||||
case eReplayProxy_DebugPixel: DebugPixel(0, 0, 0, DebugPixelInputs()); break;
|
||||
case eReplayProxy_DebugThread:
|
||||
{
|
||||
DebugThread(0, {}, {});
|
||||
|
||||
@@ -533,7 +533,7 @@ public:
|
||||
IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace *, DebugVertex, uint32_t eventId, uint32_t vertid,
|
||||
uint32_t instid, uint32_t idx, uint32_t view);
|
||||
IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace *, DebugPixel, uint32_t eventId, uint32_t x,
|
||||
uint32_t y, uint32_t sample, uint32_t primitive);
|
||||
uint32_t y, const DebugPixelInputs &inputs);
|
||||
IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace *, DebugThread, uint32_t eventId,
|
||||
const rdcfixedarray<uint32_t, 3> &groupid,
|
||||
const rdcfixedarray<uint32_t, 3> &threadid);
|
||||
|
||||
@@ -275,8 +275,8 @@ public:
|
||||
uint32_t y, const Subresource &sub, CompType typeCast);
|
||||
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
|
||||
uint32_t view);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs);
|
||||
ShaderDebugTrace *DebugThread(uint32_t eventId, const rdcfixedarray<uint32_t, 3> &groupid,
|
||||
const rdcfixedarray<uint32_t, 3> &threadid);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
|
||||
@@ -1791,12 +1791,15 @@ ShaderDebugTrace *D3D11Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui
|
||||
return ret;
|
||||
}
|
||||
|
||||
ShaderDebugTrace *D3D11Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive)
|
||||
ShaderDebugTrace *D3D11Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs)
|
||||
{
|
||||
using namespace DXBCBytecode;
|
||||
using namespace DXBCDebug;
|
||||
|
||||
uint32_t sample = inputs.sample;
|
||||
uint32_t primitive = inputs.primitive;
|
||||
|
||||
D3D11MarkerRegion region(
|
||||
StringFormat::Fmt("DebugPixel @ %u of (%u,%u) %u / %u", eventId, x, y, sample, primitive));
|
||||
|
||||
|
||||
@@ -234,8 +234,8 @@ public:
|
||||
uint32_t y, const Subresource &sub, CompType typeCast);
|
||||
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
|
||||
uint32_t view);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs);
|
||||
ShaderDebugTrace *DebugThread(uint32_t eventId, const rdcfixedarray<uint32_t, 3> &groupid,
|
||||
const rdcfixedarray<uint32_t, 3> &threadid);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
|
||||
@@ -1891,13 +1891,16 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui
|
||||
return ret;
|
||||
}
|
||||
|
||||
ShaderDebugTrace *D3D12Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive)
|
||||
ShaderDebugTrace *D3D12Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs)
|
||||
{
|
||||
using namespace DXBC;
|
||||
using namespace DXBCBytecode;
|
||||
using namespace DXBCDebug;
|
||||
|
||||
uint32_t sample = inputs.sample;
|
||||
uint32_t primitive = inputs.primitive;
|
||||
|
||||
D3D12MarkerRegion debugpixRegion(
|
||||
m_pDevice->GetQueue()->GetReal(),
|
||||
StringFormat::Fmt("DebugPixel @ %u of (%u,%u) %u / %u", eventId, x, y, sample, primitive));
|
||||
|
||||
@@ -3794,8 +3794,8 @@ ShaderDebugTrace *GLReplay::DebugVertex(uint32_t eventId, uint32_t vertid, uint3
|
||||
return new ShaderDebugTrace();
|
||||
}
|
||||
|
||||
ShaderDebugTrace *GLReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive)
|
||||
ShaderDebugTrace *GLReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs)
|
||||
{
|
||||
GLNOTIMP("DebugPixel");
|
||||
return new ShaderDebugTrace();
|
||||
|
||||
@@ -247,8 +247,8 @@ public:
|
||||
uint32_t y, const Subresource &sub, CompType typeCast);
|
||||
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
|
||||
uint32_t view);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs);
|
||||
ShaderDebugTrace *DebugThread(uint32_t eventId, const rdcfixedarray<uint32_t, 3> &groupid,
|
||||
const rdcfixedarray<uint32_t, 3> &threadid);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
|
||||
@@ -442,8 +442,8 @@ public:
|
||||
uint32_t y, const Subresource &sub, CompType typeCast);
|
||||
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
|
||||
uint32_t view);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs);
|
||||
ShaderDebugTrace *DebugThread(uint32_t eventId, const rdcfixedarray<uint32_t, 3> &groupid,
|
||||
const rdcfixedarray<uint32_t, 3> &threadid);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
|
||||
@@ -4176,7 +4176,7 @@ ShaderDebugTrace *VulkanReplay::DebugVertex(uint32_t eventId, uint32_t vertid, u
|
||||
}
|
||||
|
||||
ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
uint32_t sample, uint32_t primitive)
|
||||
const DebugPixelInputs &inputs)
|
||||
{
|
||||
if(!GetAPIProperties().shaderDebugging)
|
||||
{
|
||||
@@ -4193,11 +4193,15 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_
|
||||
VkDevice dev = m_pDriver->GetDev();
|
||||
VkResult vkr = VK_SUCCESS;
|
||||
|
||||
uint32_t sample = inputs.sample;
|
||||
uint32_t primitive = inputs.primitive;
|
||||
uint32_t view = inputs.view;
|
||||
|
||||
const VulkanRenderState &state = m_pDriver->GetRenderState();
|
||||
VulkanCreationInfo &c = m_pDriver->m_CreationInfo;
|
||||
|
||||
rdcstr regionName = StringFormat::Fmt("DebugPixel @ %u of (%u,%u) sample %u primitive %u",
|
||||
eventId, x, y, sample, primitive);
|
||||
rdcstr regionName = StringFormat::Fmt("DebugPixel @ %u of (%u,%u) sample %u primitive %u view %u",
|
||||
eventId, x, y, sample, primitive, view);
|
||||
|
||||
VkMarkerRegion region(regionName);
|
||||
|
||||
|
||||
@@ -257,8 +257,8 @@ ShaderDebugTrace *DummyDriver::DebugVertex(uint32_t eventId, uint32_t vertid, ui
|
||||
return new ShaderDebugTrace;
|
||||
}
|
||||
|
||||
ShaderDebugTrace *DummyDriver::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive)
|
||||
ShaderDebugTrace *DummyDriver::DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs)
|
||||
{
|
||||
return new ShaderDebugTrace;
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ public:
|
||||
uint32_t y, const Subresource &sub, CompType typeCast);
|
||||
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
|
||||
uint32_t view);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs);
|
||||
ShaderDebugTrace *DebugThread(uint32_t eventId, const rdcfixedarray<uint32_t, 3> &groupid,
|
||||
const rdcfixedarray<uint32_t, 3> &threadid);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
|
||||
@@ -991,6 +991,16 @@ void DoSerialise(SerialiserType &ser, ReplayOptions &el)
|
||||
SIZE_CHECK(48);
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, DebugPixelInputs &el)
|
||||
{
|
||||
SERIALISE_MEMBER(sample);
|
||||
SERIALISE_MEMBER(primitive);
|
||||
SERIALISE_MEMBER(view);
|
||||
|
||||
SIZE_CHECK(12);
|
||||
}
|
||||
|
||||
#pragma region Common pipeline state
|
||||
|
||||
template <typename SerialiserType>
|
||||
@@ -2474,6 +2484,7 @@ INSTANTIATE_SERIALISE_TYPE(CounterResult)
|
||||
INSTANTIATE_SERIALISE_TYPE(CounterValue)
|
||||
INSTANTIATE_SERIALISE_TYPE(GPUDevice)
|
||||
INSTANTIATE_SERIALISE_TYPE(ReplayOptions)
|
||||
INSTANTIATE_SERIALISE_TYPE(DebugPixelInputs)
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Layout)
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::InputAssembly)
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::View)
|
||||
|
||||
@@ -1619,14 +1619,13 @@ ShaderDebugTrace *ReplayController::DebugVertex(uint32_t vertid, uint32_t instid
|
||||
return ret;
|
||||
}
|
||||
|
||||
ShaderDebugTrace *ReplayController::DebugPixel(uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive)
|
||||
ShaderDebugTrace *ReplayController::DebugPixel(uint32_t x, uint32_t y, const DebugPixelInputs &inputs)
|
||||
{
|
||||
CHECK_REPLAY_THREAD();
|
||||
|
||||
RENDERDOC_PROFILEFUNCTION();
|
||||
|
||||
ShaderDebugTrace *ret = m_pDevice->DebugPixel(m_EventID, x, y, sample, primitive);
|
||||
ShaderDebugTrace *ret = m_pDevice->DebugPixel(m_EventID, x, y, inputs);
|
||||
FatalErrorCheck();
|
||||
|
||||
SetFrameEvent(m_EventID, true);
|
||||
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
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 view);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive);
|
||||
ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, const DebugPixelInputs &inputs);
|
||||
ShaderDebugTrace *DebugThread(const rdcfixedarray<uint32_t, 3> &groupid,
|
||||
const rdcfixedarray<uint32_t, 3> &threadid);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
|
||||
@@ -217,8 +217,8 @@ public:
|
||||
CompType typeCast) = 0;
|
||||
virtual ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid,
|
||||
uint32_t idx, uint32_t view) = 0;
|
||||
virtual ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
|
||||
uint32_t primitive) = 0;
|
||||
virtual ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y,
|
||||
const DebugPixelInputs &inputs) = 0;
|
||||
virtual ShaderDebugTrace *DebugThread(uint32_t eventId, const rdcfixedarray<uint32_t, 3> &groupid,
|
||||
const rdcfixedarray<uint32_t, 3> &threadid) = 0;
|
||||
virtual rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger) = 0;
|
||||
|
||||
@@ -122,8 +122,7 @@ class Buffer_Truncation(rdtest.TestCase):
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(int(pipe.GetViewport(0).width/2),
|
||||
int(pipe.GetViewport(0).height/2),
|
||||
rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
rd.DebugPixelInputs())
|
||||
|
||||
if trace.debugger is None:
|
||||
self.controller.FreeTrace(trace)
|
||||
|
||||
@@ -31,8 +31,7 @@ class D3D11_CBuffer_Zoo(rdtest.TestCase):
|
||||
rd.ShaderStage.Pixel).debugInfo.debuggable:
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(int(pipe.GetViewport(0).width / 2.0),
|
||||
int(pipe.GetViewport(0).height / 2.0),
|
||||
rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
rd.DebugPixelInputs())
|
||||
|
||||
debugVars = dict()
|
||||
|
||||
|
||||
@@ -10,7 +10,9 @@ class D3D11_PrimitiveID(rdtest.TestCase):
|
||||
self.controller.SetFrameEvent(action.eventId, True)
|
||||
pipe: rd.PipeState = self.controller.GetPipelineState()
|
||||
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.ReplayController.NoPreference, prim)
|
||||
inputs = rd.DebugPixelInputs()
|
||||
inputs.primitive = prim
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, inputs)
|
||||
|
||||
sourceVars: List[rd.SourceVariableMapping] = list(trace.sourceVars)
|
||||
cycles, variables = self.process_trace(trace)
|
||||
|
||||
@@ -22,8 +22,7 @@ class D3D11_Shader_Debug_Zoo(rdtest.TestCase):
|
||||
rdtest.log.begin_section("General tests")
|
||||
for test in range(action.numInstances):
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4 * test, 0, rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4 * test, 0, rd.DebugPixelInputs())
|
||||
|
||||
cycles, variables = self.process_trace(trace)
|
||||
|
||||
@@ -52,8 +51,7 @@ class D3D11_Shader_Debug_Zoo(rdtest.TestCase):
|
||||
pipe: rd.PipeState = self.controller.GetPipelineState()
|
||||
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(0, 4, rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(0, 4, rd.DebugPixelInputs())
|
||||
|
||||
cycles, variables = self.process_trace(trace)
|
||||
|
||||
@@ -79,8 +77,9 @@ class D3D11_Shader_Debug_Zoo(rdtest.TestCase):
|
||||
pipe: rd.PipeState = self.controller.GetPipelineState()
|
||||
for test in range(4):
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4, 4, test,
|
||||
rd.ReplayController.NoPreference)
|
||||
inputs = rd.DebugPixelInputs()
|
||||
inputs.sample = test
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4, 4, inputs)
|
||||
|
||||
# Validate that the correct sample index was debugged
|
||||
sampRegister = self.find_input_source_var(trace, rd.ShaderBuiltin.MSAASampleIndex)
|
||||
|
||||
@@ -19,8 +19,7 @@ class D3D11_Shader_Linkage_Zoo(rdtest.TestCase):
|
||||
pipe: rd.PipeState = self.controller.GetPipelineState()
|
||||
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(200, 150, rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(200, 150, rd.DebugPixelInputs())
|
||||
if trace.debugger is None:
|
||||
failed = True
|
||||
rdtest.log.error("Test {} could not be debugged.".format(event_name))
|
||||
|
||||
@@ -103,8 +103,7 @@ class D3D12_CBuffer_Zoo(rdtest.TestCase):
|
||||
rd.ShaderStage.Pixel).debugInfo.debuggable:
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(int(pipe.GetViewport(0).width / 2.0),
|
||||
int(pipe.GetViewport(0).height / 2.0),
|
||||
rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
rd.DebugPixelInputs())
|
||||
|
||||
debugVars = dict()
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ class D3D12_PrimitiveID(rdtest.TestCase):
|
||||
rdtest.log.print("Skipping undebuggable shader at {}.".format(action.eventId))
|
||||
return
|
||||
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.ReplayController.NoPreference, prim)
|
||||
inputs = rd.DebugPixleInputs()
|
||||
inputs.primitive = prim
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, inputs)
|
||||
|
||||
cycles, variables = self.process_trace(trace)
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase):
|
||||
return
|
||||
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.DebugPixelInputs())
|
||||
|
||||
cycles, variables = self.process_trace(trace)
|
||||
|
||||
|
||||
@@ -33,8 +33,7 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
|
||||
# Loop over every test
|
||||
for test in range(action.numInstances):
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4 * test, 0, rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4 * test, 0, rd.DebugPixelInputs())
|
||||
|
||||
cycles, variables = self.process_trace(trace)
|
||||
|
||||
@@ -65,8 +64,9 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
|
||||
pipe: rd.PipeState = self.controller.GetPipelineState()
|
||||
for test in range(4):
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4, 4, test,
|
||||
rd.ReplayController.NoPreference)
|
||||
inputs = rd.DebugPixelInputs()
|
||||
inputs.sample = test
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(4, 4, inputs)
|
||||
|
||||
# Validate that the correct sample index was debugged
|
||||
sampRegister = self.find_input_source_var(trace, rd.ShaderBuiltin.MSAASampleIndex)
|
||||
@@ -113,7 +113,9 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
|
||||
rdtest.log.success("VertexSample VS was debugged correctly")
|
||||
|
||||
# Debug the pixel shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(51, 51, 0, rd.ReplayController.NoPreference)
|
||||
inputs = rd.DebugPixelInputs()
|
||||
inputs.sample = 0
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(51, 51, inputs)
|
||||
|
||||
cycles, variables = self.process_trace(trace)
|
||||
|
||||
@@ -157,7 +159,9 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
|
||||
rdtest.log.success("Banned signature VS was debugged correctly")
|
||||
|
||||
# Debug the pixel shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(64, 64, 0, rd.ReplayController.NoPreference)
|
||||
inputs = rd.DebugPixelInputs()
|
||||
inputs.sample = 0
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(64, 64, inputs)
|
||||
|
||||
cycles, variables = self.process_trace(trace)
|
||||
|
||||
|
||||
@@ -27,8 +27,7 @@ class D3D12_Shader_Linkage_Zoo(rdtest.TestCase):
|
||||
continue
|
||||
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(200, 150, rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(200, 150, rd.DebugPixelInputs())
|
||||
if trace.debugger is None:
|
||||
failed = True
|
||||
rdtest.log.error("Test {} could not be debugged.".format(event_name))
|
||||
|
||||
@@ -48,8 +48,7 @@ class D3D12_Vertex_UAV(rdtest.TestCase):
|
||||
continue
|
||||
|
||||
# Debug the shader
|
||||
trace = self.controller.DebugPixel(50, 50, rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
trace = self.controller.DebugPixel(50, 50, rd.DebugPixelInputs())
|
||||
if trace.debugger is None:
|
||||
raise rdtest.TestFailureException("Pixel shader at {} could not be debugged.".format(name))
|
||||
self.controller.FreeTrace(trace)
|
||||
|
||||
@@ -243,7 +243,10 @@ class Iter_Test(rdtest.TestCase):
|
||||
|
||||
pipe: rd.PipeState = self.controller.GetPipelineState()
|
||||
|
||||
trace = self.controller.DebugPixel(x, y, 0, lastmod.primitiveID)
|
||||
inputs = rd.DebugPixelInputs()
|
||||
inputs.sample = 0
|
||||
inputs.primitive = lastmod.primitiveID;
|
||||
trace = self.controller.DebugPixel(x, y, inputs)
|
||||
|
||||
if trace.debugger is None:
|
||||
self.controller.FreeTrace(trace)
|
||||
|
||||
@@ -138,7 +138,10 @@ class VK_Graphics_Pipeline(rdtest.TestCase):
|
||||
raise rdtest.TestFailureException(
|
||||
"History for drawcall output is wrong: {}".format(history[1].shaderOut.col.floatValue))
|
||||
|
||||
trace = self.controller.DebugPixel(200, 150, 0, 0)
|
||||
inputs = rd.DebugPixelInputs()
|
||||
inputs.sample = 0
|
||||
inputs.primitive = 0
|
||||
trace = self.controller.DebugPixel(200, 150, inputs)
|
||||
|
||||
if trace.debugger is None:
|
||||
raise rdtest.TestFailureException("No pixel debug result")
|
||||
|
||||
@@ -23,8 +23,7 @@ class VK_KHR_Buffer_Address(rdtest.TestCase):
|
||||
raise rdtest.TestFailureException("Test {} shader can not be debugged".format(test_name))
|
||||
|
||||
# Debug the pixel shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.DebugPixelInputs())
|
||||
if trace.debugger is None:
|
||||
self.controller.FreeTrace(trace)
|
||||
raise rdtest.TestFailureException("Test {} did not debug at all".format(test_name))
|
||||
|
||||
@@ -97,8 +97,11 @@ class VK_Multi_Entry(rdtest.TestCase):
|
||||
raise rdtest.TestFailureException(
|
||||
"History for drawcall output is wrong: {}".format(history[1].shaderOut.col.floatValue))
|
||||
|
||||
trace = self.controller.DebugPixel(200, 150, 0, 0)
|
||||
|
||||
inputs = rd.DebugPixelInputs()
|
||||
inputs.sample = 0
|
||||
inputs.primitive = 0
|
||||
trace = self.controller.DebugPixel(200, 150, inputs)
|
||||
|
||||
refl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Pixel)
|
||||
|
||||
self.check(len(refl.readOnlyResources) == 1)
|
||||
|
||||
@@ -30,8 +30,7 @@ class VK_Shader_Debug_Zoo(rdtest.TestCase):
|
||||
y = 4 * child + 1
|
||||
|
||||
# Debug the shader
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.ReplayController.NoPreference,
|
||||
rd.ReplayController.NoPreference)
|
||||
trace: rd.ShaderDebugTrace = self.controller.DebugPixel(x, y, rd.DebugPixelInputs())
|
||||
|
||||
if trace.debugger is None:
|
||||
failed = True
|
||||
|
||||
Reference in new issue
Block a user