Core implementation of Physical Based Rendering.

This commit is contained in:
Areloch 2018-09-15 20:19:57 -05:00
parent 54f1d8c18e
commit b4a1d18f42
148 changed files with 4464 additions and 1016 deletions

View file

@ -32,7 +32,8 @@
GFXD3D11OcclusionQuery::GFXD3D11OcclusionQuery(GFXDevice *device)
: GFXOcclusionQuery(device),
mQuery(NULL)
mQuery(NULL),
mTesting(false)
{
#ifdef TORQUE_GATHER_METRICS
mTimer = PlatformTimer::create();
@ -73,8 +74,11 @@ bool GFXD3D11OcclusionQuery::begin()
AssertISV(hRes != E_OUTOFMEMORY, "GFXD3D11OcclusionQuery::begin - Out of memory");
}
// Add a begin marker to the command buffer queue.
D3D11DEVICECONTEXT->Begin(mQuery);
if (!mTesting)
{
D3D11DEVICECONTEXT->Begin(mQuery);
mTesting = true;
}
#ifdef TORQUE_GATHER_METRICS
mBeginFrame = GuiTSCtrl::getFrameCount();
@ -90,6 +94,7 @@ void GFXD3D11OcclusionQuery::end()
// Add an end marker to the command buffer queue.
D3D11DEVICECONTEXT->End(mQuery);
mTesting = false;
#ifdef TORQUE_GATHER_METRICS
AssertFatal( mBeginFrame == GuiTSCtrl::getFrameCount(), "GFXD3D11OcclusionQuery::end - ended query on different frame than begin!" );