Zgragselus

Vulkan works

Apr 30th, 2026
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1.     virtual void Update()
  2.     {
  3.         Engine::GraphicsContextVk* context = mRenderer->GetGraphicsContext();
  4.         context->Begin();
  5.  
  6.         Engine::int2 windowSize;
  7.         mWindow->GetSize(windowSize);
  8.  
  9.         //context->SetDescriptorHeap(Engine::DescriptorHeapVk::CBV_SRV_UAV, mRenderer->Heap());
  10.         context->TransitionResource(mSwapChain->GetBackBuffer(), D3D12_RESOURCE_STATE_RENDER_TARGET, true);
  11.         context->SetRenderTargets(mSwapChain->GetBackBuffer(), mSwapChain->GetDepthBuffer());
  12.         context->SetViewport(0.0f, 0.0f, (float)windowSize.x, (float)windowSize.y);
  13.         context->SetScissorRect(0.0f, 0.0f, (float)windowSize.x, (float)windowSize.y);
  14.         context->ClearColor(mSwapChain->GetBackBuffer(), 1.0f, 0.0f, 0.0f, 1.0f);
  15.         context->ClearDepth(mSwapChain->GetDepthBuffer(), 1.0f, 0);
  16.         context->EndRenderPass();
  17.         context->TransitionResource(mSwapChain->GetBackBuffer(), D3D12_RESOURCE_STATE_PRESENT, true);
  18.         uint64_t fence = context->Finish();
  19.  
  20.         mRenderer->ReleaseGraphicsContext(context);
  21.  
  22.         mSwapChain->SwapBuffers();
  23.  
  24.         mWindow->Process();
  25.         mWindow->Paint();
  26.     }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment