mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-09 01:00:51 +00:00
Detect and show sample mask failures in pixel history. Refs #296
This commit is contained in:
@@ -483,6 +483,7 @@ struct PixelModification
|
||||
ModificationValue shaderOut;
|
||||
ModificationValue postMod;
|
||||
|
||||
bool32 sampleMasked;
|
||||
bool32 backfaceCulled;
|
||||
bool32 depthClipped;
|
||||
bool32 viewClipped;
|
||||
|
||||
@@ -1398,6 +1398,7 @@ void Serialiser::Serialise(const char *name, PixelModification &el)
|
||||
Serialise("", el.postMod.depth);
|
||||
Serialise("", el.postMod.stencil);
|
||||
|
||||
Serialise("", el.sampleMasked);
|
||||
Serialise("", el.backfaceCulled);
|
||||
Serialise("", el.depthClipped);
|
||||
Serialise("", el.viewClipped);
|
||||
@@ -1406,7 +1407,7 @@ void Serialiser::Serialise(const char *name, PixelModification &el)
|
||||
Serialise("", el.depthTestFailed);
|
||||
Serialise("", el.stencilTestFailed);
|
||||
|
||||
SIZE_CHECK(PixelModification, 116);
|
||||
SIZE_CHECK(PixelModification, 120);
|
||||
}
|
||||
|
||||
#pragma endregion Data descriptors
|
||||
|
||||
@@ -4623,6 +4623,9 @@ vector<PixelModification> D3D11DebugManager::PixelHistory(vector<EventUsage> eve
|
||||
TestMustFail_DepthTesting = 1 << 8, // if the comparison func is NEVER
|
||||
TestMustFail_StencilTesting = 1 << 9, // if the comparison func is NEVER for both faces, or
|
||||
// one face is backface culled and the other is NEVER
|
||||
|
||||
// if the sample mask set at this event doesn't have the right bit set
|
||||
TestMustFail_SampleMask = 1 << 10,
|
||||
};
|
||||
|
||||
#if 1
|
||||
@@ -4936,6 +4939,13 @@ vector<PixelModification> D3D11DebugManager::PixelHistory(vector<EventUsage> eve
|
||||
// no blending enabled by default
|
||||
}
|
||||
|
||||
// sampleMask is a mask containing only the bit for the sample we want
|
||||
// (or 0xFFFFFFFF if no sample was chosen and we are looking at them all).
|
||||
if((curSample & sampleMask) == 0)
|
||||
{
|
||||
flags[ev] |= TestMustFail_SampleMask;
|
||||
}
|
||||
|
||||
m_pDevice->CreateRasterizerState(&rd, &newRS);
|
||||
m_pImmediateContext->RSSetState(newRS);
|
||||
SAFE_RELEASE(newRS);
|
||||
@@ -5309,6 +5319,8 @@ vector<PixelModification> D3D11DebugManager::PixelHistory(vector<EventUsage> eve
|
||||
mod.stencilTestFailed = true;
|
||||
if(flags[i] & TestMustFail_Scissor)
|
||||
mod.scissorClipped = true;
|
||||
if(flags[i] & TestMustFail_SampleMask)
|
||||
mod.sampleMasked = true;
|
||||
|
||||
m_WrappedDevice->ReplayLog(0, events[i].eventID, eReplay_WithoutDraw);
|
||||
|
||||
|
||||
@@ -814,6 +814,7 @@ namespace renderdoc
|
||||
[CustomMarshalAs(CustomUnmanagedType.CustomClass)]
|
||||
public ModificationValue postMod;
|
||||
|
||||
public bool sampleMasked;
|
||||
public bool backfaceCulled;
|
||||
public bool depthClipped;
|
||||
public bool viewClipped;
|
||||
@@ -824,9 +825,9 @@ namespace renderdoc
|
||||
|
||||
public bool EventPassed()
|
||||
{
|
||||
return !backfaceCulled && !depthClipped && !viewClipped &&
|
||||
!scissorClipped && !shaderDiscarded && !depthTestFailed &&
|
||||
!stencilTestFailed;
|
||||
return !sampleMasked && !backfaceCulled && !depthClipped &&
|
||||
!viewClipped && !scissorClipped && !shaderDiscarded &&
|
||||
!depthTestFailed && !stencilTestFailed;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -233,6 +233,8 @@ namespace renderdocui.Windows
|
||||
{
|
||||
string s = "";
|
||||
|
||||
if (mod.sampleMasked)
|
||||
s += "\nMasked by SampleMask";
|
||||
if (mod.backfaceCulled)
|
||||
s += "\nBackface culled";
|
||||
if (mod.depthClipped)
|
||||
|
||||
Reference in New Issue
Block a user