Day 5 of building TitanEngine from scratch using modern C++20 and native DirectX 12—following a strict zero-helper philosophy (no d3dx12.h, no high-level wrappers).
In this devlog, we transition from clearing the back buffer to rendering real geometry on screen by building the programmable graphics pipeline from the ground up.
Timestamps / Chapters:
-
0:00 - Introduction & Day 5 Goals
-
1:00 - Step 1: Writing Pure HLSL Vertex & Pixel Shaders (
shaders.hlsl) -
2:30 - Step 2: Runtime Shader Compilation (
d3dcompiler) & Empty Root Signature -
4:30 - Step 3: Input Layout, Pipeline State Object (PSO) & VRAM Vertex Buffer (
UPLOADHeap) -
7:00 - Step 4: Recording the Draw Call (
DrawInstanced) & Final Render Result
What We Built Today:
-
HLSL Shaders (
shaders.hlsl): Pure Vertex (VSMain) and Pixel (PSMain) shaders handling 3D vertex positions and smooth color interpolation. -
Runtime Compilation: Using
D3DCompileFromFiledirectly in C++20 withID3DBloberror diagnostics. -
Root Signature & Input Layout: Creating an explicit Root Signature with Input Assembler access and mapping
POSITION(float3) andCOLOR(float4) vertex attributes. -
Pipeline State Object (PSO): Packing compiled shaders, rasterizer states, blend states, and
R8G8B8A8_UNORMrender target formats into anID3D12PipelineState. -
VRAM Memory Management: Allocating an
UPLOADheap resource (ID3D12Resource), mapping CPU-to-GPU pointers, and configuringD3D12_VERTEX_BUFFER_VIEW. -
First Draw Call: Binding the pipeline state, viewports, and scissor rects to issue
DrawInstanced(3, 1, 0, 0)and render our first tricolor triangle.
Tech Stack:
-
Language: C++20
-
Graphics API: Native DirectX 12 / DXGI 1.6 (Zero Helpers)
-
Shading Language: HLSL (Shader Model 5.0)
-
Platform: Windows x64 (Native Win32 API)
-link of video day 5:https://youtu.be/83V_iCkINCI
#DirectX12 #Cpp20 #GameEngineDev #GraphicsProgramming #LowLevelCode hlsl #GameDev #TitanEngine #RenderingEngine #EngineProgramming