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

Method OnResize

BakingLab/MeshRenderer.cpp:396–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396void MeshRenderer::OnResize(uint32 width, uint32 height)
397{
398 depthReductionTargets.clear();
399
400 uint32 w = width;
401 uint32 h = height;
402
403 while(w > 1 || h > 1)
404 {
405 w = DispatchSize(ReductionTGSize, w);
406 h = DispatchSize(ReductionTGSize, h);
407
408 RenderTarget2D rt;
409 rt.Initialize(device, w, h, DXGI_FORMAT_R16G16_UNORM, 1, 1, 0, false, true);
410 depthReductionTargets.push_back(rt);
411 }
412
413 meshPSConstants.Data.RTSize.x = float(width);
414 meshPSConstants.Data.RTSize.y = float(height);
415
416 areaLightConstants.Data.RTSize = meshPSConstants.Data.RTSize;
417}
418
419void MeshRenderer::ReduceDepth(ID3D11DeviceContext* context, DepthStencilBuffer& depthTarget,
420 const Camera& camera)

Callers 1

CreateRenderTargetsMethod · 0.80

Calls 4

DispatchSizeFunction · 0.85
clearMethod · 0.45
InitializeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected