Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- virtual void Update()
- {
- Engine::GraphicsContextVk* context = mRenderer->GetGraphicsContext();
- context->Begin();
- Engine::int2 windowSize;
- mWindow->GetSize(windowSize);
- //context->SetDescriptorHeap(Engine::DescriptorHeapVk::CBV_SRV_UAV, mRenderer->Heap());
- context->TransitionResource(mSwapChain->GetBackBuffer(), D3D12_RESOURCE_STATE_RENDER_TARGET, true);
- context->SetRenderTargets(mSwapChain->GetBackBuffer(), mSwapChain->GetDepthBuffer());
- context->SetViewport(0.0f, 0.0f, (float)windowSize.x, (float)windowSize.y);
- context->SetScissorRect(0.0f, 0.0f, (float)windowSize.x, (float)windowSize.y);
- context->ClearColor(mSwapChain->GetBackBuffer(), 1.0f, 0.0f, 0.0f, 1.0f);
- context->ClearDepth(mSwapChain->GetDepthBuffer(), 1.0f, 0);
- context->EndRenderPass();
- context->TransitionResource(mSwapChain->GetBackBuffer(), D3D12_RESOURCE_STATE_PRESENT, true);
- uint64_t fence = context->Finish();
- mRenderer->ReleaseGraphicsContext(context);
- mSwapChain->SwapBuffers();
- mWindow->Process();
- mWindow->Paint();
- }
Advertisement
Add Comment
Please, Sign In to add comment