DirectX 12 Hello World Sample

twitterlinkedin

Purpose of the Sample:

This sample demonstrates serves as a DirectX 12 “Hello World” sample. It is based heavily on Frank Luna’s implementation from his book “3D Game Programming with DirectX 12”.
This sample contains the bare essentials to render content with DirectX 12. The sample simply renders a quad using a vertex and index buffer. The CPU and GPU are synchronized each frame and there is only ever one frame being processed by the CPU at a time. In a future article, I will demonstrate how to improve performance by keeping both the CPU and GPU busy by generating more frames on the CPU for the GPU to process. One interesting note about this sample is that I use bundles to execute the draw call.

“The purpose of bundles is to allow apps to group a small number of API commands together for later execution. At bundle creation time, the driver will perform as much pre-processing as is possible to make these cheap to execute later. Bundles are designed to be used and re-used any number of times.”
https://docs.microsoft.com/en-us/windows/desktop/direct3d12/recording-command-lists-and-bundles

NVidia suggests that you limit the number of commands you include in a bundle to increase its reusability.
https://developer.nvidia.com/dx12-dos-and-donts#worksubmit

CGame.h

CGame.cpp

UploadBuffer.h

VertexShader.hlsl

PixelShader.hlsl

Download Sample App

twitterlinkedin
Share It!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.