Skip pixel debugging comparison in Iter_Test when writes are masked out

This commit is contained in:
baldurk
2020-02-06 15:07:28 +00:00
parent e012c82168
commit c2e180ea28
3 changed files with 76 additions and 2 deletions
+14
View File
@@ -329,6 +329,20 @@ For some APIs that don't distinguish by entry point, this may be empty.
)");
rdcarray<BoundResource> GetOutputTargets() const;
DOCUMENT(R"(Retrieves the current color blending states, per target.
:return: The currently color blend states.
:rtype: ``list`` of :class:`ColorBlend`.
)");
rdcarray<ColorBlend> GetColorBlends() const;
DOCUMENT(R"(Determines whether or not independent blending is enabled.
:return: A boolean indicating if independent blending is enabled.
:rtype: ``bool``
)");
bool IsIndependentBlendingEnabled() const;
private:
const D3D11Pipe::State *m_D3D11 = NULL;
const D3D12Pipe::State *m_D3D12 = NULL;
+54
View File
@@ -1420,3 +1420,57 @@ rdcarray<BoundResource> PipeState::GetOutputTargets() const
return ret;
}
rdcarray<ColorBlend> PipeState::GetColorBlends() const
{
if(IsCaptureLoaded())
{
if(IsCaptureD3D11())
{
return m_D3D11->outputMerger.blendState.blends;
}
else if(IsCaptureD3D12())
{
return m_D3D12->outputMerger.blendState.blends;
}
else if(IsCaptureGL())
{
return m_GL->framebuffer.blendState.blends;
}
else if(IsCaptureVK())
{
return m_Vulkan->colorBlend.blends;
}
}
return {};
}
bool PipeState::IsIndependentBlendingEnabled() const
{
if(IsCaptureLoaded())
{
if(IsCaptureD3D11())
{
return m_D3D11->outputMerger.blendState.independentBlend;
}
else if(IsCaptureD3D12())
{
return m_D3D12->outputMerger.blendState.independentBlend;
}
else if(IsCaptureGL())
{
// GL is always implicitly independent blending, just that if you set it in a non-independent
// way it sets all states at once
return true;
}
else if(IsCaptureVK())
{
// similarly for vulkan, there's a physical device feature but it just requires that all
// states must be identical
return true;
}
}
return {};
}
+8 -2
View File
@@ -171,7 +171,7 @@ class Iter_Test(rdtest.TestCase):
rdtest.log.print("Got a hit on a drawcall at event %d" % lastmod.eventId)
if mod.sampleMasked or mod.backfaceCulled or mod.depthClipped or mod.viewClipped or mod.scissorClipped or mod.depthTestFailed or mod.stencilTestFailed:
if mod.sampleMasked or mod.backfaceCulled or mod.depthClipped or mod.viewClipped or mod.scissorClipped or mod.shaderDiscarded or mod.depthTestFailed or mod.stencilTestFailed:
rdtest.log.print("This hit failed, looking for one that passed....")
lastmod = None
continue
@@ -182,6 +182,8 @@ class Iter_Test(rdtest.TestCase):
rdtest.log.print("Debugging pixel {},{} @ {}, primitive {}".format(x, y, lastmod.eventId, lastmod.primitiveID))
self.controller.SetFrameEvent(lastmod.eventId, True)
pipe: rd.PipeState = self.controller.GetPipelineState()
trace = self.controller.DebugPixel(x, y, 0, lastmod.primitiveID)
if trace.debugger is None:
@@ -194,14 +196,18 @@ class Iter_Test(rdtest.TestCase):
cycles, variables = self.process_trace(trace)
output_index = [o.resourceId for o in self.controller.GetPipelineState().GetOutputTargets()].index(target)
if draw.outputs[0] == rd.ResourceId.Null():
rdtest.log.success('Successfully debugged pixel in {} cycles, skipping result check due to no output'.format(cycles))
self.controller.FreeTrace(trace)
elif (draw.flags & rd.DrawFlags.Instanced) and draw.numInstances > 1:
rdtest.log.success('Successfully debugged pixel in {} cycles, skipping result check due to instancing'.format(cycles))
self.controller.FreeTrace(trace)
elif pipe.GetColorBlends()[output_index].writeMask == 0:
rdtest.log.success('Successfully debugged pixel in {} cycles, skipping result check due to write mask'.format(cycles))
self.controller.FreeTrace(trace)
else:
output_index = [o.resourceId for o in self.controller.GetPipelineState().GetOutputTargets()].index(target)
rdtest.log.print("At event {} the target is index {}".format(lastmod.eventId, output_index))
output = \