MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / AfterReset

Method AfterReset

SampleFramework12/v1.00/Graphics/SwapChain.cpp:103–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void SwapChain::AfterReset()
104{
105 // Re-create an RTV for each back buffer
106 for(uint64 i = 0; i < NumBackBuffers; i++)
107 {
108 backBuffers[i].RTV = DX12::RTVDescriptorHeap.Allocate();
109 DXCall(swapChain->GetBuffer(uint32(i), IID_PPV_ARGS(&backBuffers[i].Texture.Resource)));
110
111 D3D12_RENDER_TARGET_VIEW_DESC rtvDesc = { };
112 rtvDesc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
113 rtvDesc.Format = format;
114 rtvDesc.Texture2D.MipSlice = 0;
115 rtvDesc.Texture2D.PlaneSlice = 0;
116 DX12::Device->CreateRenderTargetView(backBuffers[i].Texture.Resource, &rtvDesc, backBuffers[i].RTV.CPUHandle);
117
118 backBuffers[i].Texture.Resource->SetName(MakeString(L"Back Buffer %llu", i).c_str());
119
120 backBuffers[i].Texture.Width = width;
121 backBuffers[i].Texture.Height = height;
122 backBuffers[i].Texture.ArraySize = 1;
123 backBuffers[i].Texture.Format = format;
124 backBuffers[i].Texture.NumMips = 1;
125 backBuffers[i].MSAASamples = 1;
126 }
127
128 backBufferIdx = swapChain->GetCurrentBackBufferIndex();
129}
130
131void SwapChain::CheckForSuitableOutput()
132{

Callers

nothing calls this directly

Calls 4

DXCallFunction · 0.85
MakeStringFunction · 0.85
AllocateMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected