Add Quad Overdraw debug view mode

This commit is contained in:
Wojtek Figat
2021-10-07 14:59:06 +02:00
parent 949766e3a0
commit 1af5ec8492
22 changed files with 473 additions and 5 deletions

View File

@@ -40,7 +40,7 @@ PACK_STRUCT(struct DeferredMaterialShaderData {
DrawPass DeferredMaterialShader::GetDrawModes() const
{
return DrawPass::Depth | DrawPass::GBuffer | DrawPass::MotionVectors;
return DrawPass::Depth | DrawPass::GBuffer | DrawPass::MotionVectors | DrawPass::QuadOverdraw;
}
bool DeferredMaterialShader::CanUseLightmap() const
@@ -195,6 +195,17 @@ bool DeferredMaterialShader::Load()
psDesc.PS = _shader->GetPS("PS_GBuffer");
_cache.DefaultSkinned.Init(psDesc);
#if USE_EDITOR
// Quad Overdraw
psDesc.VS = _shader->GetVS("VS");
psDesc.PS = _shader->GetPS("PS_QuadOverdraw");
_cache.QuadOverdraw.Init(psDesc);
psDesc.VS = _shader->GetVS("VS", 1);
_cacheInstanced.Depth.Init(psDesc);
psDesc.VS = _shader->GetVS("VS_Skinned");
_cache.QuadOverdrawSkinned.Init(psDesc);
#endif
// Motion Vectors pass
psDesc.DepthWriteEnable = false;
psDesc.DepthTestEnable = true;