├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── cmake └── InitUCMake.cmake ├── config └── Config.cmake.in ├── include └── UDX12 │ ├── Blob.h │ ├── CmdQueue.h │ ├── D3DInclude.h │ ├── Desc.h │ ├── DescriptorHeap │ ├── CPUDescriptorHeap.h │ ├── DescriptorHeapAllocMngr.h │ ├── DescriptorHeapAllocation.h │ ├── DescriptorHeapWrapper.h │ ├── DynamicSuballocMngr.h │ ├── GPUDescriptorHeap.h │ └── IDescriptorAllocator.h │ ├── DescriptorHeapMngr.h │ ├── Device.h │ ├── FrameGraph │ ├── Executor.h │ ├── FrameGraph.h │ ├── Rsrc.h │ └── RsrcMngr.h │ ├── FrameResource.h │ ├── FrameResourceMngr.h │ ├── GCmdList.h │ ├── MeshGPUBuffer.h │ ├── ResourceDeleteBatch.h │ ├── UDX12.h │ ├── UploadBuffer.h │ ├── Util.h │ ├── VarSizeAllocMngr.h │ ├── _deps │ ├── CMakeLists.txt │ └── DirectXTK12 │ │ └── DirectXTK12.h │ └── details │ ├── FrameRsrcMngr.inl │ ├── GCmdList.inl │ └── UploadBuffer.inl └── src ├── core ├── Blob.cpp ├── CMakeLists.txt ├── CmdQueue.cpp ├── D3DInclude.cpp ├── Desc.cpp ├── DescriptorHeap │ ├── CPUDescriptorHeap.cpp │ ├── DescriptorHeapAllocMngr.cpp │ ├── DescriptorHeapAllocation.cpp │ ├── DescriptorHeapWrapper.cpp │ ├── DynamicSuballocMngr.cpp │ ├── GPUDescriptorHeap.cpp │ └── IDescriptorAllocator.cpp ├── DescriptorHeapMngr.cpp ├── Device.cpp ├── FrameGraph │ ├── Executor.cpp │ └── RsrcMngr.cpp ├── FrameResource.cpp ├── FrameResourceMngr.cpp ├── GCmdList.cpp ├── MeshGPUBuffer.cpp ├── ResourceDeleteBatch.cpp ├── UploadBuffer.cpp ├── Util.cpp ├── VarSizeAllocMngr.cpp └── dxcapi.use.h └── test ├── 00_init ├── CMakeLists.txt └── InitDirect3DApp.cpp └── common ├── CMakeLists.txt ├── Camera.cpp ├── Camera.h ├── GameTimer.cpp ├── GameTimer.h ├── GeometryGenerator.cpp ├── GeometryGenerator.h ├── MathHelper.cpp ├── MathHelper.h ├── UploadBuffer.h ├── d3dApp.cpp ├── d3dApp.h ├── d3dUtil.cpp └── d3dUtil.h /.gitignore: -------------------------------------------------------------------------------- 1 | # antlr4 fils 2 | *.java 3 | *.interp 4 | *.tokens 5 | *.class 6 | 7 | _deps/ 8 | 9 | # binary files 10 | *.png 11 | *.jpg 12 | *.bmp 13 | *.gif 14 | *.dds 15 | 16 | *.zip 17 | *.7z 18 | *.rar 19 | 20 | *.pdf 21 | 22 | *.mp4 23 | 24 | # directories 25 | resources/ 26 | bin/ 27 | lib/ 28 | build/ 29 | _deps/ 30 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14 FATAL_ERROR) 2 | 3 | project(UDX12 VERSION 0.2.1) 4 | message(STATUS "[Project] ${PROJECT_NAME}") 5 | 6 | include(cmake/InitUCMake.cmake) 7 | Ubpa_InitUCMake(VERSION 0.6.4) 8 | 9 | Ubpa_InitProject() 10 | 11 | Ubpa_DownloadZip( 12 | https://udata-1308066321.cos.ap-guangzhou.myqcloud.com/DirectXTK12_20200603.zip 13 | DirectXTK12.zip 14 | SHA256 7AD7FF6131B72D223945BA66AC610230DD492D39D58AF94E839CED5CC7CA3085 15 | ) 16 | 17 | Ubpa_DownloadZip_Pro( 18 | https://udata-1308066321.cos.ap-guangzhou.myqcloud.com/DXCompiler_20210512.zip 19 | DXCompiler_20210512.zip 20 | ${CMAKE_CURRENT_SOURCE_DIR}/bin 21 | SHA256 86FC3DBD3086A0B2C5B0D1B9A79BCDE5D2D302FCA6441559BA3145FF5922EA6E 22 | ) 23 | 24 | Ubpa_AddDep(UTemplate 0.7.2) 25 | Ubpa_AddDep(UFG 0.6.0) 26 | Ubpa_AddDep(UThreadPool 0.1.0) 27 | 28 | Ubpa_AddSubDirsRec(include) 29 | Ubpa_AddSubDirsRec(src) 30 | 31 | Ubpa_Export( 32 | TARGET 33 | DIRECTORIES 34 | "include" 35 | ) 36 | 37 | install( 38 | FILES 39 | "bin/dxcompiler.dll" 40 | "bin/dxil.dll" 41 | DESTINATION "bin" 42 | ) 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ubpa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UDX12 2 | Ubpa DirectX 12 C++ Wrapper 3 | 4 | > 注意:VS2022 需要额外手动安装 ATL 5 | > 6 | > VS2022 -> 菜单栏 -> 工具 -> 获取工具和功能 -> 单个组件 -> 单个组件 -> 搜索 "ATL" -> 选择“适用于最新v143生成工具的 C++ ATL (x86 和 x64)”(其中 v143 应是最新版本的) 7 | 8 | -------------------------------------------------------------------------------- /cmake/InitUCMake.cmake: -------------------------------------------------------------------------------- 1 | macro(Ubpa_InitUCMake) 2 | cmake_parse_arguments( 3 | "ARG" # prefix 4 | "" # # TRUE / FALSE 5 | "VERSION" # 6 | "" # # list 7 | ${ARGN} 8 | ) 9 | # 结果为 ARG_* 10 | # - ARG_