Detect and show sample mask failures in pixel history. Refs #296

This commit is contained in:
baldurk
2016-07-11 12:32:49 +02:00
parent e96cfa6282
commit 982273bbd3
5 changed files with 21 additions and 4 deletions
+1
View File
@@ -483,6 +483,7 @@ struct PixelModification
ModificationValue shaderOut;
ModificationValue postMod;
bool32 sampleMasked;
bool32 backfaceCulled;
bool32 depthClipped;
bool32 viewClipped;
+2 -1
View File
@@ -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
+12
View File
@@ -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);
+4 -3
View File
@@ -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;
}
};
}
+2
View File
@@ -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)