MCPcopy Create free account
hub / github.com/DiligentGraphics/DiligentFX / HnRenderDelegate

Method HnRenderDelegate

Hydrogent/src/HnRenderDelegate.cpp:283–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283HnRenderDelegate::HnRenderDelegate(const CreateInfo& CI) :
284 m_pDevice{CI.pDevice},
285 m_pContext{CI.pContext},
286 m_pRenderStateCache{CI.pRenderStateCache},
287 m_ResourceMgr{CreateResourceManager(CI)},
288 m_PrimitiveAttribsCB{CreatePrimitiveAttribsCB(CI.pDevice)},
289 m_MaterialSRBCache{HnMaterial::CreateSRBCache()},
290 m_USDRenderer{CreateUSDRenderer(CI, m_PrimitiveAttribsCB, m_MaterialSRBCache)},
291 m_TextureRegistry{CI.pDevice, CI.TextureAtlasDim != 0 ? m_ResourceMgr : RefCntAutoPtr<GLTF::ResourceManager>{}},
292 m_RenderParam{std::make_unique<HnRenderParam>(CI.UseVertexPool, CI.UseIndexPool, CI.AsyncShaderCompilation, CI.TextureBindingMode, CI.MetersPerUnit)},
293 m_ShadowMapManager{CreateShadowMapManager(CI)}
294{
295 const Uint32 ConstantBufferOffsetAlignment = m_pDevice->GetAdapterInfo().Buffer.ConstantBufferOffsetAlignment;
296
297 m_MainPassFrameAttribsAlignedSize = AlignUpNonPw2(m_USDRenderer->GetPRBFrameAttribsSize(), ConstantBufferOffsetAlignment);
298 m_ShadowPassFrameAttribsAlignedSize = AlignUpNonPw2(USD_Renderer::GetPRBFrameAttribsSize(0, 0), ConstantBufferOffsetAlignment);
299
300 // Reserve space in the buffer for each shadow casting light + space for the main pass
301 CreateUniformBuffer(
302 m_pDevice,
303 m_MainPassFrameAttribsAlignedSize + m_ShadowPassFrameAttribsAlignedSize * (CI.EnableShadows ? CI.MaxShadowCastingLightCount : 0),
304 "PBR frame attribs CB",
305 &m_FrameAttribsCB,
306 USAGE_DEFAULT);
307
308 m_RenderParam->SetUseShadows(CI.EnableShadows);
309}
310
311HnRenderDelegate::~HnRenderDelegate()
312{

Callers

nothing calls this directly

Calls 6

CreateResourceManagerFunction · 0.85
CreatePrimitiveAttribsCBFunction · 0.85
CreateUSDRendererFunction · 0.85
CreateShadowMapManagerFunction · 0.85
SetUseShadowsMethod · 0.45

Tested by

no test coverage detected