From d89331f1636f8d53a3c8e9d0f7bfcf7a6041b88a Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Thu, 4 Dec 2025 18:50:48 -0800 Subject: Tidy --- dxg/include/dxg/dxcommon.h | 2 ++ dxg/include/dxg/imm.h | 2 +- dxg/src/imm.c | 8 ++------ 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'dxg') diff --git a/dxg/include/dxg/dxcommon.h b/dxg/include/dxg/dxcommon.h index 96cf3a5..6cc3466 100644 --- a/dxg/include/dxg/dxcommon.h +++ b/dxg/include/dxg/dxcommon.h @@ -43,6 +43,8 @@ static inline free_aligned(alloc_t* alloc) { #define FREE(ALLOC) free_aligned(&(ALLOC)) #ifndef NDEBUG +#define WIN32_LEAN_AND_MEAN +#include // OutputDebugStringA #define DEBUG_PRINT OutputDebugStringA #else #define DEBUG_PRINT diff --git a/dxg/include/dxg/imm.h b/dxg/include/dxg/imm.h index fdee725..831c1b8 100644 --- a/dxg/include/dxg/imm.h +++ b/dxg/include/dxg/imm.h @@ -6,7 +6,7 @@ typedef struct DxgImm DxgImm; -DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue*, DXGI_FORMAT swapChainRtvFormat, DXGI_SAMPLE_DESC swapChainSampleDesc, size_t bufferSizeVerts); +DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue*, DXGI_FORMAT swapChainRtvFormat, DXGI_SAMPLE_DESC swapChainSampleDesc, size_t bufferSize); void dxg_imm_destroy(DxgImm**); void dxg_imm_set_graphics_state(DxgImm*, const D3D12_VIEWPORT*, D3D12_CPU_DESCRIPTOR_HANDLE hBackBufferView, D3D12_CPU_DESCRIPTOR_HANDLE hDepthStencilView); void dxg_imm_flush(DxgImm*); 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.*/ #include // generated #include // generated -#define WIN32_LEAN_AND_MEAN -#include // OutputDebugStringA - #include #include @@ -181,7 +178,7 @@ static void dxg_imm_draw(DxgImm* imm) { pCmdQueue->lpVtbl->ExecuteCommandLists(pCmdQueue, 1, cmdLists); } -DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue* pCmdQueue, DXGI_FORMAT swapChainRtvFormat, DXGI_SAMPLE_DESC swapChainSampleDesc, size_t bufferSizeVerts) { +DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue* pCmdQueue, DXGI_FORMAT swapChainRtvFormat, DXGI_SAMPLE_DESC swapChainSampleDesc, size_t bufferSize) { assert(pDevice); assert(pCmdQueue); @@ -192,7 +189,7 @@ DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue* pCmdQueue, DXGI_ imm->pDevice = pDevice; imm->pCmdQueue = pCmdQueue; - imm->bufferSizeVerts = bufferSizeVerts; + imm->bufferSizeVerts = bufferSize / 3 / sizeof(float); imm->fenceValue = 0; // TODO: Move this to the application side. @@ -271,7 +268,6 @@ DxgImm* dxg_imm_init(ID3D12Device* pDevice, ID3D12CommandQueue* pCmdQueue, DXGI_ TrapIfFailed(imm->pDevice->lpVtbl->CreateGraphicsPipelineState( imm->pDevice, &gpso, &IID_ID3D12PipelineState, &imm->pPipelineState)); - const size_t bufferSize = verts_byte_count(bufferSizeVerts); for (int i = 0; i < 2; ++i) { imm->resources[i].pVertexBuffer = create_buffer(pDevice, bufferSize); if (!imm->resources[i].pVertexBuffer) { -- cgit v1.2.3