Right now we're in the middle of implementing a DirectX 12 renderer and so far we've created a d3d12 device, a command structure to submit work to GPU, and we spent the last episode writing a descriptor heap allocator which helps us to easily place descriptors in descriptor heaps. Now we've got enough tools and infrastructure to prepare and set up the render surface which is used to present the final rendered image on the screen. DirectX provides this functionality through an interface called a swap chain which can be roughly described as an array of render target textures that will be swapped with each frame. So, today we're going to write a class that creates and manages the swap chain.
🟥(Red Episode)
✅ Support Game Engine Series
/ gameengineseries
✅ Discord
/ discord
🐱 Mr. Frummel
/ mr.frummel
❤ Big thanks to Shaman patrons:
Eearslya Sleiarion, Michael McMahon, Neil Wang, Oleg Shulzhenko, Shaun Mitchell, Zachary Shrout
00:00 - intro
01:20 - API-independent surface class
02:40 - extend renderer API for render surface functions
04:31 - add API-specific surface class (d3d12_surface)
07:15 - write create_swap_chain() function
12:54 - access descriptor heap allocators
15:05 - write finalize() function and create render target views
20:00 - present() and release() functions
21:10 - add some accessor/convenience functions
Further reading:
The Care and Feeding of Modern Swap Chains Pt1:
https://walbourn.github.io/care-and-f...
The Care and Feeding of Modern Swap Chains Pt2:
https://walbourn.github.io/care-and-f...
The Care and Feeding of Modern Swap Chains Pt3:
https://walbourn.github.io/care-and-f...
DXGI overview:
https://docs.microsoft.com/en-us/wind...
keywords: graphics rendering, direct3d 12, directx 12, dxgi, swap chain
by Arash Khatami
-------------------------------------------------------------
#PrimalEngine #GameEngineSeries #GameEngineProgramming #TheGameEngineProgrammingSeries