diff options
| author | Quentin LADEVIE <qladevie@wanadev.fr> | 2025-01-26 22:27:10 +0100 |
|---|---|---|
| committer | Quentin LADEVIE <qladevie@wanadev.fr> | 2025-01-26 22:27:10 +0100 |
| commit | c29105b461135f3909cca0308fb05715cee45763 (patch) | |
| tree | 49c6c41bb88377f6af73ebdf39821038b88b05cf /include/api-test/dx12-device-types.hpp | |
| parent | 3490db941ea16e67da72f60ebda75ec0f8bb8051 (diff) | |
DX12 command buffers and resourcesapi-proto
Diffstat (limited to 'include/api-test/dx12-device-types.hpp')
| -rw-r--r-- | include/api-test/dx12-device-types.hpp | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/include/api-test/dx12-device-types.hpp b/include/api-test/dx12-device-types.hpp index b70ecf4..4b2fc42 100644 --- a/include/api-test/dx12-device-types.hpp +++ b/include/api-test/dx12-device-types.hpp @@ -1,5 +1,9 @@ +#pragma once +#include <d3d12.h> +#include <dxgi1_3.h> +#include <D3D12MemAlloc.h> + #include <cstdint> -#include <dxgi.h> namespace dx12 { enum class QueueType : uint32_t { @@ -9,17 +13,54 @@ namespace dx12 { MAX, }; + struct buffer_desc { + uint32_t size; + bool map; + + D3D12_RESOURCE_STATES states; + D3D12_RESOURCE_FLAGS usages; + D3D12_HEAP_TYPE heap_type = D3D12_HEAP_TYPE_DEFAULT; + }; + + struct device_buffer { + ID3D12Resource* resource; + + D3D12MA::Allocation* alloc; + uint32_t size; + void* mapped_ptr = nullptr; + }; + + struct texture_desc { + uint32_t width = 1U; + uint32_t height = 1U; + uint32_t depth = 1U; + uint32_t mips = 1U; + + D3D12_RESOURCE_STATES states; + D3D12_RESOURCE_FLAGS usages; + DXGI_FORMAT format; + D3D12_RESOURCE_DIMENSION type; }; struct device_texture { + ID3D12Resource* resource; + D3D12MA::Allocation* alloc; + + uint32_t width = 1U; + uint32_t height = 1U; + uint32_t depth = 1U; + uint32_t mips = 1U; + uint64_t row_pitch = 1U; + + DXGI_FORMAT format; + }; struct surface_desc { HWND window_handle; DXGI_FORMAT surface_format; DXGI_SWAP_EFFECT present_mode; - // VkImageUsageFlags usages; DXGI_USAGE usages; uint32_t image_count = surface_desc::default_image_count; @@ -28,6 +69,6 @@ namespace dx12 { }; struct device_surface { - IDXGISwapChain* swapchain; + IDXGISwapChain1* swapchain; }; } |
