void ShadowBuffer::BeginRendering( GraphicsContext& Context ) { Context.TransitionResource(*this, D3D12_RESOURCE_STATE_DEPTH_WRITE, true); Context.ClearDepth(*this); Context.SetDepthStencilTarget(GetDSV()); Context.SetViewportAndScissor(m_Viewport, m_Scissor); }
void SDSMShadowManager::RenderShadowDepth(uint32 partitionIndex, RenderPassContext *renderPassContext, const D3DXMATRIX &lightViewProjMatrix, DynamicArray<SceneEntity*> &shadowEntities) { GraphicsContext *graphicsContext = mGraphicsManager->GetDirect3DManager()->GetContextManager()->GetGraphicsContext(); graphicsContext->TransitionResource(mShadowDepthTarget, D3D12_RESOURCE_STATE_DEPTH_WRITE, true); graphicsContext->ClearDepthStencilTarget(mShadowDepthTarget->GetDepthStencilViewHandle().GetCPUHandle(), 1.0f, 0); graphicsContext->SetDepthStencilTarget(mShadowDepthTarget->GetDepthStencilViewHandle().GetCPUHandle()); for (uint32 i = 0; i < shadowEntities.CurrentSize(); i++) { shadowEntities[i]->RenderShadows(renderPassContext, lightViewProjMatrix); } }