MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / CreateRenderTargets

Method CreateRenderTargets

BakingLab/BakingLab.cpp:465–482  ·  view source on GitHub ↗

Creates all required render targets

Source from the content-addressed store, hash-verified

463
464// Creates all required render targets
465void BakingLab::CreateRenderTargets()
466{
467 ID3D11Device* device = deviceManager.Device();
468 uint32 width = deviceManager.BackBufferWidth();
469 uint32 height = deviceManager.BackBufferHeight();
470
471 const uint32 NumSamples = AppSettings::NumMSAASamples();
472 const uint32 Quality = NumSamples > 0 ? D3D11_STANDARD_MULTISAMPLE_PATTERN : 0;
473 colorTargetMSAA.Initialize(device, width, height, DXGI_FORMAT_R16G16B16A16_FLOAT, 1, NumSamples, Quality);
474 depthBuffer.Initialize(device, width, height, DXGI_FORMAT_D24_UNORM_S8_UINT, true, NumSamples, Quality);
475 velocityTargetMSAA.Initialize(device, width, height, DXGI_FORMAT_R16G16_FLOAT, 1, NumSamples, Quality);
476
477 colorResolveTarget.Initialize(device, width, height, colorTargetMSAA.Format, 1, 1, 0);
478 prevFrameTarget.Initialize(device, width, height, colorTargetMSAA.Format, 1, 1, 0);
479 readbackTexture.Initialize(device, width, height, colorTargetMSAA.Format, 1, 1, 0);
480
481 meshRenderer.OnResize(width, height);
482}
483
484void BakingLab::Update(const Timer& timer)
485{

Callers

nothing calls this directly

Calls 6

NumMSAASamplesFunction · 0.85
DeviceMethod · 0.80
BackBufferWidthMethod · 0.80
BackBufferHeightMethod · 0.80
OnResizeMethod · 0.80
InitializeMethod · 0.45

Tested by

no test coverage detected