aboutsummaryrefslogtreecommitdiff
path: root/dxg/src
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-12-04 18:50:48 -0800
committer3gg <3gg@shellblade.net>2025-12-04 18:50:48 -0800
commitd89331f1636f8d53a3c8e9d0f7bfcf7a6041b88a (patch)
treed35cd39cf534d0d7ce4e4a817e2bc52036471c67 /dxg/src
parent6c8ae19be66cee247980a48e736a4e05d14de179 (diff)
Diffstat (limited to 'dxg/src')
-rw-r--r--dxg/src/imm.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/dxg/src/imm.c b/dxg/src/imm.c
index 28baa99..4a4be93 100644
--- a/dxg/src/imm.c
+++ b/dxg/src/imm.c
@@ -18,9 +18,6 @@ ping-ponging between the two buffers.*/
18#include <imm_vs.h> // generated 18#include <imm_vs.h> // generated
19#include <imm_ps.h> // generated 19#include <imm_ps.h> // generated
20 20
21#define WIN32_LEAN_AND_MEAN
22#include <Windows.h> // OutputDebugStringA
23
24#include <stdint.h> 21#include <stdint.h>
25#include <stdlib.h> 22#include <stdlib.h>
26 23
@@ -181,7 +178,7 @@ static void dxg_imm_draw(DxgImm* imm) {
181 pCmdQueue->lpVtbl->ExecuteCommandLists(pCmdQueue, 1, cmdLists); 178 pCmdQueue->lpVtbl->ExecuteCommandLists(pCmdQueue, 1, cmdLists);
182} 179}
183 180
184DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue* pCmdQueue, DXGI_FORMAT swapChainRtvFormat, DXGI_SAMPLE_DESC swapChainSampleDesc, size_t bufferSizeVerts) { 181DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue* pCmdQueue, DXGI_FORMAT swapChainRtvFormat, DXGI_SAMPLE_DESC swapChainSampleDesc, size_t bufferSize) {
185 assert(pDevice); 182 assert(pDevice);
186 assert(pCmdQueue); 183 assert(pCmdQueue);
187 184
@@ -192,7 +189,7 @@ DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue* pCmdQueue, DXGI_
192 189
193 imm->pDevice = pDevice; 190 imm->pDevice = pDevice;
194 imm->pCmdQueue = pCmdQueue; 191 imm->pCmdQueue = pCmdQueue;
195 imm->bufferSizeVerts = bufferSizeVerts; 192 imm->bufferSizeVerts = bufferSize / 3 / sizeof(float);
196 imm->fenceValue = 0; 193 imm->fenceValue = 0;
197 194
198 // TODO: Move this to the application side. 195 // TODO: Move this to the application side.
@@ -271,7 +268,6 @@ DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue* pCmdQueue, DXGI_
271 TrapIfFailed(imm->pDevice->lpVtbl->CreateGraphicsPipelineState( 268 TrapIfFailed(imm->pDevice->lpVtbl->CreateGraphicsPipelineState(
272 imm->pDevice, &gpso, &IID_ID3D12PipelineState, &imm->pPipelineState)); 269 imm->pDevice, &gpso, &IID_ID3D12PipelineState, &imm->pPipelineState));
273 270
274 const size_t bufferSize = verts_byte_count(bufferSizeVerts);
275 for (int i = 0; i < 2; ++i) { 271 for (int i = 0; i < 2; ++i) {
276 imm->resources[i].pVertexBuffer = create_buffer(pDevice, bufferSize); 272 imm->resources[i].pVertexBuffer = create_buffer(pDevice, bufferSize);
277 if (!imm->resources[i].pVertexBuffer) { 273 if (!imm->resources[i].pVertexBuffer) {