From a400f1a8a1628f76434d02a89d782ae5a9086d6b Mon Sep 17 00:00:00 2001 From: Ravbug Date: Mon, 2 Sep 2024 17:11:31 -0400 Subject: [PATCH] Update for RavEngine changes --- CMakeLists.txt | 131 +- README.md | 1 - deps/DirectX-Headers/Android.bp | 14 - deps/DirectX-Headers/CMakeLists.txt | 60 +- deps/DirectX-Headers/CMakePresets.json | 187 - deps/DirectX-Headers/SECURITY.md | 82 +- .../cmake/DirectX-Headers.pc.in | 10 + deps/DirectX-Headers/cmake/JoinPaths.cmake | 23 + .../directx/D3D12TokenizedProgramFormat.hpp | 2634 ++ .../include/directx/DirectML.h | 2651 ++ deps/DirectX-Headers/include/directx/d3d12.h | 22821 ++++++++++------ .../DirectX-Headers/include/directx/d3d12.idl | 772 +- .../include/directx/d3d12compatibility.h | 88 +- .../include/directx/d3d12compatibility.idl | 6 +- .../include/directx/d3d12sdklayers.h | 170 +- .../include/directx/d3d12sdklayers.idl | 79 +- .../include/directx/d3d12shader.h | 8 +- .../include/directx/d3d12video.h | 858 +- .../include/directx/d3d12video.idl | 814 +- .../include/directx/d3dcommon.h | 19 +- .../include/directx/d3dcommon.idl | 27 + deps/DirectX-Headers/include/directx/d3dx12.h | 1 + .../include/directx/d3dx12_barriers.h | 8 +- .../directx/d3dx12_check_feature_support.h | 146 +- .../include/directx/d3dx12_core.h | 111 + .../directx/d3dx12_pipeline_state_stream.h | 336 +- .../directx/d3dx12_property_format_table.h | 124 + .../include/directx/d3dx12_render_pass.h | 54 +- .../include/directx/d3dx12_resource_helpers.h | 202 + .../include/directx/d3dx12_root_signature.h | 296 +- .../include/directx/d3dx12_state_object.h | 1500 +- .../include/directx/dxcore_interface.h | 187 +- .../include/directx/dxgicommon.idl | 1 + .../include/directx/dxgiformat.h | 2 + .../include/directx/dxgiformat.idl | 2 + .../DirectX-Headers/include/dxguids/dxguids.h | 2 + deps/DirectX-Headers/meson.build | 35 - deps/DirectX-Headers/meson_options.txt | 7 - .../src/d3dx12_property_format_table.cpp | 2445 ++ deps/ShaderTranspiler | 2 +- deps/VulkanMemoryAllocator/CMakeLists.txt | 90 +- deps/VulkanMemoryAllocator/LICENSE.txt | 2 +- deps/VulkanMemoryAllocator/README.md | 64 +- .../include/vk_mem_alloc.h | 3803 +-- deps/VulkanMemoryAllocator/src/CMakeLists.txt | 160 +- deps/VulkanMemoryAllocator/src/Common.cpp | 2 +- deps/VulkanMemoryAllocator/src/Common.h | 2 +- .../src/Shaders/CMakeLists.txt | 32 + .../src/Shaders/CompileShaders.bat | 4 + .../src/Shaders/Shader.frag | 37 + .../src/Shaders/Shader.vert | 42 + .../src/Shaders/SparseBindingTest.comp | 44 + .../src/SparseBindingTest.cpp | 597 + .../src/SparseBindingTest.h | 29 + deps/VulkanMemoryAllocator/src/Tests.cpp | 8350 ++++++ deps/VulkanMemoryAllocator/src/Tests.h | 32 + deps/VulkanMemoryAllocator/src/VmaUsage.cpp | 2 +- deps/VulkanMemoryAllocator/src/VmaUsage.h | 6 +- .../src/VulkanSample.cpp | 2711 ++ .../src/cmake/Config.cmake.in | 10 - .../src/cmake/install_target.cmake | 32 - deps/volk copy/.github/workflows/build.yml | 66 + deps/volk copy/.github/workflows/update.yml | 33 + deps/volk copy/.gitignore | 2 + deps/volk copy/CMakeLists.txt | 137 + deps/volk copy/LICENSE.md | 19 + deps/volk copy/README.md | 99 + deps/volk copy/cmake/volkConfig.cmake.in | 21 + deps/volk copy/generate.py | 194 + deps/volk copy/volk.c | 3200 +++ deps/volk copy/volk.h | 2075 ++ include/RGL/Common.hpp | 1 + include/RGL/Core.hpp | 9 +- include/RGL/RenderPass.hpp | 2 +- include/RGL/Texture.hpp | 2 +- include/RGL/TextureFormat.hpp | 8 +- src/D3D12Buffer.cpp | 2 +- src/D3D12Buffer.hpp | 2 +- src/D3D12CommandBuffer.cpp | 14 +- src/D3D12CommandBuffer.hpp | 2 +- src/D3D12CommandQueue.hpp | 2 +- src/D3D12ComputePipeline.hpp | 2 +- src/D3D12Device.cpp | 13 +- src/D3D12Device.hpp | 2 +- src/D3D12DynamicDescriptorHeap.hpp | 2 +- src/D3D12RenderPipeline.cpp | 10 +- src/D3D12RenderPipeline.hpp | 4 +- src/D3D12ShaderLibrary.hpp | 2 +- src/D3D12Swapchain.cpp | 2 +- src/D3D12Swapchain.hpp | 2 +- src/D3D12Synchronization.hpp | 2 +- src/D3D12Texture.hpp | 3 +- src/D3D12TrackedResource.hpp | 2 +- src/MTLCommandBuffer.mm | 22 +- src/RGL.cpp | 21 +- src/RGLD3D12.hpp | 3 +- src/RGLD3D12Common.cpp | 33 +- src/RGLMTLCommon.mm | 2 + src/RGLVk.hpp | 9 +- src/RGLVkCommon.cpp | 12 +- src/Texture.cpp | 3 +- src/VkBuffer.cpp | 3 +- src/VkBuffer.hpp | 7 +- src/VkCommandBuffer.cpp | 13 +- src/VkCommandBuffer.hpp | 2 +- src/VkCommandQueue.hpp | 2 +- src/VkDevice.cpp | 66 +- src/VkDevice.hpp | 7 +- src/VkRenderPipeline.cpp | 8 +- src/VkSampler.hpp | 2 +- src/VkShaderLibrary.cpp | 4 +- src/VkShaderLibrary.hpp | 2 +- src/VkSurface.cpp | 11 +- src/VkSurface.hpp | 2 +- src/VkSwapchain.cpp | 2 +- src/VkSynchronization.hpp | 2 +- src/VkTexture.cpp | 3 +- src/VkTexture.hpp | 7 +- src/VmaUsage.cpp | 4 + tools/librglc/librglc.cpp | 14 +- 120 files changed, 47036 insertions(+), 12133 deletions(-) delete mode 100644 deps/DirectX-Headers/Android.bp delete mode 100644 deps/DirectX-Headers/CMakePresets.json create mode 100644 deps/DirectX-Headers/cmake/DirectX-Headers.pc.in create mode 100644 deps/DirectX-Headers/cmake/JoinPaths.cmake create mode 100644 deps/DirectX-Headers/include/directx/D3D12TokenizedProgramFormat.hpp create mode 100644 deps/DirectX-Headers/include/directx/DirectML.h create mode 100644 deps/DirectX-Headers/include/directx/d3dx12_property_format_table.h delete mode 100644 deps/DirectX-Headers/meson.build delete mode 100644 deps/DirectX-Headers/meson_options.txt create mode 100644 deps/DirectX-Headers/src/d3dx12_property_format_table.cpp create mode 100644 deps/VulkanMemoryAllocator/src/Shaders/CMakeLists.txt create mode 100644 deps/VulkanMemoryAllocator/src/Shaders/CompileShaders.bat create mode 100644 deps/VulkanMemoryAllocator/src/Shaders/Shader.frag create mode 100644 deps/VulkanMemoryAllocator/src/Shaders/Shader.vert create mode 100644 deps/VulkanMemoryAllocator/src/Shaders/SparseBindingTest.comp create mode 100644 deps/VulkanMemoryAllocator/src/SparseBindingTest.cpp create mode 100644 deps/VulkanMemoryAllocator/src/SparseBindingTest.h create mode 100644 deps/VulkanMemoryAllocator/src/Tests.cpp create mode 100644 deps/VulkanMemoryAllocator/src/Tests.h create mode 100644 deps/VulkanMemoryAllocator/src/VulkanSample.cpp delete mode 100644 deps/VulkanMemoryAllocator/src/cmake/Config.cmake.in delete mode 100644 deps/VulkanMemoryAllocator/src/cmake/install_target.cmake create mode 100644 deps/volk copy/.github/workflows/build.yml create mode 100644 deps/volk copy/.github/workflows/update.yml create mode 100644 deps/volk copy/.gitignore create mode 100644 deps/volk copy/CMakeLists.txt create mode 100644 deps/volk copy/LICENSE.md create mode 100644 deps/volk copy/README.md create mode 100644 deps/volk copy/cmake/volkConfig.cmake.in create mode 100644 deps/volk copy/generate.py create mode 100644 deps/volk copy/volk.c create mode 100644 deps/volk copy/volk.h create mode 100644 src/VmaUsage.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 15be179..db55e4d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,10 +36,6 @@ if (RGL_ENABLE_WEBGPU) set(RGL_WEBGPU_AVAILABLE ON CACHE INTERNAL "RGL WebGPU") endif() -if (RGL_RUNTIME_COMPILATION) -set(RGL_RUNTIME_COMPILER_LIB "librglc") -endif() - if (CMAKE_VS_PLATFORM_NAME STREQUAL "ARM64") set(RGL_DISABLE_VK ON CACHE INTERNAL "") endif() @@ -66,6 +62,13 @@ else() set(ST_ENABLE_WGSL OFF CACHE INTERNAL "") endif() set(ST_ENABLE_TEST OFF CACHE INTERNAL "") +if((WIN32 AND NOT WINDOWS_STORE) AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/deps/ShaderTranspiler/deps/DirectXShaderCompiler/CMakeLists.txt") + message("Building DXC from source") + set(ST_BUNDLED_DXC ON) +else() + message("Not building DXC from source") + set(ST_BUNDLED_DXC OFF) +endif() add_subdirectory(deps/ShaderTranspiler EXCLUDE_FROM_ALL) file(GLOB_RECURSE LIBRGLC_SOURCES "tools/librglc/*.cpp" "tools/librglc/*.hpp") add_library(librglc ${LIBRGLC_SOURCES}) @@ -95,29 +98,46 @@ if (RGL_ENABLE_RGLC) ) endif() -find_package(Vulkan) - -if(CMAKE_SYSTEM_NAME MATCHES "WindowsStore" OR RGL_DISABLE_VK OR APPLE OR CMAKE_SYSTEM_NAME MATCHES "Emscripten") +if(WINDOWS_STORE OR RGL_DISABLE_VK OR APPLE OR CMAKE_SYSTEM_NAME MATCHES "Emscripten") set(VK_FORCE_DISABLED ON) else() set(VK_FORCE_DISABLED OFF) endif() -if (NOT VK_FORCE_DISABLED AND Vulkan_FOUND) - - - set(VK_LIBS ${Vulkan_LIBRARIES} VulkanMemoryAllocator) +if (NOT VK_FORCE_DISABLED) + add_subdirectory(deps/volk EXCLUDE_FROM_ALL) + target_compile_definitions(volk PUBLIC NOMINMAX=1) # Get our vendored headers - set(VK_INCLUDE deps/VulkanMemoryAllocator/include deps/Vulkan-Headers/include deps/Vulkan-Utility-Libraries/include) + set(VK_INCLUDE deps/Vulkan-Headers/include deps/Vulkan-Utility-Libraries/include) + target_include_directories(volk PUBLIC ${VK_INCLUDE}) + if (LINUX) + target_compile_definitions(volk PRIVATE VK_USE_PLATFORM_XLIB_KHR VK_USE_PLATFORM_WAYLAND_KHR) + elseif(ANDROID) + target_compile_definitions(volk PRIVATE VK_USE_PLATFORM_ANDROID_KHR) + elseif(WIN32 OR WINDOWS_STORE) + target_compile_definitions(volk PRIVATE VK_USE_PLATFORM_WIN32_KHR) + endif() - target_compile_definitions(${PROJECT_NAME} PUBLIC RGL_VK_AVAILABLE=1) + target_compile_definitions(${PROJECT_NAME} PUBLIC RGL_VK_AVAILABLE=1 ) set(RGL_VK_AVAILABLE ON CACHE INTERNAL "RGL Vulkan") - set(VMA_STATIC_VULKAN_FUNCTIONS ON) add_subdirectory(deps/VulkanMemoryAllocator EXCLUDE_FROM_ALL) - target_include_directories(VulkanMemoryAllocator PUBLIC ${Vulkan_INCLUDE_DIRS}) - target_include_directories(${PROJECT_NAME} PUBLIC ${Vulkan_INCLUDE_DIRS}) # so that library users get the vk paths if applicable - target_compile_features(VulkanMemoryAllocator PUBLIC cxx_std_20) + target_compile_definitions(VulkanMemoryAllocator INTERFACE VMA_STATIC_VULKAN_FUNCTIONS=0 VMA_DYNAMIC_VULKAN_FUNCTIONS=0) + + target_link_libraries(${PROJECT_NAME} + PUBLIC + volk + PRIVATE + GPUOpen::VulkanMemoryAllocator + ) + + set_target_properties(VulkanMemoryAllocator volk PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries") + if (TARGET loader-opt) + set_target_properties(loader-opt loader-unknown-chain PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries") + endif() + if(RGL_USE_MINIVKSDK) + set_target_properties(vulkan vvl VkLayer_utils loader_asm_gen_files PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries") + endif() else() target_compile_definitions(${PROJECT_NAME} PUBLIC RGL_VK_AVAILABLE=0) set(RGL_VK_AVAILABLE OFF CACHE INTERNAL "RGL Vulkan") @@ -125,7 +145,6 @@ endif() if(MSVC AND NOT RGL_DISABLE_DX) add_subdirectory(deps/DirectX-Headers EXCLUDE_FROM_ALL) - set(DX12_LIBRARIES "d3d12.lib" "DirectX-Headers" "DirectX-Guids" "dxgi.lib" "d3dcompiler.lib" "D3D12MemoryAllocator" "DirectXTK12") target_compile_definitions(${PROJECT_NAME} PUBLIC RGL_DX12_AVAILABLE=1) set(RGL_DX12_AVAILABLE ON CACHE INTERNAL "RGL DX12") @@ -133,19 +152,26 @@ if(MSVC AND NOT RGL_DISABLE_DX) set(BUILD_XAUDIO_WIN10 OFF CACHE INTERNAL "") add_subdirectory("deps/DirectXTK12" EXCLUDE_FROM_ALL) - set_target_properties("DirectX-Guids" "DirectXTK12" PROPERTIES - FOLDER "${RGL_IDE_ROOT}/Libraries" - ) target_include_directories(${PROJECT_NAME} PUBLIC "deps/DirectXTK12/Inc") # PIX stuff - add_subdirectory(deps/PixEvents-cmake) - set(PIXLIB $<$>:WinPixEventRuntime>) - set_target_properties("WinPixEventRuntime" "WinPixEventRuntime_ETW" "PixDecoder" PROPERTIES - FOLDER "${RGL_IDE_ROOT}/Libraries/" -) + set_target_properties("WinPixEventRuntime" "WinPixEventRuntime_ETW" "PixDecoder" "DirectX-Guids" "DirectXTK12" DirectX-Headers PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries/") + + target_link_libraries(${PROJECT_NAME} + PRIVATE + d3d12.lib + DirectX-Headers + DirectX-Guids + dxgi.lib + d3dcompiler.lib + D3D12MemoryAllocator + DirectXTK12 + $<$>:WinPixEventRuntime> + ) + + set_target_properties(D3D12MemoryAllocator PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries") else() target_compile_definitions(${PROJECT_NAME} PUBLIC RGL_DX12_AVAILABLE=0) set(RGL_DX12_AVAILABLE OFF CACHE INTERNAL "RGL DX12") @@ -158,6 +184,13 @@ if(APPLE) find_library(METAL_LIB Metal REQUIRED) find_library(QZC_LIB QuartzCore REQUIRED) set(RGL_MTL_AVAILABLE ON CACHE INTERNAL "RGL Metal") + + target_link_libraries(${PROJECT_NAME} + PRIVATE + ${FOUNDATION_LIB} + ${METAL_LIB} + ${QZC_LIB} + ) else() target_compile_definitions(${PROJECT_NAME} PUBLIC RGL_MTL_AVAILABLE=0) set(RGL_MTL_AVAILABLE OFF CACHE INTERNAL "RGL Metal") @@ -169,23 +202,17 @@ else() target_compile_definitions(${PROJECT_NAME} PUBLIC RGL_WEBGPU_AVAILABLE=0) endif() -target_link_libraries(${PROJECT_NAME} PRIVATE - ${VK_LIBS} - ${DX12_LIBRARIES} - ${FOUNDATION_LIB} - ${METAL_LIB} - ${QZC_LIB} - ${X11_LIBRARIES} - ${RGL_RUNTIME_COMPILER_LIB} - ${PIXLIB} - SPIRV-Reflect -) - -if (APPLE) -target_include_directories(${PROJECT_NAME} PRIVATE "tools/librglc/include/") if (RGL_RUNTIME_COMPILATION) - target_compile_definitions(${PROJECT_NAME} PRIVATE "RGL_CAN_RUNTIME_COMPILE") + target_link_libraries(${PROJECT_NAME} PRIVATE librglc) endif() + +target_link_libraries(${PROJECT_NAME} PRIVATE SPIRV-Reflect ${X11_LIBRARIES}) + +if (APPLE) + target_include_directories(${PROJECT_NAME} PRIVATE "tools/librglc/include/") + if (RGL_RUNTIME_COMPILATION) + target_compile_definitions(${PROJECT_NAME} PRIVATE "RGL_CAN_RUNTIME_COMPILE") + endif() endif() set(AFTERMATH_DIR "AftermathSDK") @@ -211,6 +238,8 @@ target_include_directories(${PROJECT_NAME} "include" ) +target_compile_definitions(${PROJECT_NAME} PUBLIC NOMINMAX=1) + set_target_properties("RGL" ${rglc_exe} "librglc" PROPERTIES FOLDER "${RGL_IDE_ROOT}" XCODE_GENERATE_SCHEME ON @@ -224,7 +253,7 @@ set_target_properties("libtint" "tint_diagnostic_utils" PROPERTIES ) endif() -set_target_properties("GenericCodeGen" "glslang" "MachineIndependent" "OGLCompiler" "OSDependent" "SPIRV" "SPVRemapper" "glslang-default-resource-limits" PROPERTIES +set_target_properties("GenericCodeGen" "glslang" "OGLCompiler" "MachineIndependent" "OSDependent" "SPIRV" "SPVRemapper" "glslang-default-resource-limits" PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries/glslang" ) @@ -237,12 +266,12 @@ set_target_properties( set_target_properties( "spirv-cross-core" - "spirv-cross-glsl" "spirv-cross-hlsl" "spirv-cross-msl" "spirv-cross-reflect" "spirv-cross-cpp" "spirv-cross-util" "HLSL" + "spirv-cross-glsl" "spirv-cross-hlsl" "spirv-cross-msl" "spirv-cross-reflect" "spirv-cross-cpp" "spirv-cross-util" PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries/SPIRV-Cross" ) -if(ST_BUNDLED_DXC) +if(ST_BUNDLED_DXC AND NOT WINDOWS_STORE) function(dxc_set_for_dir DIR) get_property(TGTS DIRECTORY "${DIR}" PROPERTY BUILDSYSTEM_TARGETS) set_target_properties( @@ -259,20 +288,6 @@ if(ST_BUNDLED_DXC) dxc_set_for_dir("${CMAKE_CURRENT_LIST_DIR}/deps/ShaderTranspiler/deps/DirectXShaderCompiler") endif() -if (RGL_VK_AVAILABLE) - set_target_properties(VulkanMemoryAllocator PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries") - if (TARGET loader-opt) - set_target_properties(loader-opt loader-unknown-chain PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries") - endif() - if(RGL_USE_MINIVKSDK) - set_target_properties(vulkan vvl VkLayer_utils loader_asm_gen_files PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries") - endif() -endif() -if (RGL_DX12_AVAILABLE) - set_target_properties(D3D12MemoryAllocator PROPERTIES FOLDER "${RGL_IDE_ROOT}/Libraries") -endif() - - if (NOT RGL_SKIP_BACKEND_CHECK) if (RGL_VK_AVAILABLE OR RGL_DX12_AVAILABLE OR RGL_MTL_AVAILABLE OR RGL_WEBGPU_AVAILABLE) else() diff --git a/README.md b/README.md index 68276b7..68e7788 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ RavEngine Graphics Library - a thin RHI for Vulkan, DirectX12, and Metal - Windows 10+ (Arm64 + x86_64) - Windows 10+ UWP (Arm64 + x86_64) - Linux -- Android (x86, x86_64, arm, arm64) - WebAssembly (WIP) ### Getting Started diff --git a/deps/DirectX-Headers/Android.bp b/deps/DirectX-Headers/Android.bp deleted file mode 100644 index afba864..0000000 --- a/deps/DirectX-Headers/Android.bp +++ /dev/null @@ -1,14 +0,0 @@ -cc_library_headers { - name: "DirectX-Headers", - export_include_dirs: ["include", "include/wsl/stubs"], - vendor_available: true, -} - -cc_library_static { - name: "DirectX-Guids", - header_libs: ["DirectX-Headers"], - local_include_dirs: ["include/dxguids"], - srcs: ["src/dxguids.cpp"], - cppflags: ["-Wno-non-virtual-dtor", "-Wno-unused-value"], - vendor_available: true, -} diff --git a/deps/DirectX-Headers/CMakeLists.txt b/deps/DirectX-Headers/CMakeLists.txt index db9e2d6..0cd99ab 100644 --- a/deps/DirectX-Headers/CMakeLists.txt +++ b/deps/DirectX-Headers/CMakeLists.txt @@ -3,12 +3,13 @@ cmake_minimum_required(VERSION 3.10.2) project(DirectX-Headers LANGUAGES CXX - VERSION 1.606.4 + VERSION 1.613.1 ) - +include(CTest) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) +enable_testing() # It's useful to know if you are a top level project or not, if your project is # being consumed via add_subdirectory @@ -32,19 +33,12 @@ include(GNUInstallDirs) # Enables consumers to add this library as a link target to automatically add # these include directories, regardless of whether this is referenced via subdirectory # or from an installed location -add_library(DirectX-Headers INTERFACE) -target_include_directories(DirectX-Headers SYSTEM INTERFACE +add_library(DirectX-Headers STATIC src/d3dx12_property_format_table.cpp) +target_include_directories(DirectX-Headers SYSTEM PUBLIC "$" "$" ) - -# For non-Windows targets, also add the WSL stubs to the include path -if (NOT WIN32) - target_include_directories(DirectX-Headers SYSTEM INTERFACE - "$" - "$" - ) -endif() +target_include_directories(DirectX-Headers PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/directx) add_library(Microsoft::DirectX-Headers ALIAS DirectX-Headers) @@ -53,6 +47,20 @@ target_link_libraries(DirectX-Guids PRIVATE DirectX-Headers) add_library(Microsoft::DirectX-Guids ALIAS DirectX-Guids) +# For non-Windows targets, also add the WSL stubs to the include path +if (NOT WIN32) + target_include_directories(DirectX-Headers SYSTEM PUBLIC + "$" + "$" + ) +elseif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) + # MinGW has RPC headers which define old versions, and complain if D3D + # headers are included before the RPC headers, since D3D headers were + # generated with new MIDL and "require" new RPC headers. + target_compile_options(DirectX-Headers PRIVATE "-D__REQUIRED_RPCNDR_H_VERSION__=475") + target_compile_options(DirectX-Guids PRIVATE "-D__REQUIRED_RPCNDR_H_VERSION__=475") +endif() + if (DXHEADERS_INSTALL) # Install the targets install(TARGETS DirectX-Headers DirectX-Guids @@ -81,12 +89,30 @@ if (DXHEADERS_INSTALL) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/directx-headers-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/directx-headers-config-version.cmake" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/directx-headers/cmake) -endif() + + # Create pkg-config file + include(cmake/JoinPaths.cmake) + # from: https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files + join_paths(DIRECTX_INCLUDEDIR_FOR_PKG_CONFIG "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}") + join_paths(DIRECTX_LIBDIR_FOR_PKG_CONFIG "\${prefix}" "${CMAKE_INSTALL_LIBDIR}") + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/DirectX-Headers.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/DirectX-Headers.pc" @ONLY) + + # Install the pkg-config file + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/DirectX-Headers.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -if (DXHEADERS_BUILD_TEST) - add_subdirectory(test) endif() -if (DXHEADERS_BUILD_GOOGLE_TEST) - add_subdirectory(googletest) +if (BUILD_TESTING) + if (DXHEADERS_BUILD_TEST) + add_subdirectory(test) + endif() + + if (DXHEADERS_BUILD_GOOGLE_TEST) + # We do not want to install GoogleTest when packaging DirectX-Headers. + set(INSTALL_GTEST OFF) + add_subdirectory(googletest) + endif() endif() diff --git a/deps/DirectX-Headers/CMakePresets.json b/deps/DirectX-Headers/CMakePresets.json deleted file mode 100644 index c114cf7..0000000 --- a/deps/DirectX-Headers/CMakePresets.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "version": 2, - "configurePresets": [ - { - "name": "base", - "displayName": "Basic Config", - "description": "Basic build using Ninja generator", - "generator": "Ninja", - "hidden": true, - "binaryDir": "${sourceDir}/out/build/${presetName}", - "cacheVariables": { "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" } - }, - - { - "name": "x64", - "architecture": { - "value": "x64", - "strategy": "external" - }, - "hidden": true - }, - { - "name": "x86", - "architecture": { - "value": "x86", - "strategy": "external" - }, - "hidden": true - }, - { - "name": "ARM", - "architecture": { - "value": "arm", - "strategy": "external" - }, - - "hidden": true - }, - { - "name": "ARM64", - "architecture": { - "value": "arm64", - "strategy": "external" - }, - "hidden": true - }, - - { - "name": "Debug", - "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }, - "hidden": true - }, - { - "name": "Release", - "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" }, - "hidden": true - }, - - { - "name": "MSVC", - "hidden": true, - "cacheVariables": { - "CMAKE_CXX_COMPILER": "cl.exe", - "CMAKE_C_COMPILER": "cl.exe" - }, - "toolset": { - "value": "host=x64", - "strategy": "external" - } - }, - { - "name": "Clang", - "hidden": true, - "cacheVariables": { - "CMAKE_CXX_COMPILER": "clang-cl.exe", - "CMAKE_C_COMPILER": "clang-cl.exe" - }, - "toolset": { - "value": "host=x64", - "strategy": "external" - } - }, - { - "name": "GNUC", - "hidden": true, - "cacheVariables": { - "CMAKE_CXX_COMPILER": "g++.exe", - "CMAKE_C_COMPILER": "gcc.exe", - "DXHEADERS_BUILD_TEST": false - }, - "toolset": { - "value": "host=x64", - "strategy": "external" - } - }, - { - "name": "Intel", - "hidden": true, - "cacheVariables": { - "CMAKE_CXX_COMPILER": "icl.exe", - "DXHEADERS_BUILD_GOOGLE_TEST": false, - "DXHEADERS_BUILD_TEST": false - }, - "toolset": { - "value": "host=x64", - "strategy": "external" - } - }, - { - "name": "IntelLLVM", - "hidden": true, - "cacheVariables": { - "CMAKE_CXX_COMPILER": "icx.exe", - "DXHEADERS_BUILD_GOOGLE_TEST": false - }, - "toolset": { - "value": "host=x64", - "strategy": "external" - } - }, - - { - "name": "UWP", - "cacheVariables": { - "CMAKE_SYSTEM_NAME": "WindowsStore", - "CMAKE_SYSTEM_VERSION": "10.0" - }, - "hidden": true - }, - { - "name": "NoTests", - "hidden": true, - "cacheVariables": { - "DXHEADERS_BUILD_TEST": false, - "DXHEADERS_BUILD_GOOGLE_TEST": false - } - }, - - { "name": "x64-Debug" , "description": "MSVC for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "MSVC" ] }, - { "name": "x64-Release" , "description": "MSVC for x64 (Release)", "inherits": [ "base", "x64", "Release", "MSVC" ] }, - { "name": "x86-Debug" , "description": "MSVC for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "MSVC" ] }, - { "name": "x86-Release" , "description": "MSVC for x86 (Release)", "inherits": [ "base", "x86", "Release", "MSVC" ] }, - { "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] }, - { "name": "arm64-Release", "description": "MSVC for ARM64 (Release)", "inherits": [ "base", "ARM64", "Release", "MSVC" ] }, - - { "name": "x64-Debug-UWP" , "description": "MSVC for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "MSVC", "UWP" ] }, - { "name": "x64-Release-UWP" , "description": "MSVC for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "MSVC", "UWP" ] }, - { "name": "x86-Debug-UWP" , "description": "MSVC for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "MSVC", "UWP" ] }, - { "name": "x86-Release-UWP" , "description": "MSVC for x86 (Release) for UWP", "inherits": [ "base", "x86", "Release", "MSVC", "UWP" ] }, - { "name": "arm-Debug-UWP" , "description": "MSVC for ARM (Debug) for UWP", "inherits": [ "base", "ARM", "Debug", "MSVC", "UWP" ] }, - { "name": "arm-Release-UWP" , "description": "MSVC for ARM (Release) for UWP", "inherits": [ "base", "ARM", "Release", "MSVC", "UWP" ] }, - { "name": "arm64-Debug-UWP" , "description": "MSVC for ARM64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "MSVC", "UWP" ] }, - { "name": "arm64-Release-UWP", "description": "MSVC for ARM64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "MSVC", "UWP" ] }, - - { "name": "x64-Debug-Clang" , "description": "Clang/LLVM for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "Clang" ] }, - { "name": "x64-Release-Clang" , "description": "Clang/LLVM for x64 (Release)", "inherits": [ "base", "x64", "Release", "Clang" ] }, - { "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang" ], "environment": { "CXXFLAGS": "-m32" } }, - { "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang" ], "environment": { "CXXFLAGS": "-m32" } }, - { "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, - { "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, - - { "name": "x64-Debug-ICC" , "description": "Intel Classic Compiler (Debug)", "inherits": [ "base", "x64", "Debug", "Intel" ] }, - { "name": "x64-Release-ICC" , "description": "Intel Classic Compiler (Release)", "inherits": [ "base", "x64", "Release", "Intel" ] }, - { "name": "x86-Debug-ICC" , "description": "Intel Classic Compiler (Debug)", "inherits": [ "base", "x86", "Debug", "Intel" ] }, - { "name": "x86-Release-ICC" , "description": "Intel Classic Compiler (Release)", "inherits": [ "base", "x86", "Release", "Intel" ] }, - - { "name": "x64-Debug-ICX" , "description": "Intel oneAPI Compiler (Debug)", "inherits": [ "base", "x64", "Debug", "IntelLLVM" ] }, - { "name": "x64-Release-ICX" , "description": "Intel oneAPI Compiler (Release)", "inherits": [ "base", "x64", "Release", "IntelLLVM" ] }, - { "name": "x86-Debug-ICX" , "description": "Intel oneAPI Compiler (Debug)", "inherits": [ "base", "x86", "Debug", "IntelLLVM" ] }, - { "name": "x86-Release-ICX" , "description": "Intel oneAPI Compiler (Release)", "inherits": [ "base", "x86", "Release", "IntelLLVM" ] }, - - { "name": "x64-Debug-MinGW" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "GNUC" ], "environment": { "PATH": "$penv{PATH};c:/mingw64/bin" } }, - { "name": "x64-Release-MinGW", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "GNUC" ], "environment": { "PATH": "$penv{PATH};c:/mingw64/bin" } }, - { "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC" ], "environment": { "PATH": "$penv{PATH};c:/mingw32/bin" } }, - { "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC" ], "environment": { "PATH": "$penv{PATH};c:/mingw32/bin" } }, - - { "name": "x64-Debug-WSL" , "description": "WSL x64 (Debug) for Windows 11", "inherits": [ "base", "x64", "Debug" ] }, - { "name": "x64-Release-WSL" , "description": "WSL x64 (Release) for Windows 11", "inherits": [ "base", "x64", "Release" ] }, - { "name": "arm64-Debug-WSL" , "description": "WSL AArch64 (Debug) for Windows 11", "inherits": [ "base", "ARM64", "Debug" ] }, - { "name": "arm64-Release-WSL", "description": "WSL AArch64 (Release) for Windows 11", "inherits": [ "base", "ARM64", "Release" ] }, - - { "name": "x64-Debug-Linux" , "description": "Linux x64 (Debug)", "inherits": [ "base", "x64", "Debug", "NoTests" ] }, - { "name": "x64-Release-Linux" , "description": "Linux x64 (Release)", "inherits": [ "base", "x64", "Release", "NoTests" ] }, - { "name": "arm64-Debug-Linux" , "description": "Linux AArch64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "NoTests" ] }, - { "name": "arm64-Release-Linux", "description": "Linux AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "NoTests" ] } - ] -} \ No newline at end of file diff --git a/deps/DirectX-Headers/SECURITY.md b/deps/DirectX-Headers/SECURITY.md index 12fbd83..b3c89ef 100644 --- a/deps/DirectX-Headers/SECURITY.md +++ b/deps/DirectX-Headers/SECURITY.md @@ -1,41 +1,41 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). - - \ No newline at end of file + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). + + diff --git a/deps/DirectX-Headers/cmake/DirectX-Headers.pc.in b/deps/DirectX-Headers/cmake/DirectX-Headers.pc.in new file mode 100644 index 0000000..f33d3ff --- /dev/null +++ b/deps/DirectX-Headers/cmake/DirectX-Headers.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@DIRECTX_LIBDIR_FOR_PKG_CONFIG@ +includedir=@DIRECTX_INCLUDEDIR_FOR_PKG_CONFIG@ + +Name: @PROJECT_NAME@ +Description: Headers for using D3D12 +URL: https://github.com/microsoft/DirectX-Headers +Version: @PROJECT_VERSION@ +Cflags: -I${includedir} +Libs: -lDirectX-Headers -lDirectX-Guids diff --git a/deps/DirectX-Headers/cmake/JoinPaths.cmake b/deps/DirectX-Headers/cmake/JoinPaths.cmake new file mode 100644 index 0000000..c68d91b --- /dev/null +++ b/deps/DirectX-Headers/cmake/JoinPaths.cmake @@ -0,0 +1,23 @@ +# This module provides function for joining paths +# known from most languages +# +# SPDX-License-Identifier: (MIT OR CC0-1.0) +# Copyright 2020 Jan Tojnar +# https://github.com/jtojnar/cmake-snips +# +# Modelled after Python’s os.path.join +# https://docs.python.org/3.7/library/os.path.html#os.path.join +# Windows not supported +function(join_paths joined_path first_path_segment) + set(temp_path "${first_path_segment}") + foreach(current_segment IN LISTS ARGN) + if(NOT ("${current_segment}" STREQUAL "")) + if(IS_ABSOLUTE "${current_segment}") + set(temp_path "${current_segment}") + else() + set(temp_path "${temp_path}/${current_segment}") + endif() + endif() + endforeach() + set(${joined_path} "${temp_path}" PARENT_SCOPE) +endfunction() diff --git a/deps/DirectX-Headers/include/directx/D3D12TokenizedProgramFormat.hpp b/deps/DirectX-Headers/include/directx/D3D12TokenizedProgramFormat.hpp new file mode 100644 index 0000000..b951454 --- /dev/null +++ b/deps/DirectX-Headers/include/directx/D3D12TokenizedProgramFormat.hpp @@ -0,0 +1,2634 @@ +#pragma once +//********************************************************* +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +// +//********************************************************* +// +// High Level Goals +// +// - Serve as the runtime/DDI representation for all D3D11 tokenized code, +// for all classes of programs, including pixel program, vertex program, +// geometry program, etc. +// +// - Any information that HLSL needs to give to drivers is encoded in +// this token format in some form. +// +// - Enable common tools and source code for managing all tokenizable +// program formats. +// +// - Support extensible token definitions, allowing full customizations for +// specific program classes, while maintaining general conventions for all +// program models. +// +// - Binary backwards compatible with D3D10. Any token name that was originally +// defined with "D3D10" in it is unchanged; D3D11 only adds new tokens. +// +// ---------------------------------------------------------------------------- +// +// Low Level Feature Summary +// +// - DWORD based tokens always, for simplicity +// - Opcode token is generally a single DWORD, though there is a bit indicating +// if extended information (extra DWORD(s)) are present +// - Operand tokens are a completely self contained, extensible format, +// with scalar and 4-vector data types as first class citizens, but +// allowance for extension to n-component vectors. +// - Initial operand token identifies register type, register file +// structure/dimensionality and mode of indexing for each dimension, +// and choice of component selection mechanism (i.e. mask vs. swizzle etc). +// - Optional additional extended operand tokens can defined things like +// modifiers (which are not needed by default). +// - Operand's immediate index value(s), if needed, appear as subsequent DWORD +// values, and if relative addressing is specified, an additional completely +// self contained operand definition appears nested in the token sequence. +// +// ---------------------------------------------------------------------------- + +#include + +#pragma region Application Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) + +// ---------------------------------------------------------------------------- +// Version Token (VerTok) +// +// [07:00] minor version number (0-255) +// [15:08] major version number (0-255) +// [31:16] D3D10_SB_TOKENIZED_PROGRAM_TYPE +// +// ---------------------------------------------------------------------------- + +typedef enum D3D10_SB_TOKENIZED_PROGRAM_TYPE +{ + D3D10_SB_PIXEL_SHADER = 0, + D3D10_SB_VERTEX_SHADER = 1, + D3D10_SB_GEOMETRY_SHADER = 2, + + // D3D11 Shaders + D3D11_SB_HULL_SHADER = 3, + D3D11_SB_DOMAIN_SHADER = 4, + D3D11_SB_COMPUTE_SHADER = 5, + + // Subset of D3D12 Shaders where this field is referenced by runtime + // Entries from 6-12 are unique to state objects + // (e.g. library, callable and raytracing shaders) + D3D12_SB_MESH_SHADER = 13, + D3D12_SB_AMPLIFICATION_SHADER = 14, + + D3D11_SB_RESERVED0 = 0xFFF0 +} D3D10_SB_TOKENIZED_PROGRAM_TYPE; + +#define D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK 0xffff0000 +#define D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT 16 + +// DECODER MACRO: Retrieve program type from version token +#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_TYPE(VerTok) ((D3D10_SB_TOKENIZED_PROGRAM_TYPE)(((VerTok)&D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK)>>D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT)) + +#define D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK 0x000000f0 +#define D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT 4 +#define D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK 0x0000000f + +// DECODER MACRO: Retrieve major version # from version token +#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION(VerTok) (((VerTok)&D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK)>>D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT) +// DECODER MACRO: Retrieve minor version # from version token +#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION(VerTok) ((VerTok)&D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK) + +// ENCODER MACRO: Create complete VerTok +#define ENCODE_D3D10_SB_TOKENIZED_PROGRAM_VERSION_TOKEN(ProgType,MajorVer,MinorVer) ((((ProgType)<> D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_SHIFT) + +// ENCODER MACRO: Store instruction length +// portion of OpcodeToken0, in # of DWORDs +// including the opcode token(s). +// Valid range is 1-127. +#define ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(Length) (((Length)<>D3D10_SB_INSTRUCTION_TEST_BOOLEAN_SHIFT)) +// ENCODER MACRO: Store "zero" or "nonzero" in the opcode +// specific control range of OpcodeToken0 +#define ENCODE_D3D10_SB_INSTRUCTION_TEST_BOOLEAN(Boolean) (((Boolean)<>D3D11_SB_INSTRUCTION_PRECISE_VALUES_SHIFT)) +// ENCODER MACRO: Given a set of +// D3D10_SB_OPERAND_4_COMPONENT_[X|Y|Z|W] values +// or'd together, encode them in OpcodeToken0. +#define ENCODE_D3D11_SB_INSTRUCTION_PRECISE_VALUES(ComponentMask) (((ComponentMask)<>D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_SHIFT)) +// ENCODER MACRO: Encode the return type for the resinfo instruction +// in the opcode specific control range of OpcodeToken0 +#define ENCODE_D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE(ReturnType) (((ReturnType)<> D3D10_SB_OPCODE_EXTENDED_SHIFT) +// ENCODER MACRO: Store in OpcodeToken0 whether the opcode is extended +// by an additional opcode token. +#define ENCODE_D3D10_SB_OPCODE_EXTENDED(bExtended) (((bExtended)!=0)?D3D10_SB_OPCODE_EXTENDED_MASK:0) + +// ---------------------------------------------------------------------------- +// Extended Opcode Format (OpcodeToken1) +// +// If bit31 of an opcode token is set, the +// opcode has an additional extended opcode token DWORD +// directly following OpcodeToken0. Other tokens +// expected for the opcode, such as the operand +// token(s) always follow +// OpcodeToken0 AND OpcodeToken1..n (extended +// opcode tokens, if present). +// +// [05:00] D3D10_SB_EXTENDED_OPCODE_TYPE +// [30:06] if([05:00] == D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS) +// { +// This custom opcode contains controls for SAMPLE. +// [08:06] Ignored, 0. +// [12:09] U texel immediate offset (4 bit 2's comp) (0 default) +// [16:13] V texel immediate offset (4 bit 2's comp) (0 default) +// [20:17] W texel immediate offset (4 bit 2's comp) (0 default) +// [30:14] Ignored, 0. +// } +// else if( [05:00] == D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM ) +// { +// [10:06] D3D10_SB_RESOURCE_DIMENSION +// [22:11] When dimension is D3D11_SB_RESOURCE_DIMENSION_STRUCTURED_BUFFER this holds the buffer stride, otherwise 0 +// [30:23] Ignored, 0. +// } +// else if( [05:00] == D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE ) +// { +// [09:06] D3D10_SB_RESOURCE_RETURN_TYPE for component X +// [13:10] D3D10_SB_RESOURCE_RETURN_TYPE for component Y +// [17:14] D3D10_SB_RESOURCE_RETURN_TYPE for component Z +// [21:18] D3D10_SB_RESOURCE_RETURN_TYPE for component W +// [30:22] Ignored, 0. +// } +// else +// { +// [30:04] Ignored, 0. +// } +// [31] 0 normally. 1 there is another extended opcode. Any number +// of extended opcode tokens can be chained. It is possible that some extended +// opcode tokens could include multiple DWORDS - that is defined +// on a case by case basis. +// +// ---------------------------------------------------------------------------- +typedef enum D3D10_SB_EXTENDED_OPCODE_TYPE +{ + D3D10_SB_EXTENDED_OPCODE_EMPTY = 0, + D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS = 1, + D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM = 2, + D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE = 3, +} D3D10_SB_EXTENDED_OPCODE_TYPE; +#define D3D11_SB_MAX_SIMULTANEOUS_EXTENDED_OPCODES 3 + +#define D3D10_SB_EXTENDED_OPCODE_TYPE_MASK 0x0000003f + +// DECODER MACRO: Given an extended opcode +// token (OpcodeToken1), figure out what type +// of token it is (from D3D10_SB_EXTENDED_OPCODE_TYPE enum) +// to be able to interpret the rest of the token's contents. +#define DECODE_D3D10_SB_EXTENDED_OPCODE_TYPE(OpcodeToken1) ((D3D10_SB_EXTENDED_OPCODE_TYPE)((OpcodeToken1)&D3D10_SB_EXTENDED_OPCODE_TYPE_MASK)) + +// ENCODER MACRO: Store extended opcode token +// type in OpcodeToken1. +#define ENCODE_D3D10_SB_EXTENDED_OPCODE_TYPE(ExtOpcodeType) ((ExtOpcodeType)&D3D10_SB_EXTENDED_OPCODE_TYPE_MASK) + +typedef enum D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD +{ + D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_U = 0, + D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_V = 1, + D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_W = 2, +} D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD; +#define D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD_MASK (3) +#define D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord) (9+4*((Coord)&D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD_MASK)) +#define D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_MASK(Coord) (0x0000000f<>(D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord)))) + +// ENCODER MACRO: Store the immediate texel address offset +// for U or V or W Coord (D3D10_SB_ADDRESS_OFFSET_COORD) in an extended +// opcode token (OpcodeToken1) that has extended opcode +// type == D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS (opcode type encoded separately) +// A 2's complement number is expected as input, from which the LSB 4 bits are extracted. +#define ENCODE_IMMEDIATE_D3D10_SB_ADDRESS_OFFSET(Coord,ImmediateOffset) (((ImmediateOffset)<>D3D11_SB_EXTENDED_RESOURCE_DIMENSION_SHIFT)) + +// ENCODER MACRO: Store resource dimension +// (D3D10_SB_RESOURCE_DIMENSION enum) into a +// an extended resource declaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM) +#define ENCODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION(ResourceDim) (((ResourceDim)<>D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_SHIFT) + +// ENCODER MACRO: Store resource dimension structure stride +// (12-bit unsigned integer) into a +// an extended resource declaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM) +#define ENCODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE(Stride) (((Stride)<> \ + (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS + D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT))&D3D10_SB_RESOURCE_RETURN_TYPE_MASK)) + +// ENCODER MACRO: Generate a resource return type for a component in an extended +// resource delcaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE) +#define ENCODE_D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE(ReturnType, Component) \ + (((ReturnType)&D3D10_SB_RESOURCE_RETURN_TYPE_MASK) << (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS + D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT)) + +// ---------------------------------------------------------------------------- +// Custom-Data Block Format +// +// DWORD 0 (CustomDataDescTok): +// [10:00] == D3D10_SB_OPCODE_CUSTOMDATA +// [31:11] == D3D10_SB_CUSTOMDATA_CLASS +// +// DWORD 1: +// 32-bit unsigned integer count of number +// of DWORDs in custom-data block, +// including DWORD 0 and DWORD 1. +// So the minimum value is 0x00000002, +// meaning empty custom-data. +// +// Layout of custom-data contents, for the various meta-data classes, +// not defined in this file. +// +// ---------------------------------------------------------------------------- + +typedef enum D3D10_SB_CUSTOMDATA_CLASS +{ + D3D10_SB_CUSTOMDATA_COMMENT = 0, + D3D10_SB_CUSTOMDATA_DEBUGINFO, + D3D10_SB_CUSTOMDATA_OPAQUE, + D3D10_SB_CUSTOMDATA_DCL_IMMEDIATE_CONSTANT_BUFFER, + D3D11_SB_CUSTOMDATA_SHADER_MESSAGE, + D3D11_SB_CUSTOMDATA_SHADER_CLIP_PLANE_CONSTANT_MAPPINGS_FOR_DX9, +} D3D10_SB_CUSTOMDATA_CLASS; + +#define D3D10_SB_CUSTOMDATA_CLASS_MASK 0xfffff800 +#define D3D10_SB_CUSTOMDATA_CLASS_SHIFT 11 +// DECODER MACRO: Find out what class of custom-data is present. +// The contents of the custom-data block are defined +// for each class of custom-data. +#define DECODE_D3D10_SB_CUSTOMDATA_CLASS(CustomDataDescTok) ((D3D10_SB_CUSTOMDATA_CLASS)(((CustomDataDescTok)&D3D10_SB_CUSTOMDATA_CLASS_MASK)>>D3D10_SB_CUSTOMDATA_CLASS_SHIFT)) +// ENCODER MACRO: Create complete CustomDataDescTok +#define ENCODE_D3D10_SB_CUSTOMDATA_CLASS(CustomDataClass) (ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_CUSTOMDATA)|(((CustomDataClass)<= D3D10_SB_OPERAND_INDEX_1D ) +// D3D10_SB_OPERAND_INDEX_REPRESENTATION for first operand index +// else +// Ignored, 0 +// [27:25] if( [21:20] >= D3D10_SB_OPERAND_INDEX_2D ) +// D3D10_SB_OPERAND_INDEX_REPRESENTATION for second operand index +// else +// Ignored, 0 +// [30:28] if( [21:20] == D3D10_SB_OPERAND_INDEX_3D ) +// D3D10_SB_OPERAND_INDEX_REPRESENTATION for third operand index +// else +// Ignored, 0 +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. +// +// ---------------------------------------------------------------------------- + +// Number of components in data vector referred to by operand. +typedef enum D3D10_SB_OPERAND_NUM_COMPONENTS +{ + D3D10_SB_OPERAND_0_COMPONENT = 0, + D3D10_SB_OPERAND_1_COMPONENT = 1, + D3D10_SB_OPERAND_4_COMPONENT = 2, + D3D10_SB_OPERAND_N_COMPONENT = 3 // unused for now +} D3D10_SB_OPERAND_NUM_COMPONENTS; +#define D3D10_SB_OPERAND_NUM_COMPONENTS_MASK 0x00000003 + +// DECODER MACRO: Extract from OperandToken0 how many components +// the data vector referred to by the operand contains. +// (D3D10_SB_OPERAND_NUM_COMPONENTS enum) +#define DECODE_D3D10_SB_OPERAND_NUM_COMPONENTS(OperandToken0) ((D3D10_SB_OPERAND_NUM_COMPONENTS)((OperandToken0)&D3D10_SB_OPERAND_NUM_COMPONENTS_MASK)) + +// ENCODER MACRO: Define in OperandToken0 how many components +// the data vector referred to by the operand contains. +// (D3D10_SB_OPERAND_NUM_COMPONENTS enum). +#define ENCODE_D3D10_SB_OPERAND_NUM_COMPONENTS(NumComp) ((NumComp)&D3D10_SB_OPERAND_NUM_COMPONENTS_MASK) + +typedef enum D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE +{ + D3D10_SB_OPERAND_4_COMPONENT_MASK_MODE = 0, // mask 4 components + D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MODE = 1, // swizzle 4 components + D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE = 2, // select 1 of 4 components +} D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE; + +#define D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK 0x0000000c +#define D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT 2 + +// DECODER MACRO: For an operand representing 4component data, +// extract from OperandToken0 the method for selecting data from +// the 4 components (D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE). +#define DECODE_D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE(OperandToken0) ((D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE)(((OperandToken0)&D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK)>>D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT)) + +// ENCODER MACRO: For an operand representing 4component data, +// encode in OperandToken0 a value from D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE +#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE(SelectionMode) (((SelectionMode)<>(D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SHIFT+2*((DestComp)&D3D10_SB_4_COMPONENT_NAME_MASK)))&D3D10_SB_4_COMPONENT_NAME_MASK)) + +// ENCODER MACRO: Generate a 4 component swizzle given +// 4 D3D10_SB_4_COMPONENT_NAME source values for dest +// components x, y, z, w respectively. +#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(XSrc,YSrc,ZSrc,WSrc) ((((XSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)| \ + (((YSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)<<2)| \ + (((ZSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)<<4)| \ + (((WSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)<<6) \ + )<>D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_SHIFT)) + +// ENCODER MACRO: Given a D3D10_SB_4_COMPONENT_NAME selecting +// a single component for D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE, +// encode it into OperandToken0 +#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SELECT_1(SelectedComp) (((SelectedComp)<>D3D10_SB_OPERAND_TYPE_SHIFT)) + +// ENCODER MACRO: Store operand type in OperandToken0. +#define ENCODE_D3D10_SB_OPERAND_TYPE(OperandType) (((OperandType)<>D3D10_SB_OPERAND_INDEX_DIMENSION_SHIFT)) + +// ENCODER MACRO: Store operand index dimension +// (D3D10_SB_OPERAND_INDEX_DIMENSION enum) in OperandToken0. +#define ENCODE_D3D10_SB_OPERAND_INDEX_DIMENSION(OperandIndexDim) (((OperandIndexDim)<>D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim))) + +// ENCODER MACRO: Store in OperandToken0 what representation +// an operand index is provided as (D3D10_SB_OPERAND_INDEX_REPRESENTATION enum), +// for index dimension [0], [1] or [2], depending on D3D10_SB_OPERAND_INDEX_DIMENSION. +#define ENCODE_D3D10_SB_OPERAND_INDEX_REPRESENTATION(Dim,IndexRepresentation) (((IndexRepresentation)<>D3D10_SB_OPERAND_EXTENDED_SHIFT) + +// ENCODER MACRO: Store in OperandToken0 whether the operand is extended +// by an additional operand token. +#define ENCODE_D3D10_SB_OPERAND_EXTENDED(bExtended) (((bExtended)!=0)?D3D10_SB_OPERAND_EXTENDED_MASK:0) + +// ---------------------------------------------------------------------------- +// Extended Instruction Operand Format (OperandToken1) +// +// If bit31 of an operand token is set, the +// operand has additional data in a second DWORD +// directly following OperandToken0. Other tokens +// expected for the operand, such as immmediate +// values or relative address operands (full +// operands in themselves) always follow +// OperandToken0 AND OperandToken1..n (extended +// operand tokens, if present). +// +// [05:00] D3D10_SB_EXTENDED_OPERAND_TYPE +// [16:06] if([05:00] == D3D10_SB_EXTENDED_OPERAND_MODIFIER) +// { +// [13:06] D3D10_SB_OPERAND_MODIFIER +// [16:14] Min Precision: D3D11_SB_OPERAND_MIN_PRECISION +// [17:17] Non-uniform: D3D12_SB_OPERAND_NON_UNIFORM +// } +// else +// { +// [17:06] Ignored, 0. +// } +// [30:18] Ignored, 0. +// [31] 0 normally. 1 if second order extended operand definition, +// meaning next DWORD contains yet ANOTHER extended operand +// description. Currently no second order extensions defined. +// This would be useful if a particular extended operand does +// not have enough space to store the required information in +// a single token and so is extended further. +// +// ---------------------------------------------------------------------------- + +typedef enum D3D10_SB_EXTENDED_OPERAND_TYPE +{ + D3D10_SB_EXTENDED_OPERAND_EMPTY = 0, // Might be used if this + // enum is full and + // further extended opcode + // is needed. + D3D10_SB_EXTENDED_OPERAND_MODIFIER = 1, +} D3D10_SB_EXTENDED_OPERAND_TYPE; +#define D3D10_SB_EXTENDED_OPERAND_TYPE_MASK 0x0000003f + +// DECODER MACRO: Given an extended operand +// token (OperandToken1), figure out what type +// of token it is (from D3D10_SB_EXTENDED_OPERAND_TYPE enum) +// to be able to interpret the rest of the token's contents. +#define DECODE_D3D10_SB_EXTENDED_OPERAND_TYPE(OperandToken1) ((D3D10_SB_EXTENDED_OPERAND_TYPE)((OperandToken1)&D3D10_SB_EXTENDED_OPERAND_TYPE_MASK)) + +// ENCODER MACRO: Store extended operand token +// type in OperandToken1. +#define ENCODE_D3D10_SB_EXTENDED_OPERAND_TYPE(ExtOperandType) ((ExtOperandType)&D3D10_SB_EXTENDED_OPERAND_TYPE_MASK) + +typedef enum D3D10_SB_OPERAND_MODIFIER +{ + D3D10_SB_OPERAND_MODIFIER_NONE = 0, // Nop. This is the implied + // default if the extended + // operand is not present for + // an operand for which source + // modifiers are meaningful + D3D10_SB_OPERAND_MODIFIER_NEG = 1, // Negate + D3D10_SB_OPERAND_MODIFIER_ABS = 2, // Absolute value, abs() + D3D10_SB_OPERAND_MODIFIER_ABSNEG = 3, // -abs() +} D3D10_SB_OPERAND_MODIFIER; +#define D3D10_SB_OPERAND_MODIFIER_MASK 0x00003fc0 +#define D3D10_SB_OPERAND_MODIFIER_SHIFT 6 + +// DECODER MACRO: Given a D3D10_SB_EXTENDED_OPERAND_MODIFIER +// extended token (OperandToken1), determine the source modifier +// (D3D10_SB_OPERAND_MODIFIER enum) +#define DECODE_D3D10_SB_OPERAND_MODIFIER(OperandToken1) ((D3D10_SB_OPERAND_MODIFIER)(((OperandToken1)&D3D10_SB_OPERAND_MODIFIER_MASK)>>D3D10_SB_OPERAND_MODIFIER_SHIFT)) + +// ENCODER MACRO: Generate a complete source modifier extended token +// (OperandToken1), given D3D10_SB_OPERAND_MODIFIER enum (the +// ext. operand type is also set to D3D10_SB_EXTENDED_OPERAND_MODIFIER). +#define ENCODE_D3D10_SB_EXTENDED_OPERAND_MODIFIER(SourceMod) ((((SourceMod)<> D3D11_SB_OPERAND_MIN_PRECISION_SHIFT)) + +// ENCODER MACRO: Encode minimum precision for execution +// into the extended operand token, OperandToken1 +#define ENCODE_D3D11_SB_OPERAND_MIN_PRECISION(MinPrecision) (((MinPrecision)<< D3D11_SB_OPERAND_MIN_PRECISION_SHIFT)& D3D11_SB_OPERAND_MIN_PRECISION_MASK) + + +// Non-uniform extended operand modifier. +#define D3D12_SB_OPERAND_NON_UNIFORM_MASK 0x00020000 +#define D3D12_SB_OPERAND_NON_UNIFORM_SHIFT 17 + +// DECODER MACRO: For an OperandToken1 that can specify a non-uniform operand +#define DECODE_D3D12_SB_OPERAND_NON_UNIFORM(OperandToken1) (((OperandToken1)& D3D12_SB_OPERAND_NON_UNIFORM_MASK)>> D3D12_SB_OPERAND_NON_UNIFORM_SHIFT) + +// ENCODER MACRO: Encode non-uniform state into the extended operand token, OperandToken1 +#define ENCODE_D3D12_SB_OPERAND_NON_UNIFORM(NonUniform) (((NonUniform)<< D3D12_SB_OPERAND_NON_UNIFORM_SHIFT)& D3D12_SB_OPERAND_NON_UNIFORM_MASK) + + +#define D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK 0x80000000 +#define D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT 31 +// DECODER MACRO: Determine if an extended operand token +// (OperandToken1) is further extended by yet another token +// (OperandToken2). Currently there are no secondary +// extended operand tokens. +#define DECODE_IS_D3D10_SB_OPERAND_DOUBLE_EXTENDED(OperandToken1) (((OperandToken1)&D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK)>>D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT) + +// ENCODER MACRO: Store in OperandToken1 whether the operand is extended +// by an additional operand token. Currently there are no secondary +// extended operand tokens. +#define ENCODE_D3D10_SB_OPERAND_DOUBLE_EXTENDED(bExtended) (((bExtended)!=0)?D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK:0) + +// ---------------------------------------------------------------------------- +// Name Token (NameToken) (used in declaration statements) +// +// [15:00] D3D10_SB_NAME enumeration +// [31:16] Reserved, 0 +// +// ---------------------------------------------------------------------------- +#define D3D10_SB_NAME_MASK 0x0000ffff + +// DECODER MACRO: Get the name from NameToken +#define DECODE_D3D10_SB_NAME(NameToken) ((D3D10_SB_NAME)((NameToken)&D3D10_SB_NAME_MASK)) + +// ENCODER MACRO: Generate a complete NameToken given a D3D10_SB_NAME +#define ENCODE_D3D10_SB_NAME(Name) ((Name)&D3D10_SB_NAME_MASK) + +//--------------------------------------------------------------------- +// Declaration Statements +// +// Declarations start with a standard opcode token, +// having opcode type being D3D10_SB_OPCODE_DCL*. +// Each particular declaration type has custom +// operand token(s), described below. +//--------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// Global Flags Declaration +// +// OpcodeToken0: +// +// [10:00] D3D10_SB_OPCODE_DCL_GLOBAL_FLAGS +// [11:11] Refactoring allowed if bit set. +// [12:12] Enable double precision float ops. +// [13:13] Force early depth-stencil test. +// [14:14] Enable RAW and structured buffers in non-CS 4.x shaders. +// [15:15] Skip optimizations of shader IL when translating to native code +// [16:16] Enable minimum-precision data types +// [17:17] Enable 11.1 double-precision floating-point instruction extensions +// [18:18] Enable 11.1 non-double instruction extensions +// [23:19] Reserved for future flags. +// [30:24] Instruction length in DWORDs including the opcode token. == 1 +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. This dcl is currently not +// extended. +// +// OpcodeToken0 is followed by no operands. +// +// ---------------------------------------------------------------------------- +#define D3D10_SB_GLOBAL_FLAG_REFACTORING_ALLOWED (1<<11) +#define D3D11_SB_GLOBAL_FLAG_ENABLE_DOUBLE_PRECISION_FLOAT_OPS (1<<12) +#define D3D11_SB_GLOBAL_FLAG_FORCE_EARLY_DEPTH_STENCIL (1<<13) +#define D3D11_SB_GLOBAL_FLAG_ENABLE_RAW_AND_STRUCTURED_BUFFERS (1<<14) +#define D3D11_1_SB_GLOBAL_FLAG_SKIP_OPTIMIZATION (1<<15) +#define D3D11_1_SB_GLOBAL_FLAG_ENABLE_MINIMUM_PRECISION (1<<16) +#define D3D11_1_SB_GLOBAL_FLAG_ENABLE_DOUBLE_EXTENSIONS (1<<17) +#define D3D11_1_SB_GLOBAL_FLAG_ENABLE_SHADER_EXTENSIONS (1<<18) +#define D3D12_SB_GLOBAL_FLAG_ALL_RESOURCES_BOUND (1<<19) + +#define D3D10_SB_GLOBAL_FLAGS_MASK 0x00fff800 + +// DECODER MACRO: Get global flags +#define DECODE_D3D10_SB_GLOBAL_FLAGS(OpcodeToken0) ((OpcodeToken0)&D3D10_SB_GLOBAL_FLAGS_MASK) + +// ENCODER MACRO: Encode global flags +#define ENCODE_D3D10_SB_GLOBAL_FLAGS(Flags) ((Flags)&D3D10_SB_GLOBAL_FLAGS_MASK) + +// ---------------------------------------------------------------------------- +// Resource Declaration (non multisampled) +// +// OpcodeToken0: +// +// [10:00] D3D10_SB_OPCODE_DCL_RESOURCE +// [15:11] D3D10_SB_RESOURCE_DIMENSION +// [23:16] Ignored, 0 +// [30:24] Instruction length in DWORDs including the opcode token. +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. This dcl is currently not +// extended. +// +// OpcodeToken0 is followed by 2 operands on Shader Models 4.0 through 5.0: +// (1) an operand, starting with OperandToken0, defining which +// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. +// (2) a Resource Return Type token (ResourceReturnTypeToken) +// +// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later: +// (1) an operand, starting with OperandToken0, defining which +// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. +// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, +// and the meaning of the index dimensions are as follows: (t[:]) +// 1 : variable ID being declared +// 2 : the lower bound of the range of resources in the space +// 3 : the upper bound (inclusive) of this range +// As opposed to when the t# is used in shader instructions, where the register +// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index +// dimensions are as follows: (t[]): +// 1 : variable ID being used (matches dcl) +// 2 : absolute index of resource within space (may be dynamically indexed) +// (2) a Resource Return Type token (ResourceReturnTypeToken) +// (3) a DWORD indicating the space index. +// +// ---------------------------------------------------------------------------- +#define D3D10_SB_RESOURCE_DIMENSION_MASK 0x0000F800 +#define D3D10_SB_RESOURCE_DIMENSION_SHIFT 11 + +// DECODER MACRO: Given a resource declaration token, +// (OpcodeToken0), determine the resource dimension +// (D3D10_SB_RESOURCE_DIMENSION enum) +#define DECODE_D3D10_SB_RESOURCE_DIMENSION(OpcodeToken0) ((D3D10_SB_RESOURCE_DIMENSION)(((OpcodeToken0)&D3D10_SB_RESOURCE_DIMENSION_MASK)>>D3D10_SB_RESOURCE_DIMENSION_SHIFT)) + +// ENCODER MACRO: Store resource dimension +// (D3D10_SB_RESOURCE_DIMENSION enum) into a +// a resource declaration token (OpcodeToken0) +#define ENCODE_D3D10_SB_RESOURCE_DIMENSION(ResourceDim) (((ResourceDim)<[:]) +// 1 : variable ID being declared +// 2 : the lower bound of the range of resources in the space +// 3 : the upper bound (inclusive) of this range +// As opposed to when the t# is used in shader instructions, where the register +// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index +// dimensions are as follows: (t[]): +// 1 : variable ID being used (matches dcl) +// 2 : absolute index of resource within space (may be dynamically indexed) +// (2) a Resource Return Type token (ResourceReturnTypeToken) +// (3) a DWORD indicating the space index. +// +// ---------------------------------------------------------------------------- + +// use same macro for encoding/decoding resource dimension aas the non-msaa declaration + +#define D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK 0x07F0000 +#define D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT 16 + +// DECODER MACRO: Given a resource declaration token, +// (OpcodeToken0), determine the resource sample count (1..127) +#define DECODE_D3D10_SB_RESOURCE_SAMPLE_COUNT(OpcodeToken0) ((UINT)(((OpcodeToken0)&D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK)>>D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT)) + +// ENCODER MACRO: Store resource sample count up to 127 into a +// a resource declaration token (OpcodeToken0) +#define ENCODE_D3D10_SB_RESOURCE_SAMPLE_COUNT(SampleCount) (((SampleCount > 127 ? 127 : SampleCount)<> \ + (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS))&D3D10_SB_RESOURCE_RETURN_TYPE_MASK)) + +// ENCODER MACRO: Generate a resource return type for a component +#define ENCODE_D3D10_SB_RESOURCE_RETURN_TYPE(ReturnType, Component) \ + (((ReturnType)&D3D10_SB_RESOURCE_RETURN_TYPE_MASK) << (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS)) + +// ---------------------------------------------------------------------------- +// Sampler Declaration +// +// OpcodeToken0: +// +// [10:00] D3D10_SB_OPCODE_DCL_SAMPLER +// [14:11] D3D10_SB_SAMPLER_MODE +// [23:15] Ignored, 0 +// [30:24] Instruction length in DWORDs including the opcode token. +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. This dcl is currently not +// extended. +// +// OpcodeToken0 is followed by 1 operand on Shader Models 4.0 through 5.0: +// (1) Operand starting with OperandToken0, defining which sampler +// (D3D10_SB_OPERAND_TYPE_SAMPLER) register # is being declared. +// +// OpcodeToken0 is followed by 2 operands on Shader Model 5.1 and later: +// (1) an operand, starting with OperandToken0, defining which +// s# register (D3D10_SB_OPERAND_TYPE_SAMPLER) is being declared. +// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, +// and the meaning of the index dimensions are as follows: (s[:]) +// 1 : variable ID being declared +// 2 : the lower bound of the range of samplers in the space +// 3 : the upper bound (inclusive) of this range +// As opposed to when the s# is used in shader instructions, where the register +// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index +// dimensions are as follows: (s[]): +// 1 : variable ID being used (matches dcl) +// 2 : absolute index of sampler within space (may be dynamically indexed) +// (2) a DWORD indicating the space index. +// +// ---------------------------------------------------------------------------- +typedef enum D3D10_SB_SAMPLER_MODE +{ + D3D10_SB_SAMPLER_MODE_DEFAULT = 0, + D3D10_SB_SAMPLER_MODE_COMPARISON = 1, + D3D10_SB_SAMPLER_MODE_MONO = 2, +} D3D10_SB_SAMPLER_MODE; + +#define D3D10_SB_SAMPLER_MODE_MASK 0x00007800 +#define D3D10_SB_SAMPLER_MODE_SHIFT 11 + +// DECODER MACRO: Find out if a Constant Buffer is going to be indexed or not +#define DECODE_D3D10_SB_SAMPLER_MODE(OpcodeToken0) ((D3D10_SB_SAMPLER_MODE)(((OpcodeToken0)&D3D10_SB_SAMPLER_MODE_MASK)>>D3D10_SB_SAMPLER_MODE_SHIFT)) + +// ENCODER MACRO: Generate a resource return type for a component +#define ENCODE_D3D10_SB_SAMPLER_MODE(SamplerMode) (((SamplerMode)<>D3D10_SB_INPUT_INTERPOLATION_MODE_SHIFT)) + +// ENCODER MACRO: Encode interpolation mode for a register. +#define ENCODE_D3D10_SB_INPUT_INTERPOLATION_MODE(InterpolationMode) (((InterpolationMode)<[:]) +// 1 : variable ID being declared +// 2 : the lower bound of the range of constant buffers in the space +// 3 : the upper bound (inclusive) of this range +// As opposed to when the cb#[] is used in shader instructions: (cb[][]) +// 1 : variable ID being used (matches dcl) +// 2 : absolute index of constant buffer within space (may be dynamically indexed) +// 3 : location of vector within constant buffer being referenced, +// which may also be dynamically indexed, with no access pattern flag required. +// (2) a DWORD indicating the size of the constant buffer as a count of 16-byte vectors. +// Each vector is 32-bit*4 elements == 128-bits == 16 bytes. +// If the size is specified as 0, the CB size is not known (any size CB +// can be bound to the slot). +// (3) a DWORD indicating the space index. +// +// ---------------------------------------------------------------------------- + +typedef enum D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN +{ + D3D10_SB_CONSTANT_BUFFER_IMMEDIATE_INDEXED = 0, + D3D10_SB_CONSTANT_BUFFER_DYNAMIC_INDEXED = 1 +} D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN; + +#define D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK 0x00000800 +#define D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT 11 + +// DECODER MACRO: Find out if a Constant Buffer is going to be indexed or not +#define DECODE_D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN(OpcodeToken0) ((D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN)(((OpcodeToken0)&D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK)>>D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT)) + +// ENCODER MACRO: Encode the access pattern for the Constant Buffer +#define ENCODE_D3D10_SB_D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN(AccessPattern) (((AccessPattern)<>D3D10_SB_GS_INPUT_PRIMITIVE_SHIFT)) + +// ENCODER MACRO: Store primitive topology +// (D3D10_SB_PRIMITIVE enum) into a +// a primitive topology declaration token (OpcodeToken0) +#define ENCODE_D3D10_SB_GS_INPUT_PRIMITIVE(Prim) (((Prim)<>D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_SHIFT)) + +// ENCODER MACRO: Store primitive topology +// (D3D10_SB_PRIMITIVE_TOPOLOGY enum) into a +// a primitive topology declaration token (OpcodeToken0) +#define ENCODE_D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY(PrimTopology) (((PrimTopology)<>D3D11_SB_INPUT_CONTROL_POINT_COUNT_SHIFT)) + +// ENCODER MACRO: Store input control point count into a declaration token +#define ENCODE_D3D11_SB_INPUT_CONTROL_POINT_COUNT(Count) (((Count)<>D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_SHIFT)) + +// ENCODER MACRO: Store output control point count into a declaration token +#define ENCODE_D3D11_SB_OUTPUT_CONTROL_POINT_COUNT(Count) (((Count)<>D3D11_SB_TESS_DOMAIN_SHIFT)) + +// ENCODER MACRO: Store tessellator domain +// (D3D11_SB_TESSELLATOR_DOMAIN enum) into a +// a tessellator domain declaration token (OpcodeToken0) +#define ENCODE_D3D11_SB_TESS_DOMAIN(Domain) (((Domain)<>D3D11_SB_TESS_PARTITIONING_SHIFT)) + +// ENCODER MACRO: Store tessellator partitioning +// (D3D11_SB_TESSELLATOR_PARTITIONING enum) into a +// a tessellator partitioning declaration token (OpcodeToken0) +#define ENCODE_D3D11_SB_TESS_PARTITIONING(Partitioning) (((Partitioning)<>D3D11_SB_TESS_OUTPUT_PRIMITIVE_SHIFT)) + +// ENCODER MACRO: Store tessellator output primitive +// (D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE enum) into a +// a tessellator output primitive declaration token (OpcodeToken0) +#define ENCODE_D3D11_SB_TESS_OUTPUT_PRIMITIVE(OutputPrimitive) (((OutputPrimitive)<>D3D10_SB_INSTRUCTION_RETURN_TYPE_SHIFT)) +// ENCODER MACRO: Encode the return type for instructions +// in the opcode specific control range of OpcodeToken0 +#define ENCODE_D3D10_SB_INSTRUCTION_RETURN_TYPE(ReturnType) (((ReturnType)<>D3D11_SB_INTERFACE_INDEXED_BIT_SHIFT) ? true : false) +#define ENCODE_D3D11_SB_INTERFACE_INDEXED_BIT(IndexedBit) (((IndexedBit)<>D3D11_SB_INTERFACE_TABLE_LENGTH_SHIFT)) +#define ENCODE_D3D11_SB_INTERFACE_TABLE_LENGTH(TableLength) (((TableLength)<>D3D11_SB_INTERFACE_ARRAY_LENGTH_SHIFT)) +#define ENCODE_D3D11_SB_INTERFACE_ARRAY_LENGTH(ArrayLength) (((ArrayLength)<[:]) +// 1 : variable ID being declared +// 2 : the lower bound of the range of UAV's in the space +// 3 : the upper bound (inclusive) of this range +// As opposed to when the u# is used in shader instructions, where the register +// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index +// dimensions are as follows: (u[]): +// 1 : variable ID being used (matches dcl) +// 2 : absolute index of uav within space (may be dynamically indexed) +// (2) a Resource Return Type token (ResourceReturnTypeToken) +// (3) a DWORD indicating the space index. +// +// ---------------------------------------------------------------------------- +// UAV access scope flags +#define D3D11_SB_GLOBALLY_COHERENT_ACCESS 0x00010000 +#define D3D11_SB_ACCESS_COHERENCY_MASK 0x00010000 + +// DECODER MACRO: Retrieve flags for sync instruction from OpcodeToken0. +#define DECODE_D3D11_SB_ACCESS_COHERENCY_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_ACCESS_COHERENCY_MASK) + +// ENCODER MACRO: Given a set of sync instruciton flags, encode them in OpcodeToken0. +#define ENCODE_D3D11_SB_ACCESS_COHERENCY_FLAGS(Flags) ((Flags)&D3D11_SB_ACCESS_COHERENCY_MASK) + +// Additional UAV access flags +#define D3D11_SB_RASTERIZER_ORDERED_ACCESS 0x00020000 + +// Resource flags mask. Use to retrieve all resource flags, including the order preserving counter. +#define D3D11_SB_RESOURCE_FLAGS_MASK (D3D11_SB_GLOBALLY_COHERENT_ACCESS|D3D11_SB_RASTERIZER_ORDERED_ACCESS|D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER) + +// DECODER MACRO: Retrieve UAV access flags for from OpcodeToken0. +#define DECODE_D3D11_SB_RESOURCE_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_RESOURCE_FLAGS_MASK) + +// ENCODER MACRO: Given UAV access flags, encode them in OpcodeToken0. +#define ENCODE_D3D11_SB_RESOURCE_FLAGS(Flags) ((Flags)&D3D11_SB_RESOURCE_FLAGS_MASK) + +// ---------------------------------------------------------------------------- +// Raw Unordered Access View Declaration +// +// OpcodeToken0: +// +// [10:00] D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_RAW +// [15:11] Ignored, 0 +// [16:16] D3D11_SB_GLOBALLY_COHERENT_ACCESS or 0 (LOCALLY_COHERENT) +// [17:17] D3D11_SB_RASTERIZER_ORDERED_ACCESS or 0 +// [23:18] Ignored, 0 +// [30:24] Instruction length in DWORDs including the opcode token. +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. This dcl is currently not +// extended. +// +// OpcodeToken0 is followed by 1 operand on Shader Models 4.0 through 5.0: +// (1) an operand, starting with OperandToken0, defining which +// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared. +// +// OpcodeToken0 is followed by 2 operands on Shader Model 5.1 and later: +// (1) an operand, starting with OperandToken0, defining which +// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared. +// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, +// and the meaning of the index dimensions are as follows: (u[:]) +// 1 : variable ID being declared +// 2 : the lower bound of the range of UAV's in the space +// 3 : the upper bound (inclusive) of this range +// As opposed to when the u# is used in shader instructions, where the register +// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index +// dimensions are as follows: (u[]): +// 1 : variable ID being used (matches dcl) +// 2 : absolute index of uav within space (may be dynamically indexed) +// (2) a DWORD indicating the space index. +// +// ---------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// Structured Unordered Access View Declaration +// +// OpcodeToken0: +// +// [10:00] D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_STRUCTURED +// [15:11] Ignored, 0 +// [16:16] D3D11_SB_GLOBALLY_COHERENT_ACCESS or 0 (LOCALLY_COHERENT) +// [17:17] D3D11_SB_RASTERIZER_ORDERED_ACCESS or 0 +// [22:18] Ignored, 0 +// [23:23] D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER or 0 +// +// The presence of this flag means that if a UAV is bound to the +// corresponding slot, it must have been created with +// D3D11_BUFFER_UAV_FLAG_COUNTER at the API. Also, the shader +// can contain either imm_atomic_alloc or _consume instructions +// operating on the given UAV. +// +// If this flag is not present, the shader can still contain +// either imm_atomic_alloc or imm_atomic_consume instructions for +// this UAV. But if such instructions are present in this case, +// and a UAV is bound corresponding slot, it must have been created +// with the D3D11_BUFFER_UAV_FLAG_APPEND flag at the API. +// Append buffers have a counter as well, but values returned +// to the shader are only valid for the lifetime of the shader +// invocation. +// +// [30:24] Instruction length in DWORDs including the opcode token. +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. This dcl is currently not +// extended. +// +// OpcodeToken0 is followed by 2 operands: +// (1) an operand, starting with OperandToken0, defining which +// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is +// being declared. +// (2) a DWORD indicating UINT32 byte stride +// +// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later: +// (1) an operand, starting with OperandToken0, defining which +// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared. +// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, +// and the meaning of the index dimensions are as follows: (u[:]) +// 1 : variable ID being declared +// 2 : the lower bound of the range of UAV's in the space +// 3 : the upper bound (inclusive) of this range +// As opposed to when the u# is used in shader instructions, where the register +// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index +// dimensions are as follows: (u[]): +// 1 : variable ID being used (matches dcl) +// 2 : absolute index of uav within space (may be dynamically indexed) +// (2) a DWORD indicating UINT32 byte stride +// (3) a DWORD indicating the space index. +// +// ---------------------------------------------------------------------------- +// UAV flags +#define D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER 0x00800000 +#define D3D11_SB_UAV_FLAGS_MASK 0x00800000 + +// DECODER MACRO: Retrieve flags about UAV from OpcodeToken0. +#define DECODE_D3D11_SB_UAV_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_UAV_FLAGS_MASK) + +// ENCODER MACRO: Given a set of UAV flags, encode them in OpcodeToken0. +#define ENCODE_D3D11_SB_UAV_FLAGS(Flags) ((Flags)&D3D11_SB_UAV_FLAGS_MASK) + +// ---------------------------------------------------------------------------- +// Raw Thread Group Shared Memory Declaration +// +// OpcodeToken0: +// +// [10:00] D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_RAW +// [23:11] Ignored, 0 +// [30:24] Instruction length in DWORDs including the opcode token. +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. This dcl is currently not +// extended. +// +// OpcodeToken0 is followed by 2 operands: +// (1) an operand, starting with OperandToken0, defining which +// g# register (D3D11_SB_OPERAND_TYPE_THREAD_GROUP_SHARED_MEMORY) is being declared. +// (2) a DWORD indicating the byte count, which must be a multiple of 4. +// +// ---------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// Structured Thread Group Shared Memory Declaration +// +// OpcodeToken0: +// +// [10:00] D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_STRUCTURED +// [23:11] Ignored, 0 +// [30:24] Instruction length in DWORDs including the opcode token. +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. This dcl is currently not +// extended. +// +// OpcodeToken0 is followed by 3 operands: +// (1) an operand, starting with OperandToken0, defining which +// g# register (D3D11_SB_OPERAND_TYPE_THREAD_GROUP_SHARED_MEMORY) is +// being declared. +// (2) a DWORD indicating UINT32 struct byte stride +// (3) a DWORD indicating UINT32 struct count +// +// ---------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// Raw Shader Resource View Declaration +// +// OpcodeToken0: +// +// [10:00] D3D11_SB_OPCODE_DCL_RESOURCE_RAW +// [23:11] Ignored, 0 +// [30:24] Instruction length in DWORDs including the opcode token. +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. This dcl is currently not +// extended. +// +// OpcodeToken0 is followed by 1 operand: +// (1) an operand, starting with OperandToken0, defining which +// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. +// +// OpcodeToken0 is followed by 2 operands on Shader Model 5.1 and later: +// (1) an operand, starting with OperandToken0, defining which +// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. +// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, +// and the meaning of the index dimensions are as follows: (t[:]) +// 1 : variable ID being declared +// 2 : the lower bound of the range of resources in the space +// 3 : the upper bound (inclusive) of this range +// As opposed to when the t# is used in shader instructions, where the register +// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index +// dimensions are as follows: (t[]): +// 1 : variable ID being used (matches dcl) +// 2 : absolute index of resource within space (may be dynamically indexed) +// (2) a DWORD indicating the space index. +// +// ---------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// Structured Shader Resource View Declaration +// +// OpcodeToken0: +// +// [10:00] D3D11_SB_OPCODE_DCL_RESOURCE_STRUCTURED +// [23:11] Ignored, 0 +// [30:24] Instruction length in DWORDs including the opcode token. +// [31] 0 normally. 1 if extended operand definition, meaning next DWORD +// contains extended operand description. This dcl is currently not +// extended. +// +// OpcodeToken0 is followed by 2 operands: +// (1) an operand, starting with OperandToken0, defining which +// g# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is +// being declared. +// (2) a DWORD indicating UINT32 struct byte stride +// +// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later: +// (1) an operand, starting with OperandToken0, defining which +// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. +// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, +// and the meaning of the index dimensions are as follows: (t[:]) +// 1 : variable ID being declared +// 2 : the lower bound of the range of resources in the space +// 3 : the upper bound (inclusive) of this range +// As opposed to when the t# is used in shader instructions, where the register +// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index +// dimensions are as follows: (t[]): +// 1 : variable ID being used (matches dcl) +// 2 : absolute index of resource within space (may be dynamically indexed) +// (2) a DWORD indicating UINT32 struct byte stride +// (3) a DWORD indicating the space index. +// +// ---------------------------------------------------------------------------- + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ +#pragma endregion diff --git a/deps/DirectX-Headers/include/directx/DirectML.h b/deps/DirectX-Headers/include/directx/DirectML.h new file mode 100644 index 0000000..b8b6603 --- /dev/null +++ b/deps/DirectX-Headers/include/directx/DirectML.h @@ -0,0 +1,2651 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. + +#ifndef DIRECTML_H +#define DIRECTML_H +#pragma once + +#ifdef _GAMING_XBOX_SCARLETT +#include "d3d12_xs.h" +#elif _GAMING_XBOX_XBOXONE +#include "d3d12_x.h" +#else +#include "d3d12.h" +#endif + +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) + +#ifndef DML_DECLARE_INTERFACE +#define DML_DECLARE_INTERFACE(iid) DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE +#endif + +#ifndef DML_TARGET_VERSION + +#if !defined(NTDDI_VERSION) || defined(DML_TARGET_VERSION_USE_LATEST) // Use the latest if using redist or no Windows target set. +#define DML_TARGET_VERSION 0x6400 +#elif defined(NTDDI_WIN10_ZN) && NTDDI_VERSION >= NTDDI_WIN10_ZN +#define DML_TARGET_VERSION 0x6000 +#elif defined(NTDDI_WIN10_NI) && NTDDI_VERSION >= NTDDI_WIN10_NI +#define DML_TARGET_VERSION 0x5000 +#elif defined(NTDDI_WIN10_CO) && NTDDI_VERSION >= NTDDI_WIN10_CO +#define DML_TARGET_VERSION 0x4000 +#elif defined(NTDDI_WIN10_FE) && NTDDI_VERSION >= NTDDI_WIN10_FE +#define DML_TARGET_VERSION 0x3000 +#elif defined(NTDDI_WIN10_VB) && NTDDI_VERSION >= NTDDI_WIN10_VB // Windows 10 2004 Update +#define DML_TARGET_VERSION 0x2000 +#else // defined(NTDDI_WIN10_19H1) && NTDDI_VERSION >= NTDDI_WIN10_19H1 // Windows 10 1903 Update +#define DML_TARGET_VERSION 0x1000 +#endif + +#endif // !defined(DML_TARGET_VERSION) + +// =================================================================================================================== +// DirectML constants +// =================================================================================================================== + +static const UINT DML_TENSOR_DIMENSION_COUNT_MAX = 5; +#if DML_TARGET_VERSION >= 0x3000 +static const UINT DML_TENSOR_DIMENSION_COUNT_MAX1 = 8; +#endif + +static const UINT DML_TEMPORARY_BUFFER_ALIGNMENT = 256; +static const UINT DML_PERSISTENT_BUFFER_ALIGNMENT = 256; + +static const UINT DML_MINIMUM_BUFFER_TENSOR_ALIGNMENT = 16; + + +// =================================================================================================================== +// Interface declarations +// =================================================================================================================== + +interface IDMLObject; +interface IDMLDevice; +interface IDMLDeviceChild; +interface IDMLPageable; +interface IDMLDispatchable; +interface IDMLOperator; +interface IDMLCompiledOperator; +interface IDMLOperatorInitializer; +interface IDMLBindingTable; +interface IDMLCommandRecorder; + + +// =================================================================================================================== +// Tensor descriptions +// =================================================================================================================== + +enum DML_TENSOR_DATA_TYPE +{ + DML_TENSOR_DATA_TYPE_UNKNOWN, + DML_TENSOR_DATA_TYPE_FLOAT32, + DML_TENSOR_DATA_TYPE_FLOAT16, + DML_TENSOR_DATA_TYPE_UINT32, + DML_TENSOR_DATA_TYPE_UINT16, + DML_TENSOR_DATA_TYPE_UINT8, + DML_TENSOR_DATA_TYPE_INT32, + DML_TENSOR_DATA_TYPE_INT16, + DML_TENSOR_DATA_TYPE_INT8, + DML_TENSOR_DATA_TYPE_FLOAT64, + DML_TENSOR_DATA_TYPE_UINT64, + DML_TENSOR_DATA_TYPE_INT64, +#if DML_TARGET_VERSION >= 0x6300 + DML_TENSOR_DATA_TYPE_UINT4, + DML_TENSOR_DATA_TYPE_INT4, +#endif // DML_TARGET_VERSION >= 0x6300 +}; + +enum DML_TENSOR_TYPE +{ + DML_TENSOR_TYPE_INVALID, + + DML_TENSOR_TYPE_BUFFER, +}; + +enum DML_TENSOR_FLAGS +{ + DML_TENSOR_FLAG_NONE = 0x0, + DML_TENSOR_FLAG_OWNED_BY_DML = 0x1, +}; + +DEFINE_ENUM_FLAG_OPERATORS(DML_TENSOR_FLAGS) + +struct DML_BUFFER_TENSOR_DESC +{ + DML_TENSOR_DATA_TYPE DataType; + DML_TENSOR_FLAGS Flags; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Sizes; + _Field_size_opt_(DimensionCount) const UINT* Strides; + UINT64 TotalTensorSizeInBytes; + UINT GuaranteedBaseOffsetAlignment; +}; + +struct DML_TENSOR_DESC +{ + DML_TENSOR_TYPE Type; + _Field_size_(_Inexpressible_("Dependent on tensor type")) const void* Desc; +}; + + +// =================================================================================================================== +// Operator types +// =================================================================================================================== + +enum DML_OPERATOR_TYPE +{ + DML_OPERATOR_INVALID, + + DML_OPERATOR_ELEMENT_WISE_IDENTITY, + DML_OPERATOR_ELEMENT_WISE_ABS, + DML_OPERATOR_ELEMENT_WISE_ACOS, + DML_OPERATOR_ELEMENT_WISE_ADD, + DML_OPERATOR_ELEMENT_WISE_ASIN, + DML_OPERATOR_ELEMENT_WISE_ATAN, + DML_OPERATOR_ELEMENT_WISE_CEIL, + DML_OPERATOR_ELEMENT_WISE_CLIP, + DML_OPERATOR_ELEMENT_WISE_COS, + DML_OPERATOR_ELEMENT_WISE_DIVIDE, + DML_OPERATOR_ELEMENT_WISE_EXP, + DML_OPERATOR_ELEMENT_WISE_FLOOR, + DML_OPERATOR_ELEMENT_WISE_LOG, + DML_OPERATOR_ELEMENT_WISE_LOGICAL_AND, + DML_OPERATOR_ELEMENT_WISE_LOGICAL_EQUALS, + DML_OPERATOR_ELEMENT_WISE_LOGICAL_GREATER_THAN, + DML_OPERATOR_ELEMENT_WISE_LOGICAL_LESS_THAN, + DML_OPERATOR_ELEMENT_WISE_LOGICAL_NOT, + DML_OPERATOR_ELEMENT_WISE_LOGICAL_OR, + DML_OPERATOR_ELEMENT_WISE_LOGICAL_XOR, + DML_OPERATOR_ELEMENT_WISE_MAX, + DML_OPERATOR_ELEMENT_WISE_MEAN, + DML_OPERATOR_ELEMENT_WISE_MIN, + DML_OPERATOR_ELEMENT_WISE_MULTIPLY, + DML_OPERATOR_ELEMENT_WISE_POW, + DML_OPERATOR_ELEMENT_WISE_CONSTANT_POW, + DML_OPERATOR_ELEMENT_WISE_RECIP, + DML_OPERATOR_ELEMENT_WISE_SIN, + DML_OPERATOR_ELEMENT_WISE_SQRT, + DML_OPERATOR_ELEMENT_WISE_SUBTRACT, + DML_OPERATOR_ELEMENT_WISE_TAN, + DML_OPERATOR_ELEMENT_WISE_THRESHOLD, + DML_OPERATOR_ELEMENT_WISE_QUANTIZE_LINEAR, + DML_OPERATOR_ELEMENT_WISE_DEQUANTIZE_LINEAR, + DML_OPERATOR_ACTIVATION_ELU, + DML_OPERATOR_ACTIVATION_HARDMAX, + DML_OPERATOR_ACTIVATION_HARD_SIGMOID, + DML_OPERATOR_ACTIVATION_IDENTITY, + DML_OPERATOR_ACTIVATION_LEAKY_RELU, + DML_OPERATOR_ACTIVATION_LINEAR, + DML_OPERATOR_ACTIVATION_LOG_SOFTMAX, + DML_OPERATOR_ACTIVATION_PARAMETERIZED_RELU, + DML_OPERATOR_ACTIVATION_PARAMETRIC_SOFTPLUS, + DML_OPERATOR_ACTIVATION_RELU, + DML_OPERATOR_ACTIVATION_SCALED_ELU, + DML_OPERATOR_ACTIVATION_SCALED_TANH, + DML_OPERATOR_ACTIVATION_SIGMOID, + DML_OPERATOR_ACTIVATION_SOFTMAX, + DML_OPERATOR_ACTIVATION_SOFTPLUS, + DML_OPERATOR_ACTIVATION_SOFTSIGN, + DML_OPERATOR_ACTIVATION_TANH, + DML_OPERATOR_ACTIVATION_THRESHOLDED_RELU, + DML_OPERATOR_CONVOLUTION, + DML_OPERATOR_GEMM, + DML_OPERATOR_REDUCE, + DML_OPERATOR_AVERAGE_POOLING, + DML_OPERATOR_LP_POOLING, + DML_OPERATOR_MAX_POOLING, + DML_OPERATOR_ROI_POOLING, + DML_OPERATOR_SLICE, + DML_OPERATOR_CAST, + DML_OPERATOR_SPLIT, + DML_OPERATOR_JOIN, + DML_OPERATOR_PADDING, + DML_OPERATOR_VALUE_SCALE_2D, + DML_OPERATOR_UPSAMPLE_2D, + DML_OPERATOR_GATHER, + DML_OPERATOR_SPACE_TO_DEPTH, + DML_OPERATOR_DEPTH_TO_SPACE, + DML_OPERATOR_TILE, + DML_OPERATOR_TOP_K, + DML_OPERATOR_BATCH_NORMALIZATION, + DML_OPERATOR_MEAN_VARIANCE_NORMALIZATION, + DML_OPERATOR_LOCAL_RESPONSE_NORMALIZATION, + DML_OPERATOR_LP_NORMALIZATION, + DML_OPERATOR_RNN, + DML_OPERATOR_LSTM, + DML_OPERATOR_GRU, + +#if DML_TARGET_VERSION >= 0x2000 + DML_OPERATOR_ELEMENT_WISE_SIGN, + DML_OPERATOR_ELEMENT_WISE_IS_NAN, + DML_OPERATOR_ELEMENT_WISE_ERF, + DML_OPERATOR_ELEMENT_WISE_SINH, + DML_OPERATOR_ELEMENT_WISE_COSH, + DML_OPERATOR_ELEMENT_WISE_TANH, + DML_OPERATOR_ELEMENT_WISE_ASINH, + DML_OPERATOR_ELEMENT_WISE_ACOSH, + DML_OPERATOR_ELEMENT_WISE_ATANH, + DML_OPERATOR_ELEMENT_WISE_IF, + DML_OPERATOR_ELEMENT_WISE_ADD1, + DML_OPERATOR_ACTIVATION_SHRINK, + DML_OPERATOR_MAX_POOLING1, + DML_OPERATOR_MAX_UNPOOLING, + DML_OPERATOR_DIAGONAL_MATRIX, + DML_OPERATOR_SCATTER_ELEMENTS, + DML_OPERATOR_SCATTER = DML_OPERATOR_SCATTER_ELEMENTS, // Alias name for backwards compatibility. + DML_OPERATOR_ONE_HOT, + DML_OPERATOR_RESAMPLE, +#endif // DML_TARGET_VERSION >= 0x2000 + +#if DML_TARGET_VERSION >= 0x2100 + DML_OPERATOR_ELEMENT_WISE_BIT_SHIFT_LEFT, + DML_OPERATOR_ELEMENT_WISE_BIT_SHIFT_RIGHT, + DML_OPERATOR_ELEMENT_WISE_ROUND, + DML_OPERATOR_ELEMENT_WISE_IS_INFINITY, + DML_OPERATOR_ELEMENT_WISE_MODULUS_TRUNCATE, + DML_OPERATOR_ELEMENT_WISE_MODULUS_FLOOR, + DML_OPERATOR_FILL_VALUE_CONSTANT, + DML_OPERATOR_FILL_VALUE_SEQUENCE, + DML_OPERATOR_CUMULATIVE_SUMMATION, + DML_OPERATOR_REVERSE_SUBSEQUENCES, + DML_OPERATOR_GATHER_ELEMENTS, + DML_OPERATOR_GATHER_ND, + DML_OPERATOR_SCATTER_ND, + DML_OPERATOR_MAX_POOLING2, + DML_OPERATOR_SLICE1, + DML_OPERATOR_TOP_K1, + DML_OPERATOR_DEPTH_TO_SPACE1, + DML_OPERATOR_SPACE_TO_DEPTH1, + DML_OPERATOR_MEAN_VARIANCE_NORMALIZATION1, + DML_OPERATOR_RESAMPLE1, + DML_OPERATOR_MATRIX_MULTIPLY_INTEGER, + DML_OPERATOR_QUANTIZED_LINEAR_MATRIX_MULTIPLY, + DML_OPERATOR_CONVOLUTION_INTEGER, + DML_OPERATOR_QUANTIZED_LINEAR_CONVOLUTION, +#endif // DML_TARGET_VERSION >= 0x2100 + +#if DML_TARGET_VERSION >= 0x3000 + DML_OPERATOR_ELEMENT_WISE_BIT_AND, + DML_OPERATOR_ELEMENT_WISE_BIT_OR, + DML_OPERATOR_ELEMENT_WISE_BIT_XOR, + DML_OPERATOR_ELEMENT_WISE_BIT_NOT, + DML_OPERATOR_ELEMENT_WISE_BIT_COUNT, + DML_OPERATOR_ELEMENT_WISE_LOGICAL_GREATER_THAN_OR_EQUAL, + DML_OPERATOR_ELEMENT_WISE_LOGICAL_LESS_THAN_OR_EQUAL, + DML_OPERATOR_ACTIVATION_CELU, + DML_OPERATOR_ACTIVATION_RELU_GRAD, + DML_OPERATOR_AVERAGE_POOLING_GRAD, + DML_OPERATOR_MAX_POOLING_GRAD, + DML_OPERATOR_RANDOM_GENERATOR, + DML_OPERATOR_NONZERO_COORDINATES, + DML_OPERATOR_RESAMPLE_GRAD, + DML_OPERATOR_SLICE_GRAD, + DML_OPERATOR_ADAM_OPTIMIZER, + DML_OPERATOR_ARGMIN, + DML_OPERATOR_ARGMAX, + DML_OPERATOR_ROI_ALIGN, + DML_OPERATOR_GATHER_ND1, +#endif // DML_TARGET_VERSION >= 0x3000 + +#if DML_TARGET_VERSION >= 0x3100 + DML_OPERATOR_ELEMENT_WISE_ATAN_YX, + DML_OPERATOR_ELEMENT_WISE_CLIP_GRAD, + DML_OPERATOR_ELEMENT_WISE_DIFFERENCE_SQUARE, + DML_OPERATOR_LOCAL_RESPONSE_NORMALIZATION_GRAD, + DML_OPERATOR_CUMULATIVE_PRODUCT, + DML_OPERATOR_BATCH_NORMALIZATION_GRAD, +#endif // DML_TARGET_VERSION >= 0x3100 + +#if DML_TARGET_VERSION >= 0x4000 + DML_OPERATOR_ELEMENT_WISE_QUANTIZED_LINEAR_ADD, + DML_OPERATOR_DYNAMIC_QUANTIZE_LINEAR, + DML_OPERATOR_ROI_ALIGN1, +#endif // DML_TARGET_VERSION >= 0x4000 + +#if DML_TARGET_VERSION >= 0x4100 + DML_OPERATOR_ROI_ALIGN_GRAD, + DML_OPERATOR_BATCH_NORMALIZATION_TRAINING, + DML_OPERATOR_BATCH_NORMALIZATION_TRAINING_GRAD, +#endif // DML_TARGET_VERSION >= 0x4100 + +#if DML_TARGET_VERSION >= 0x5000 + DML_OPERATOR_ELEMENT_WISE_CLIP1, + DML_OPERATOR_ELEMENT_WISE_CLIP_GRAD1, + DML_OPERATOR_PADDING1, + DML_OPERATOR_ELEMENT_WISE_NEGATE, +#endif // DML_TARGET_VERSION >= 0x5000 + +#if DML_TARGET_VERSION >= 0x5100 + DML_OPERATOR_ACTIVATION_GELU, + DML_OPERATOR_ACTIVATION_SOFTMAX1, + DML_OPERATOR_ACTIVATION_LOG_SOFTMAX1, + DML_OPERATOR_ACTIVATION_HARDMAX1, + DML_OPERATOR_RESAMPLE2, + DML_OPERATOR_RESAMPLE_GRAD1, + DML_OPERATOR_DIAGONAL_MATRIX1, +#endif // DML_TARGET_VERSION >= 0x5100 + +#if DML_TARGET_VERSION >= 0x6100 + DML_OPERATOR_MULTIHEAD_ATTENTION, +#endif // DML_TARGET_VERSION >= 0x6100 + +#if DML_TARGET_VERSION >= 0x6200 + DML_OPERATOR_LP_POOLING1, + DML_OPERATOR_AVERAGE_POOLING1, + DML_OPERATOR_ACTIVATION_SWISH, + DML_OPERATOR_ACTIVATION_HARD_SWISH, + DML_OPERATOR_QUANTIZED_LINEAR_AVERAGE_POOLING, + DML_OPERATOR_MATRIX_MULTIPLY_INTEGER_TO_FLOAT, +#endif // DML_TARGET_VERSION >= 0x6200 + +#if DML_TARGET_VERSION >= 0x6300 + DML_OPERATOR_MEAN_VARIANCE_NORMALIZATION2, + DML_OPERATOR_MULTIHEAD_ATTENTION1, + DML_OPERATOR_QUANTIZE, + DML_OPERATOR_DEQUANTIZE, +#endif // DML_TARGET_VERSION >= 0x6300 + +#if DML_TARGET_VERSION >= 0x6400 + DML_OPERATOR_RESAMPLE3, + DML_OPERATOR_FOLD, + DML_OPERATOR_UNFOLD, +#endif // DML_TARGET_VERSION >= 0x6400 +}; + +// =================================================================================================================== +// Operator enumerations and structures +// =================================================================================================================== + +enum DML_REDUCE_FUNCTION +{ + DML_REDUCE_FUNCTION_ARGMAX, + DML_REDUCE_FUNCTION_ARGMIN, + DML_REDUCE_FUNCTION_AVERAGE, + DML_REDUCE_FUNCTION_L1, + DML_REDUCE_FUNCTION_L2, + DML_REDUCE_FUNCTION_LOG_SUM, + DML_REDUCE_FUNCTION_LOG_SUM_EXP, + DML_REDUCE_FUNCTION_MAX, + DML_REDUCE_FUNCTION_MIN, + DML_REDUCE_FUNCTION_MULTIPLY, + DML_REDUCE_FUNCTION_SUM, + DML_REDUCE_FUNCTION_SUM_SQUARE, +}; + +enum DML_MATRIX_TRANSFORM +{ + DML_MATRIX_TRANSFORM_NONE, + DML_MATRIX_TRANSFORM_TRANSPOSE, +}; + +enum DML_CONVOLUTION_MODE +{ + DML_CONVOLUTION_MODE_CONVOLUTION, + DML_CONVOLUTION_MODE_CROSS_CORRELATION, +}; + +enum DML_CONVOLUTION_DIRECTION +{ + DML_CONVOLUTION_DIRECTION_FORWARD, + DML_CONVOLUTION_DIRECTION_BACKWARD, +}; + +enum DML_PADDING_MODE +{ + DML_PADDING_MODE_CONSTANT, + DML_PADDING_MODE_EDGE, + DML_PADDING_MODE_REFLECTION, + +#if DML_TARGET_VERSION >= 0x3000 + DML_PADDING_MODE_SYMMETRIC, +#endif + +#if DML_TARGET_VERSION >= 0x6400 + DML_PADDING_MODE_WRAP, +#endif +}; + +enum DML_INTERPOLATION_MODE +{ + DML_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + DML_INTERPOLATION_MODE_LINEAR, +}; + +struct DML_SCALE_BIAS +{ + FLOAT Scale; + FLOAT Bias; +}; + +struct DML_SIZE_2D +{ + UINT Width; + UINT Height; +}; + +enum DML_RECURRENT_NETWORK_DIRECTION +{ + DML_RECURRENT_NETWORK_DIRECTION_FORWARD, + DML_RECURRENT_NETWORK_DIRECTION_BACKWARD, + DML_RECURRENT_NETWORK_DIRECTION_BIDIRECTIONAL, +}; + +#if DML_TARGET_VERSION >= 0x2100 + +enum DML_ROUNDING_MODE +{ + DML_ROUNDING_MODE_HALVES_TO_NEAREST_EVEN, + DML_ROUNDING_MODE_TOWARD_ZERO, + DML_ROUNDING_MODE_TOWARD_INFINITY, +}; + +enum DML_IS_INFINITY_MODE +{ + DML_IS_INFINITY_MODE_EITHER = 0, + DML_IS_INFINITY_MODE_POSITIVE = 1, + DML_IS_INFINITY_MODE_NEGATIVE = 2, +}; + +enum DML_AXIS_DIRECTION +{ + DML_AXIS_DIRECTION_INCREASING = 0, + DML_AXIS_DIRECTION_DECREASING = 1, +}; + +enum DML_DEPTH_SPACE_ORDER +{ + DML_DEPTH_SPACE_ORDER_DEPTH_COLUMN_ROW, + DML_DEPTH_SPACE_ORDER_COLUMN_ROW_DEPTH, +}; + +union DML_SCALAR_UNION +{ + BYTE Bytes[8]; + INT8 Int8; + UINT8 UInt8; + INT16 Int16; + UINT16 UInt16; + INT32 Int32; + UINT32 UInt32; + INT64 Int64; + UINT64 UInt64; + FLOAT Float32; + DOUBLE Float64; +}; + +#endif // DML_TARGET_VERSION >= 0x2100 + +#if DML_TARGET_VERSION >= 0x3000 + +enum DML_RANDOM_GENERATOR_TYPE +{ + DML_RANDOM_GENERATOR_TYPE_PHILOX_4X32_10 +}; + +#endif // DML_TARGET_VERSION >= 0x3000 + +#if DML_TARGET_VERSION >= 0x6100 + +enum DML_MULTIHEAD_ATTENTION_MASK_TYPE +{ + DML_MULTIHEAD_ATTENTION_MASK_TYPE_NONE, + DML_MULTIHEAD_ATTENTION_MASK_TYPE_KEY_SEQUENCE_LENGTH, + DML_MULTIHEAD_ATTENTION_MASK_TYPE_KEY_SEQUENCE_END_START, + DML_MULTIHEAD_ATTENTION_MASK_TYPE_KEY_QUERY_SEQUENCE_LENGTH_START_END, + DML_MULTIHEAD_ATTENTION_MASK_TYPE_BOOLEAN, +}; + +#endif // DML_TARGET_VERSION >= 0x6100 + +#if DML_TARGET_VERSION >= 0x6300 + +enum DML_QUANTIZATION_TYPE +{ + DML_QUANTIZATION_TYPE_NONE, + DML_QUANTIZATION_TYPE_SCALE, + DML_QUANTIZATION_TYPE_SCALE_ZERO_POINT, +}; + +#endif // DML_TARGET_VERSION >= 0x6300 + +// =================================================================================================================== +// Operator descriptions +// =================================================================================================================== + +struct DML_OPERATOR_DESC +{ + DML_OPERATOR_TYPE Type; + _Field_size_(_Inexpressible_("Dependent on operator type")) const void* Desc; +}; + +struct DML_ELEMENT_WISE_IDENTITY_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_ABS_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_ACOS_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_ADD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_ADD1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_OPERATOR_DESC* FusedActivation; +}; + +struct DML_ELEMENT_WISE_ASIN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_ATAN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_CEIL_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_CLIP_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; + FLOAT Min; + FLOAT Max; +}; + +struct DML_ELEMENT_WISE_COS_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_DIVIDE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_EXP_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_FLOOR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_LOG_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_LOGICAL_AND_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_LOGICAL_EQUALS_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_LOGICAL_GREATER_THAN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_LOGICAL_LESS_THAN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_LOGICAL_NOT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_LOGICAL_OR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_LOGICAL_XOR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_MAX_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_MEAN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_MIN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_MULTIPLY_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_POW_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* ExponentTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_CONSTANT_POW_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; + FLOAT Exponent; +}; + +struct DML_ELEMENT_WISE_RECIP_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_SIN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_SQRT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_SUBTRACT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_TAN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_THRESHOLD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; + FLOAT Min; +}; + +struct DML_ELEMENT_WISE_QUANTIZE_LINEAR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* ScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* ZeroPointTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_DEQUANTIZE_LINEAR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* ScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* ZeroPointTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_ELU_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; +}; + +struct DML_ACTIVATION_HARDMAX_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_HARD_SIGMOID_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; + FLOAT Beta; +}; + +struct DML_ACTIVATION_IDENTITY_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_LEAKY_RELU_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; +}; + +struct DML_ACTIVATION_LINEAR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; + FLOAT Beta; +}; + +struct DML_ACTIVATION_LOG_SOFTMAX_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_PARAMETERIZED_RELU_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* SlopeTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_PARAMETRIC_SOFTPLUS_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; + FLOAT Beta; +}; + +struct DML_ACTIVATION_RELU_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_SCALED_ELU_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; + FLOAT Gamma; +}; + +struct DML_ACTIVATION_SCALED_TANH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; + FLOAT Beta; +}; + +struct DML_ACTIVATION_SIGMOID_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_SOFTMAX_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_SOFTPLUS_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Steepness; +}; + +struct DML_ACTIVATION_SOFTSIGN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_TANH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_THRESHOLDED_RELU_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; +}; + +struct DML_CONVOLUTION_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* FilterTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_CONVOLUTION_MODE Mode; + DML_CONVOLUTION_DIRECTION Direction; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* Dilations; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + _Field_size_(DimensionCount) const UINT* OutputPadding; + UINT GroupCount; + _Maybenull_ const DML_OPERATOR_DESC* FusedActivation; +}; + +struct DML_GEMM_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + _Maybenull_ const DML_TENSOR_DESC* CTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_MATRIX_TRANSFORM TransA; + DML_MATRIX_TRANSFORM TransB; + FLOAT Alpha; + FLOAT Beta; + _Maybenull_ const DML_OPERATOR_DESC* FusedActivation; +}; + +struct DML_REDUCE_OPERATOR_DESC +{ + DML_REDUCE_FUNCTION Function; + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT AxisCount; + _Field_size_(AxisCount) const UINT* Axes; +}; + +struct DML_AVERAGE_POOLING_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + BOOL IncludePadding; +}; + +struct DML_LP_POOLING_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + UINT P; +}; + +struct DML_MAX_POOLING_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; +}; + +struct DML_ROI_POOLING_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* ROITensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT SpatialScale; + DML_SIZE_2D PooledSize; +}; + +struct DML_SLICE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Offsets; + _Field_size_(DimensionCount) const UINT* Sizes; + _Field_size_(DimensionCount) const UINT* Strides; +}; + +struct DML_CAST_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_SPLIT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + UINT OutputCount; + _Field_size_(OutputCount) const DML_TENSOR_DESC* OutputTensors; + UINT Axis; +}; + +struct DML_JOIN_OPERATOR_DESC +{ + UINT InputCount; + _Field_size_(InputCount) const DML_TENSOR_DESC* InputTensors; + const DML_TENSOR_DESC* OutputTensor; + UINT Axis; +}; + +struct DML_PADDING_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_PADDING_MODE PaddingMode; + FLOAT PaddingValue; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; +}; + +struct DML_VALUE_SCALE_2D_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Scale; + UINT ChannelCount; + _Field_size_(ChannelCount) const FLOAT* Bias; +}; + +struct DML_UPSAMPLE_2D_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_SIZE_2D ScaleSize; + DML_INTERPOLATION_MODE InterpolationMode; +}; + +struct DML_GATHER_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* IndicesTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT Axis; + UINT IndexDimensions; +}; + +struct DML_SPACE_TO_DEPTH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT BlockSize; +}; + +struct DML_DEPTH_TO_SPACE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT BlockSize; +}; + +struct DML_TILE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT RepeatsCount; + _Field_size_(RepeatsCount) const UINT* Repeats; +}; + +struct DML_TOP_K_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputValueTensor; + const DML_TENSOR_DESC* OutputIndexTensor; + UINT Axis; + UINT K; +}; + +struct DML_BATCH_NORMALIZATION_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* MeanTensor; + const DML_TENSOR_DESC* VarianceTensor; + const DML_TENSOR_DESC* ScaleTensor; + const DML_TENSOR_DESC* BiasTensor; + const DML_TENSOR_DESC* OutputTensor; + BOOL Spatial; + FLOAT Epsilon; + _Maybenull_ const DML_OPERATOR_DESC* FusedActivation; +}; + +struct DML_MEAN_VARIANCE_NORMALIZATION_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + _Maybenull_ const DML_TENSOR_DESC* ScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + const DML_TENSOR_DESC* OutputTensor; + BOOL CrossChannel; + BOOL NormalizeVariance; + FLOAT Epsilon; + _Maybenull_ const DML_OPERATOR_DESC* FusedActivation; +}; + +struct DML_LOCAL_RESPONSE_NORMALIZATION_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + BOOL CrossChannel; + UINT LocalSize; + FLOAT Alpha; + FLOAT Beta; + FLOAT Bias; +}; + +struct DML_LP_NORMALIZATION_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT Axis; + FLOAT Epsilon; + UINT P; +}; + +struct DML_RNN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* WeightTensor; + const DML_TENSOR_DESC* RecurrenceTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + _Maybenull_ const DML_TENSOR_DESC* HiddenInitTensor; + _Maybenull_ const DML_TENSOR_DESC* SequenceLengthsTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputSequenceTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputSingleTensor; + UINT ActivationDescCount; + _Field_size_(ActivationDescCount) const DML_OPERATOR_DESC* ActivationDescs; + DML_RECURRENT_NETWORK_DIRECTION Direction; +}; + +struct DML_LSTM_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* WeightTensor; + const DML_TENSOR_DESC* RecurrenceTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + _Maybenull_ const DML_TENSOR_DESC* HiddenInitTensor; + _Maybenull_ const DML_TENSOR_DESC* CellMemInitTensor; + _Maybenull_ const DML_TENSOR_DESC* SequenceLengthsTensor; + _Maybenull_ const DML_TENSOR_DESC* PeepholeTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputSequenceTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputSingleTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputCellSingleTensor; + UINT ActivationDescCount; + _Field_size_(ActivationDescCount) const DML_OPERATOR_DESC* ActivationDescs; + DML_RECURRENT_NETWORK_DIRECTION Direction; + float ClipThreshold; + BOOL UseClipThreshold; + BOOL CoupleInputForget; +}; + +struct DML_GRU_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* WeightTensor; + const DML_TENSOR_DESC* RecurrenceTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + _Maybenull_ const DML_TENSOR_DESC* HiddenInitTensor; + _Maybenull_ const DML_TENSOR_DESC* SequenceLengthsTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputSequenceTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputSingleTensor; + UINT ActivationDescCount; + _Field_size_(ActivationDescCount) const DML_OPERATOR_DESC* ActivationDescs; + DML_RECURRENT_NETWORK_DIRECTION Direction; + BOOL LinearBeforeReset; +}; + +#if DML_TARGET_VERSION >= 0x2000 + +struct DML_ELEMENT_WISE_SIGN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_IS_NAN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_ERF_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_SINH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_COSH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_TANH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_ASINH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_ACOSH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_ATANH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; +}; + +struct DML_ELEMENT_WISE_IF_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ConditionTensor; + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_SHRINK_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Bias; + FLOAT Threshold; +}; + +struct DML_MAX_POOLING1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputIndicesTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; +}; + +struct DML_MAX_UNPOOLING_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* IndicesTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_DIAGONAL_MATRIX_OPERATOR_DESC +{ + const DML_TENSOR_DESC* OutputTensor; + INT Offset; + FLOAT Value; +}; + +struct DML_SCATTER_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* IndicesTensor; + const DML_TENSOR_DESC* UpdatesTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT Axis; +}; + +struct DML_ONE_HOT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* IndicesTensor; + const DML_TENSOR_DESC* ValuesTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT Axis; +}; + +struct DML_RESAMPLE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_INTERPOLATION_MODE InterpolationMode; + UINT ScaleCount; + _Field_size_(ScaleCount) const FLOAT* Scales; +}; + +#endif // DML_TARGET_VERSION >= 0x2000 + +#if DML_TARGET_VERSION >= 0x2100 + +struct DML_ELEMENT_WISE_BIT_SHIFT_LEFT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_BIT_SHIFT_RIGHT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_ROUND_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_ROUNDING_MODE RoundingMode; +}; + +struct DML_ELEMENT_WISE_IS_INFINITY_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_IS_INFINITY_MODE InfinityMode; +}; + +struct DML_ELEMENT_WISE_MODULUS_TRUNCATE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_MODULUS_FLOOR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_FILL_VALUE_CONSTANT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* OutputTensor; + DML_TENSOR_DATA_TYPE ValueDataType; + DML_SCALAR_UNION Value; +}; + +struct DML_FILL_VALUE_SEQUENCE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* OutputTensor; + DML_TENSOR_DATA_TYPE ValueDataType; + DML_SCALAR_UNION ValueStart; + DML_SCALAR_UNION ValueDelta; +}; + +struct DML_CUMULATIVE_SUMMATION_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT Axis; + DML_AXIS_DIRECTION AxisDirection; + BOOL HasExclusiveSum; +}; + +struct DML_REVERSE_SUBSEQUENCES_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* SequenceLengthsTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT Axis; +}; + +struct DML_GATHER_ELEMENTS_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* IndicesTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT Axis; +}; + +// Alias existing operator, symmetric with DML_GATHER_ELEMENTS_OPERATOR_DESC. +using DML_SCATTER_ELEMENTS_OPERATOR_DESC = DML_SCATTER_OPERATOR_DESC; + +struct DML_GATHER_ND_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* IndicesTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT InputDimensionCount; + UINT IndicesDimensionCount; +}; + +struct DML_SCATTER_ND_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* IndicesTensor; + const DML_TENSOR_DESC* UpdatesTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT InputDimensionCount; + UINT IndicesDimensionCount; +}; + +struct DML_MAX_POOLING2_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputIndicesTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + _Field_size_(DimensionCount) const UINT* Dilations; +}; + +struct DML_SLICE1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* InputWindowOffsets; + _Field_size_(DimensionCount) const UINT* InputWindowSizes; + _Field_size_(DimensionCount) const INT* InputWindowStrides; +}; + +struct DML_TOP_K1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputValueTensor; + const DML_TENSOR_DESC* OutputIndexTensor; + UINT Axis; + UINT K; + DML_AXIS_DIRECTION AxisDirection; +}; + +struct DML_DEPTH_TO_SPACE1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT BlockSize; + DML_DEPTH_SPACE_ORDER Order; +}; + +struct DML_SPACE_TO_DEPTH1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT BlockSize; + DML_DEPTH_SPACE_ORDER Order; +}; + +struct DML_MEAN_VARIANCE_NORMALIZATION1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + _Maybenull_ const DML_TENSOR_DESC* ScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT AxisCount; + _Field_size_(AxisCount) const UINT* Axes; + BOOL NormalizeVariance; + FLOAT Epsilon; + _Maybenull_ const DML_OPERATOR_DESC* FusedActivation; +}; + +struct DML_RESAMPLE1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_INTERPOLATION_MODE InterpolationMode; + UINT DimensionCount; + _Field_size_(DimensionCount) const FLOAT* Scales; + _Field_size_(DimensionCount) const FLOAT* InputPixelOffsets; + _Field_size_(DimensionCount) const FLOAT* OutputPixelOffsets; +}; + +struct DML_MATRIX_MULTIPLY_INTEGER_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + _Maybenull_ const DML_TENSOR_DESC* AZeroPointTensor; + const DML_TENSOR_DESC* BTensor; + _Maybenull_ const DML_TENSOR_DESC* BZeroPointTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_QUANTIZED_LINEAR_MATRIX_MULTIPLY_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* AScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* AZeroPointTensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* BScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* BZeroPointTensor; + const DML_TENSOR_DESC* OutputScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputZeroPointTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_CONVOLUTION_INTEGER_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + _Maybenull_ const DML_TENSOR_DESC* InputZeroPointTensor; + const DML_TENSOR_DESC* FilterTensor; + _Maybenull_ const DML_TENSOR_DESC* FilterZeroPointTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* Dilations; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + UINT GroupCount; +}; + +struct DML_QUANTIZED_LINEAR_CONVOLUTION_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* InputZeroPointTensor; + const DML_TENSOR_DESC* FilterTensor; + const DML_TENSOR_DESC* FilterScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* FilterZeroPointTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + const DML_TENSOR_DESC* OutputScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputZeroPointTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* Dilations; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + UINT GroupCount; +}; + +#endif // DML_TARGET_VERSION >= 0x2100 + +#if DML_TARGET_VERSION >= 0x3000 + +struct DML_ELEMENT_WISE_BIT_AND_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_BIT_OR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_BIT_XOR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_BIT_NOT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_BIT_COUNT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_LOGICAL_GREATER_THAN_OR_EQUAL_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_LOGICAL_LESS_THAN_OR_EQUAL_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_CELU_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; +}; + +struct DML_ACTIVATION_RELU_GRAD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* OutputGradientTensor; +}; + +struct DML_AVERAGE_POOLING_GRAD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* OutputGradientTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + BOOL IncludePadding; +}; + +struct DML_MAX_POOLING_GRAD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* OutputGradientTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + _Field_size_(DimensionCount) const UINT* Dilations; +}; + +struct DML_RANDOM_GENERATOR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputStateTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputStateTensor; + DML_RANDOM_GENERATOR_TYPE Type; +}; + +struct DML_NONZERO_COORDINATES_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputCountTensor; + const DML_TENSOR_DESC* OutputCoordinatesTensor; +}; + +struct DML_RESAMPLE_GRAD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* OutputGradientTensor; + DML_INTERPOLATION_MODE InterpolationMode; + UINT DimensionCount; + _Field_size_(DimensionCount) const FLOAT* Scales; + _Field_size_(DimensionCount) const FLOAT* InputPixelOffsets; + _Field_size_(DimensionCount) const FLOAT* OutputPixelOffsets; +}; + +struct DML_SLICE_GRAD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* OutputGradientTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* InputWindowOffsets; + _Field_size_(DimensionCount) const UINT* InputWindowSizes; + _Field_size_(DimensionCount) const INT* InputWindowStrides; +}; + +struct DML_ADAM_OPTIMIZER_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputParametersTensor; + const DML_TENSOR_DESC* InputFirstMomentTensor; + const DML_TENSOR_DESC* InputSecondMomentTensor; + const DML_TENSOR_DESC* GradientTensor; + const DML_TENSOR_DESC* TrainingStepTensor; + const DML_TENSOR_DESC* OutputParametersTensor; + const DML_TENSOR_DESC* OutputFirstMomentTensor; + const DML_TENSOR_DESC* OutputSecondMomentTensor; + FLOAT LearningRate; + FLOAT Beta1; + FLOAT Beta2; + FLOAT Epsilon; +}; + +struct DML_ARGMIN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT AxisCount; + _Field_size_(AxisCount) const UINT* Axes; + DML_AXIS_DIRECTION AxisDirection; +}; + +struct DML_ARGMAX_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT AxisCount; + _Field_size_(AxisCount) const UINT* Axes; + DML_AXIS_DIRECTION AxisDirection; +}; + +struct DML_ROI_ALIGN_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* ROITensor; + const DML_TENSOR_DESC* BatchIndicesTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_REDUCE_FUNCTION ReductionFunction; + DML_INTERPOLATION_MODE InterpolationMode; + FLOAT SpatialScaleX; + FLOAT SpatialScaleY; + FLOAT OutOfBoundsInputValue; + UINT MinimumSamplesPerOutput; + UINT MaximumSamplesPerOutput; +}; + +struct DML_GATHER_ND1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* IndicesTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT InputDimensionCount; + UINT IndicesDimensionCount; + UINT BatchDimensionCount; +}; + +#endif // DML_TARGET_VERSION >= 0x3000 + +#if DML_TARGET_VERSION >= 0x3100 + +struct DML_ELEMENT_WISE_ATAN_YX_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ELEMENT_WISE_CLIP_GRAD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* OutputGradientTensor; + FLOAT Min; + FLOAT Max; +}; + +struct DML_ELEMENT_WISE_DIFFERENCE_SQUARE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_LOCAL_RESPONSE_NORMALIZATION_GRAD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* OutputGradientTensor; + BOOL CrossChannel; + UINT LocalSize; + FLOAT Alpha; + FLOAT Beta; + FLOAT Bias; +}; + +struct DML_CUMULATIVE_PRODUCT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT Axis; + DML_AXIS_DIRECTION AxisDirection; + BOOL HasExclusiveProduct; +}; + +struct DML_BATCH_NORMALIZATION_GRAD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* MeanTensor; + const DML_TENSOR_DESC* VarianceTensor; + const DML_TENSOR_DESC* ScaleTensor; + + const DML_TENSOR_DESC* OutputGradientTensor; + const DML_TENSOR_DESC* OutputScaleGradientTensor; + const DML_TENSOR_DESC* OutputBiasGradientTensor; + + FLOAT Epsilon; +}; + +#endif // DML_TARGET_VERSION >= 0x3100 + +#if DML_TARGET_VERSION >= 0x4000 +struct DML_ELEMENT_WISE_QUANTIZED_LINEAR_ADD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* AScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* AZeroPointTensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* BScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* BZeroPointTensor; + const DML_TENSOR_DESC* OutputScaleTensor; // This is an input tensor + _Maybenull_ const DML_TENSOR_DESC* OutputZeroPointTensor; // This is an input tensor + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_DYNAMIC_QUANTIZE_LINEAR_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + const DML_TENSOR_DESC* OutputScaleTensor; // This is an output tensor + const DML_TENSOR_DESC* OutputZeroPointTensor; // This is an output tensor +}; + +struct DML_ROI_ALIGN1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* ROITensor; + const DML_TENSOR_DESC* BatchIndicesTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_REDUCE_FUNCTION ReductionFunction; + DML_INTERPOLATION_MODE InterpolationMode; + FLOAT SpatialScaleX; + FLOAT SpatialScaleY; + FLOAT InputPixelOffset; + FLOAT OutputPixelOffset; + FLOAT OutOfBoundsInputValue; + UINT MinimumSamplesPerOutput; + UINT MaximumSamplesPerOutput; + BOOL AlignRegionsToCorners; +}; + +#endif // DML_TARGET_VERSION >= 0x4000 + +#if DML_TARGET_VERSION >= 0x4100 + +struct DML_ROI_ALIGN_GRAD_OPERATOR_DESC +{ + _Maybenull_ const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* ROITensor; + const DML_TENSOR_DESC* BatchIndicesTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputGradientTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputROIGradientTensor; + DML_REDUCE_FUNCTION ReductionFunction; + DML_INTERPOLATION_MODE InterpolationMode; + FLOAT SpatialScaleX; + FLOAT SpatialScaleY; + FLOAT InputPixelOffset; + FLOAT OutputPixelOffset; + UINT MinimumSamplesPerOutput; + UINT MaximumSamplesPerOutput; + BOOL AlignRegionsToCorners; +}; + +struct DML_BATCH_NORMALIZATION_TRAINING_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* ScaleTensor; + const DML_TENSOR_DESC* BiasTensor; + _Maybenull_ const DML_TENSOR_DESC* FusedAddTensor; + const DML_TENSOR_DESC* OutputTensor; + const DML_TENSOR_DESC* OutputMeanTensor; + const DML_TENSOR_DESC* OutputVarianceTensor; + FLOAT Epsilon; + _Maybenull_ const DML_OPERATOR_DESC* FusedActivation; +}; + +struct DML_BATCH_NORMALIZATION_TRAINING_GRAD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* MeanTensor; + const DML_TENSOR_DESC* VarianceTensor; + const DML_TENSOR_DESC* ScaleTensor; + const DML_TENSOR_DESC* OutputGradientTensor; + const DML_TENSOR_DESC* OutputScaleGradientTensor; + const DML_TENSOR_DESC* OutputBiasGradientTensor; + FLOAT Epsilon; +}; + +#endif // DML_TARGET_VERSION >= 0x4100 + +#if DML_TARGET_VERSION >= 0x5000 + +struct DML_ELEMENT_WISE_CLIP1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_SCALE_BIAS* ScaleBias; + DML_TENSOR_DATA_TYPE MinMaxDataType; + DML_SCALAR_UNION Min; + DML_SCALAR_UNION Max; +}; + +struct DML_ELEMENT_WISE_CLIP_GRAD1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* OutputGradientTensor; + DML_TENSOR_DATA_TYPE MinMaxDataType; + DML_SCALAR_UNION Min; + DML_SCALAR_UNION Max; +}; + +struct DML_PADDING1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_PADDING_MODE PaddingMode; + DML_TENSOR_DATA_TYPE PaddingValueDataType; + DML_SCALAR_UNION PaddingValue; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; +}; + +struct DML_ELEMENT_WISE_NEGATE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +#endif // DML_TARGET_VERSION >= 0x5000 + +#if DML_TARGET_VERSION >= 0x5100 + +struct DML_ACTIVATION_GELU_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_ACTIVATION_SOFTMAX1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT AxisCount; + _Field_size_(AxisCount) const UINT* Axes; +}; + +struct DML_ACTIVATION_LOG_SOFTMAX1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT AxisCount; + _Field_size_(AxisCount) const UINT* Axes; +}; + +struct DML_ACTIVATION_HARDMAX1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT AxisCount; + _Field_size_(AxisCount) const UINT* Axes; +}; + +struct DML_RESAMPLE2_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_INTERPOLATION_MODE InterpolationMode; + DML_AXIS_DIRECTION RoundingDirection; + UINT DimensionCount; + _Field_size_(DimensionCount) const FLOAT* Scales; + _Field_size_(DimensionCount) const FLOAT* InputPixelOffsets; + _Field_size_(DimensionCount) const FLOAT* OutputPixelOffsets; +}; + +struct DML_RESAMPLE_GRAD1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputGradientTensor; + const DML_TENSOR_DESC* OutputGradientTensor; + DML_INTERPOLATION_MODE InterpolationMode; + DML_AXIS_DIRECTION RoundingDirection; + UINT DimensionCount; + _Field_size_(DimensionCount) const FLOAT* Scales; + _Field_size_(DimensionCount) const FLOAT* InputPixelOffsets; + _Field_size_(DimensionCount) const FLOAT* OutputPixelOffsets; +}; + +struct DML_DIAGONAL_MATRIX1_OPERATOR_DESC +{ + _Maybenull_ const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_TENSOR_DATA_TYPE ValueDataType; + DML_SCALAR_UNION Value; + INT DiagonalFillBegin; + INT DiagonalFillEnd; +}; + +#endif // DML_TARGET_VERSION >= 0x5100 + +#if DML_TARGET_VERSION >= 0x6100 + +struct DML_MULTIHEAD_ATTENTION_OPERATOR_DESC +{ + _Maybenull_ const DML_TENSOR_DESC* QueryTensor; + _Maybenull_ const DML_TENSOR_DESC* KeyTensor; + _Maybenull_ const DML_TENSOR_DESC* ValueTensor; + _Maybenull_ const DML_TENSOR_DESC* StackedQueryKeyTensor; + _Maybenull_ const DML_TENSOR_DESC* StackedKeyValueTensor; + _Maybenull_ const DML_TENSOR_DESC* StackedQueryKeyValueTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + _Maybenull_ const DML_TENSOR_DESC* MaskTensor; + _Maybenull_ const DML_TENSOR_DESC* RelativePositionBiasTensor; + _Maybenull_ const DML_TENSOR_DESC* PastKeyTensor; + _Maybenull_ const DML_TENSOR_DESC* PastValueTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputPresentKeyTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputPresentValueTensor; + FLOAT Scale; + FLOAT MaskFilterValue; + UINT HeadCount; + DML_MULTIHEAD_ATTENTION_MASK_TYPE MaskType; +}; + +#endif // DML_TARGET_VERSION >= 0x6100 + +#if DML_TARGET_VERSION >= 0x6200 + +struct DML_LP_POOLING1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + _Field_size_(DimensionCount) const UINT* Dilations; + UINT P; +}; + +struct DML_AVERAGE_POOLING1_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + _Field_size_(DimensionCount) const UINT* Dilations; + BOOL IncludePadding; +}; + +struct DML_ACTIVATION_SWISH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT SigmoidInputScale; +}; + +struct DML_ACTIVATION_HARD_SWISH_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + FLOAT Alpha; + FLOAT Beta; +}; + +struct DML_QUANTIZED_LINEAR_AVERAGE_POOLING_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* InputScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* InputZeroPointTensor; + const DML_TENSOR_DESC* OutputScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputZeroPointTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* Strides; + _Field_size_(DimensionCount) const UINT* WindowSize; + _Field_size_(DimensionCount) const UINT* StartPadding; + _Field_size_(DimensionCount) const UINT* EndPadding; + _Field_size_(DimensionCount) const UINT* Dilations; + BOOL IncludePadding; +}; + +struct DML_MATRIX_MULTIPLY_INTEGER_TO_FLOAT_OPERATOR_DESC +{ + const DML_TENSOR_DESC* ATensor; + const DML_TENSOR_DESC* AScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* AZeroPointTensor; + const DML_TENSOR_DESC* BTensor; + const DML_TENSOR_DESC* BScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* BZeroPointTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + const DML_TENSOR_DESC* OutputTensor; +}; + +#endif // DML_TARGET_VERSION >= 0x6200 + +#if DML_TARGET_VERSION >= 0x6300 + +struct DML_MEAN_VARIANCE_NORMALIZATION2_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + _Maybenull_ const DML_TENSOR_DESC* ScaleTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT AxisCount; + _Field_size_(AxisCount) const UINT* Axes; + BOOL UseMean; + BOOL UseVariance; + FLOAT Epsilon; + _Maybenull_ const DML_OPERATOR_DESC* FusedActivation; +}; + +struct DML_MULTIHEAD_ATTENTION1_OPERATOR_DESC +{ + _Maybenull_ const DML_TENSOR_DESC* QueryTensor; + _Maybenull_ const DML_TENSOR_DESC* KeyTensor; + _Maybenull_ const DML_TENSOR_DESC* ValueTensor; + _Maybenull_ const DML_TENSOR_DESC* StackedQueryKeyTensor; + _Maybenull_ const DML_TENSOR_DESC* StackedKeyValueTensor; + _Maybenull_ const DML_TENSOR_DESC* StackedQueryKeyValueTensor; + _Maybenull_ const DML_TENSOR_DESC* BiasTensor; + _Maybenull_ const DML_TENSOR_DESC* MaskTensor; + _Maybenull_ const DML_TENSOR_DESC* RelativePositionBiasTensor; + _Maybenull_ const DML_TENSOR_DESC* PastKeyTensor; + _Maybenull_ const DML_TENSOR_DESC* PastValueTensor; + _Maybenull_ const DML_TENSOR_DESC* PastSequenceLengthsTensor; + const DML_TENSOR_DESC* OutputTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputPresentKeyTensor; + _Maybenull_ const DML_TENSOR_DESC* OutputPresentValueTensor; + FLOAT Scale; + FLOAT MaskFilterValue; + UINT QueryHeadCount; + UINT KeyValueHeadCount; + DML_MULTIHEAD_ATTENTION_MASK_TYPE MaskType; +}; + +struct DML_QUANTIZE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + DML_QUANTIZATION_TYPE QuantizationType; + UINT QuantizationTensorCount; + _Field_size_(QuantizationTensorCount) const DML_TENSOR_DESC* QuantizationTensors; + const DML_TENSOR_DESC* OutputTensor; +}; + +struct DML_DEQUANTIZE_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + DML_QUANTIZATION_TYPE QuantizationType; + UINT QuantizationTensorCount; + _Field_size_(QuantizationTensorCount) const DML_TENSOR_DESC* QuantizationTensors; + const DML_TENSOR_DESC* OutputTensor; +}; + +#endif // DML_TARGET_VERSION >= 0x6300 + +#if DML_TARGET_VERSION >= 0x6400 + +struct DML_RESAMPLE3_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + DML_INTERPOLATION_MODE InterpolationMode; + DML_AXIS_DIRECTION RoundingDirection; + UINT DimensionCount; + _Field_size_(DimensionCount) const FLOAT* Scales; + _Field_size_(DimensionCount) const FLOAT* InputPixelOffsets; + _Field_size_(DimensionCount) const FLOAT* OutputPixelOffsets; + BOOL Antialiased; +}; + +struct DML_FOLD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* WindowSizes; // Size of the extracted patch + _Field_size_(DimensionCount) const UINT* Strides; // Step size of the extracted patches + _Field_size_(DimensionCount) const UINT* Dilations; // Dialations of the extracted patch + _Field_size_(DimensionCount) const UINT* StartPadding; // Start padding of the "source tensor" + _Field_size_(DimensionCount) const UINT* EndPadding; // End padding of the "source tensor" +}; + +struct DML_UNFOLD_OPERATOR_DESC +{ + const DML_TENSOR_DESC* InputTensor; + const DML_TENSOR_DESC* OutputTensor; + UINT DimensionCount; + _Field_size_(DimensionCount) const UINT* WindowSizes; // Size of the extracted patch + _Field_size_(DimensionCount) const UINT* Strides; // Step size of the extracted patches + _Field_size_(DimensionCount) const UINT* Dilations; // Dialations of the extracted patch + _Field_size_(DimensionCount) const UINT* StartPadding; // Start padding of the "source tensor" + _Field_size_(DimensionCount) const UINT* EndPadding; // End padding of the "source tensor" +}; + +#endif // DML_TARGET_VERSION >= 0x6400 + +// =================================================================================================================== +// DML feature support queries +// =================================================================================================================== + +#if DML_TARGET_VERSION >= 0x2000 + +enum DML_FEATURE_LEVEL +{ + DML_FEATURE_LEVEL_1_0 = 0x1000, + DML_FEATURE_LEVEL_2_0 = 0x2000, + DML_FEATURE_LEVEL_2_1 = 0x2100, + DML_FEATURE_LEVEL_3_0 = 0x3000, + DML_FEATURE_LEVEL_3_1 = 0x3100, + DML_FEATURE_LEVEL_4_0 = 0x4000, + DML_FEATURE_LEVEL_4_1 = 0x4100, + DML_FEATURE_LEVEL_5_0 = 0x5000, + DML_FEATURE_LEVEL_5_1 = 0x5100, + DML_FEATURE_LEVEL_5_2 = 0x5200, + DML_FEATURE_LEVEL_6_0 = 0x6000, + DML_FEATURE_LEVEL_6_1 = 0x6100, + DML_FEATURE_LEVEL_6_2 = 0x6200, + DML_FEATURE_LEVEL_6_3 = 0x6300, + DML_FEATURE_LEVEL_6_4 = 0x6400, +}; + +#endif // DML_TARGET_VERSION >= 0x2000 + +enum DML_FEATURE +{ + DML_FEATURE_TENSOR_DATA_TYPE_SUPPORT, + +#if DML_TARGET_VERSION >= 0x2000 + DML_FEATURE_FEATURE_LEVELS, +#endif // DML_TARGET_VERSION >= 0x2000 +}; + +struct DML_FEATURE_QUERY_TENSOR_DATA_TYPE_SUPPORT +{ + DML_TENSOR_DATA_TYPE DataType; +}; + +struct DML_FEATURE_DATA_TENSOR_DATA_TYPE_SUPPORT +{ + BOOL IsSupported; +}; + +#if DML_TARGET_VERSION >= 0x2000 + +struct DML_FEATURE_QUERY_FEATURE_LEVELS +{ + UINT RequestedFeatureLevelCount; + _Field_size_(RequestedFeatureLevelCount) const DML_FEATURE_LEVEL* RequestedFeatureLevels; +}; + +struct DML_FEATURE_DATA_FEATURE_LEVELS +{ + DML_FEATURE_LEVEL MaxSupportedFeatureLevel; +}; + +#endif // DML_TARGET_VERSION >= 0x2000 + +// =================================================================================================================== +// DML device functions, enumerations, and structures +// =================================================================================================================== + +struct DML_BINDING_TABLE_DESC +{ + IDMLDispatchable* Dispatchable; + D3D12_CPU_DESCRIPTOR_HANDLE CPUDescriptorHandle; + D3D12_GPU_DESCRIPTOR_HANDLE GPUDescriptorHandle; + UINT SizeInDescriptors; +}; + +enum DML_EXECUTION_FLAGS +{ + DML_EXECUTION_FLAG_NONE = 0, + DML_EXECUTION_FLAG_ALLOW_HALF_PRECISION_COMPUTATION = 0x1, + DML_EXECUTION_FLAG_DISABLE_META_COMMANDS = 0x2, + DML_EXECUTION_FLAG_DESCRIPTORS_VOLATILE = 0x4, +}; + +DEFINE_ENUM_FLAG_OPERATORS(DML_EXECUTION_FLAGS) + +enum DML_CREATE_DEVICE_FLAGS +{ + DML_CREATE_DEVICE_FLAG_NONE = 0, + DML_CREATE_DEVICE_FLAG_DEBUG = 0x1, +}; + +DEFINE_ENUM_FLAG_OPERATORS(DML_CREATE_DEVICE_FLAGS) + +STDAPI DMLCreateDevice( + ID3D12Device* d3d12Device, + DML_CREATE_DEVICE_FLAGS flags, + REFIID riid, // Expected: IDMLDevice + _COM_Outptr_opt_ void** ppv + ); + +#if DML_TARGET_VERSION >= 0x2000 + +STDAPI DMLCreateDevice1( + ID3D12Device* d3d12Device, + DML_CREATE_DEVICE_FLAGS flags, + DML_FEATURE_LEVEL minimumFeatureLevel, + REFIID riid, // Expected: IDMLDevice + _COM_Outptr_opt_ void** ppv + ); + +#endif // DML_TARGET_VERSION >= 0x2000 + +// =================================================================================================================== +// DML object +// =================================================================================================================== + +interface DML_DECLARE_INTERFACE("c8263aac-9e0c-4a2d-9b8e-007521a3317c") IDMLObject : IUnknown +{ + IFACEMETHOD(GetPrivateData)( + REFGUID guid, + _Inout_ UINT* dataSize, + _Out_writes_bytes_opt_(*dataSize) void* data + ) = 0; + + IFACEMETHOD(SetPrivateData)( + REFGUID guid, + UINT dataSize, + _In_reads_bytes_opt_(dataSize) const void* data + ) = 0; + + IFACEMETHOD(SetPrivateDataInterface)( + REFGUID guid, + _In_opt_ IUnknown* data + ) = 0; + + IFACEMETHOD(SetName)( + PCWSTR name + ) = 0; +}; + +// =================================================================================================================== +// DML device +// =================================================================================================================== + +interface DML_DECLARE_INTERFACE("6dbd6437-96fd-423f-a98c-ae5e7c2a573f") IDMLDevice : IDMLObject +{ + IFACEMETHOD(CheckFeatureSupport)( + DML_FEATURE feature, + UINT featureQueryDataSize, + _In_reads_bytes_opt_(featureQueryDataSize) const void* featureQueryData, + UINT featureSupportDataSize, + _Out_writes_bytes_(featureSupportDataSize) void* featureSupportData + ) = 0; + + IFACEMETHOD(CreateOperator)( + const DML_OPERATOR_DESC* desc, + REFIID riid, // expected: IDMLOperator + _COM_Outptr_opt_ void** ppv + ) = 0; + + IFACEMETHOD(CompileOperator)( + IDMLOperator* op, + DML_EXECUTION_FLAGS flags, + REFIID riid, // expected: IDMLCompiledOperator + _COM_Outptr_opt_ void** ppv + ) = 0; + + IFACEMETHOD(CreateOperatorInitializer)( + UINT operatorCount, + _In_reads_opt_(operatorCount) IDMLCompiledOperator* const* operators, + REFIID riid, // expected: IDMLOperatorInitializer + _COM_Outptr_ void** ppv + ) = 0; + + IFACEMETHOD(CreateCommandRecorder)( + REFIID riid, // expected: IDMLCommandRecorder + _COM_Outptr_ void** ppv + ) = 0; + + IFACEMETHOD(CreateBindingTable)( + _In_opt_ const DML_BINDING_TABLE_DESC* desc, + REFIID riid, // expected: IDMLBindingTable + _COM_Outptr_ void** ppv + ) = 0; + + IFACEMETHOD(Evict)( + UINT count, + _In_reads_(count) IDMLPageable* const* ppObjects + ) = 0; + + IFACEMETHOD(MakeResident)( + UINT count, + _In_reads_(count) IDMLPageable* const* ppObjects + ) = 0; + + IFACEMETHOD(GetDeviceRemovedReason)( + ) = 0; + + IFACEMETHOD(GetParentDevice)( + REFIID riid, + _COM_Outptr_ void** ppv + ) = 0; +}; + + +// =================================================================================================================== +// DML device children +// =================================================================================================================== + +interface DML_DECLARE_INTERFACE("27e83142-8165-49e3-974e-2fd66e4cb69d") IDMLDeviceChild : IDMLObject +{ + IFACEMETHOD(GetDevice)( + REFIID riid, // expected: IDMLDevice + _COM_Outptr_ void** ppv + ) = 0; +}; + +interface DML_DECLARE_INTERFACE("b1ab0825-4542-4a4b-8617-6dde6e8f6201") IDMLPageable : IDMLDeviceChild +{ +}; + + +// =================================================================================================================== +// DML operator +// =================================================================================================================== + +interface DML_DECLARE_INTERFACE("26caae7a-3081-4633-9581-226fbe57695d") IDMLOperator : IDMLDeviceChild +{ +}; + + +// =================================================================================================================== +// DML dispatchable +// =================================================================================================================== + +struct DML_BINDING_PROPERTIES +{ + UINT RequiredDescriptorCount; + UINT64 TemporaryResourceSize; + UINT64 PersistentResourceSize; +}; + +interface DML_DECLARE_INTERFACE("dcb821a8-1039-441e-9f1c-b1759c2f3cec") IDMLDispatchable : IDMLPageable +{ + IFACEMETHOD_(DML_BINDING_PROPERTIES, GetBindingProperties)() = 0; +}; + + +// =================================================================================================================== +// DML compiled operator +// =================================================================================================================== + +interface DML_DECLARE_INTERFACE("6b15e56a-bf5c-4902-92d8-da3a650afea4") IDMLCompiledOperator : IDMLDispatchable +{ +}; + + +// =================================================================================================================== +// DML operator initializer +// =================================================================================================================== + +interface DML_DECLARE_INTERFACE("427c1113-435c-469c-8676-4d5dd072f813") IDMLOperatorInitializer : IDMLDispatchable +{ + IFACEMETHOD(Reset)( + UINT operatorCount, + _In_reads_opt_(operatorCount) IDMLCompiledOperator* const* operators + ) = 0; +}; + +// =================================================================================================================== +// DML binding table +// =================================================================================================================== + +enum DML_BINDING_TYPE +{ + DML_BINDING_TYPE_NONE, + DML_BINDING_TYPE_BUFFER, + DML_BINDING_TYPE_BUFFER_ARRAY, +}; + +struct DML_BINDING_DESC +{ + DML_BINDING_TYPE Type; + _Field_size_opt_(_Inexpressible_("Dependent on binding type")) const void* Desc; +}; + +struct DML_BUFFER_BINDING +{ + _Maybenull_ ID3D12Resource* Buffer; + UINT64 Offset; + UINT64 SizeInBytes; +}; + +struct DML_BUFFER_ARRAY_BINDING +{ + UINT BindingCount; + _Field_size_(BindingCount) const DML_BUFFER_BINDING* Bindings; +}; + +interface DML_DECLARE_INTERFACE("29c687dc-de74-4e3b-ab00-1168f2fc3cfc") IDMLBindingTable : IDMLDeviceChild +{ + IFACEMETHOD_(void, BindInputs)( + UINT bindingCount, + _In_reads_opt_(bindingCount) const DML_BINDING_DESC* bindings + ) = 0; + + IFACEMETHOD_(void, BindOutputs)( + UINT bindingCount, + _In_reads_opt_(bindingCount) const DML_BINDING_DESC* bindings + ) = 0; + + IFACEMETHOD_(void, BindTemporaryResource)( + _In_opt_ const DML_BINDING_DESC* binding + ) = 0; + + IFACEMETHOD_(void, BindPersistentResource)( + _In_opt_ const DML_BINDING_DESC* binding + ) = 0; + + IFACEMETHOD(Reset)( + _In_opt_ const DML_BINDING_TABLE_DESC* desc + ) = 0; +}; + + +// =================================================================================================================== +// DML command recorder +// =================================================================================================================== + +interface DML_DECLARE_INTERFACE("e6857a76-2e3e-4fdd-bff4-5d2ba10fb453") IDMLCommandRecorder : IDMLDeviceChild +{ + IFACEMETHOD_(void, RecordDispatch)( + ID3D12CommandList* commandList, + IDMLDispatchable* dispatchable, + IDMLBindingTable* bindings + ) = 0; +}; + + +// =================================================================================================================== +// DML debug +// =================================================================================================================== + +interface DML_DECLARE_INTERFACE("7d6f3ac9-394a-4ac3-92a7-390cc57a8217") IDMLDebugDevice : IUnknown +{ + IFACEMETHOD_(void, SetMuteDebugOutput)( + BOOL mute + ) = 0; +}; + + +// =================================================================================================================== +// DML graph +// =================================================================================================================== + +#if DML_TARGET_VERSION >= 0x2100 + +enum DML_GRAPH_EDGE_TYPE +{ + DML_GRAPH_EDGE_TYPE_INVALID, + DML_GRAPH_EDGE_TYPE_INPUT, + DML_GRAPH_EDGE_TYPE_OUTPUT, + DML_GRAPH_EDGE_TYPE_INTERMEDIATE, +}; + +struct DML_GRAPH_EDGE_DESC +{ + DML_GRAPH_EDGE_TYPE Type; + _Field_size_(_Inexpressible_("Dependent on edge type")) const void* Desc; +}; + +struct DML_INPUT_GRAPH_EDGE_DESC +{ + UINT GraphInputIndex; + UINT ToNodeIndex; + UINT ToNodeInputIndex; + _Field_z_ _Maybenull_ const char* Name; +}; + +struct DML_OUTPUT_GRAPH_EDGE_DESC +{ + UINT FromNodeIndex; + UINT FromNodeOutputIndex; + UINT GraphOutputIndex; + _Field_z_ _Maybenull_ const char* Name; +}; + +struct DML_INTERMEDIATE_GRAPH_EDGE_DESC +{ + UINT FromNodeIndex; + UINT FromNodeOutputIndex; + UINT ToNodeIndex; + UINT ToNodeInputIndex; + _Field_z_ _Maybenull_ const char* Name; +}; + +enum DML_GRAPH_NODE_TYPE +{ + DML_GRAPH_NODE_TYPE_INVALID, + DML_GRAPH_NODE_TYPE_OPERATOR, +#if DML_TARGET_VERSION >= 0x6200 + DML_GRAPH_NODE_TYPE_CONSTANT +#endif // DML_TARGET_VERSION >= 0x6200 +}; + +struct DML_GRAPH_NODE_DESC +{ + DML_GRAPH_NODE_TYPE Type; + _Field_size_(_Inexpressible_("Dependent on node type")) const void* Desc; +}; + +struct DML_OPERATOR_GRAPH_NODE_DESC +{ + IDMLOperator* Operator; + _Field_z_ _Maybenull_ const char* Name; +}; + +#if DML_TARGET_VERSION >= 0x6200 +struct DML_CONSTANT_DATA_GRAPH_NODE_DESC +{ + _Field_size_bytes_(DataSize) const void* Data; + SIZE_T DataSize; + _Field_z_ _Maybenull_ const char* Name; +}; +#endif // DML_TARGET_VERSION >= 0x6200 + +struct DML_GRAPH_DESC +{ + UINT InputCount; + UINT OutputCount; + + UINT NodeCount; + _Field_size_(NodeCount) const DML_GRAPH_NODE_DESC* Nodes; + + UINT InputEdgeCount; + _Field_size_opt_(InputEdgeCount) const DML_GRAPH_EDGE_DESC* InputEdges; + + UINT OutputEdgeCount; + _Field_size_(OutputEdgeCount) const DML_GRAPH_EDGE_DESC* OutputEdges; + + UINT IntermediateEdgeCount; + _Field_size_opt_(IntermediateEdgeCount) const DML_GRAPH_EDGE_DESC* IntermediateEdges; +}; + +interface DML_DECLARE_INTERFACE("a0884f9a-d2be-4355-aa5d-5901281ad1d2") IDMLDevice1 : IDMLDevice +{ + IFACEMETHOD(CompileGraph)( + const DML_GRAPH_DESC* desc, + DML_EXECUTION_FLAGS flags, + REFIID riid, // expected: IDMLCompiledOperator + _COM_Outptr_opt_ void** ppv + ) = 0; +}; + +#endif // DML_TARGET_VERSION >= 0x2100 + +#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) +#endif // DIRECTML_H diff --git a/deps/DirectX-Headers/include/directx/d3d12.h b/deps/DirectX-Headers/include/directx/d3d12.h index 576e504..6e79c24 100644 --- a/deps/DirectX-Headers/include/directx/d3d12.h +++ b/deps/DirectX-Headers/include/directx/d3d12.h @@ -290,6 +290,20 @@ typedef interface ID3D12StateObjectProperties ID3D12StateObjectProperties; #endif /* __ID3D12StateObjectProperties_FWD_DEFINED__ */ +#ifndef __ID3D12StateObjectProperties1_FWD_DEFINED__ +#define __ID3D12StateObjectProperties1_FWD_DEFINED__ +typedef interface ID3D12StateObjectProperties1 ID3D12StateObjectProperties1; + +#endif /* __ID3D12StateObjectProperties1_FWD_DEFINED__ */ + + +#ifndef __ID3D12WorkGraphProperties_FWD_DEFINED__ +#define __ID3D12WorkGraphProperties_FWD_DEFINED__ +typedef interface ID3D12WorkGraphProperties ID3D12WorkGraphProperties; + +#endif /* __ID3D12WorkGraphProperties_FWD_DEFINED__ */ + + #ifndef __ID3D12Device5_FWD_DEFINED__ #define __ID3D12Device5_FWD_DEFINED__ typedef interface ID3D12Device5 ID3D12Device5; @@ -437,6 +451,27 @@ typedef interface ID3D12Device11 ID3D12Device11; #endif /* __ID3D12Device11_FWD_DEFINED__ */ +#ifndef __ID3D12Device12_FWD_DEFINED__ +#define __ID3D12Device12_FWD_DEFINED__ +typedef interface ID3D12Device12 ID3D12Device12; + +#endif /* __ID3D12Device12_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device13_FWD_DEFINED__ +#define __ID3D12Device13_FWD_DEFINED__ +typedef interface ID3D12Device13 ID3D12Device13; + +#endif /* __ID3D12Device13_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device14_FWD_DEFINED__ +#define __ID3D12Device14_FWD_DEFINED__ +typedef interface ID3D12Device14 ID3D12Device14; + +#endif /* __ID3D12Device14_FWD_DEFINED__ */ + + #ifndef __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ #define __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ typedef interface ID3D12VirtualizationGuestDevice ID3D12VirtualizationGuestDevice; @@ -479,6 +514,13 @@ typedef interface ID3D12DeviceConfiguration ID3D12DeviceConfiguration; #endif /* __ID3D12DeviceConfiguration_FWD_DEFINED__ */ +#ifndef __ID3D12DeviceConfiguration1_FWD_DEFINED__ +#define __ID3D12DeviceConfiguration1_FWD_DEFINED__ +typedef interface ID3D12DeviceConfiguration1 ID3D12DeviceConfiguration1; + +#endif /* __ID3D12DeviceConfiguration1_FWD_DEFINED__ */ + + #ifndef __ID3D12GraphicsCommandList5_FWD_DEFINED__ #define __ID3D12GraphicsCommandList5_FWD_DEFINED__ typedef interface ID3D12GraphicsCommandList5 ID3D12GraphicsCommandList5; @@ -514,6 +556,20 @@ typedef interface ID3D12GraphicsCommandList9 ID3D12GraphicsCommandList9; #endif /* __ID3D12GraphicsCommandList9_FWD_DEFINED__ */ +#ifndef __ID3D12GraphicsCommandList10_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList10_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList10 ID3D12GraphicsCommandList10; + +#endif /* __ID3D12GraphicsCommandList10_FWD_DEFINED__ */ + + +#ifndef __ID3D12GBVDiagnostics_FWD_DEFINED__ +#define __ID3D12GBVDiagnostics_FWD_DEFINED__ +typedef interface ID3D12GBVDiagnostics ID3D12GBVDiagnostics; + +#endif /* __ID3D12GBVDiagnostics_FWD_DEFINED__ */ + + /* header files for imported files */ #include "oaidl.h" #include "ocidl.h" @@ -1046,7 +1102,7 @@ extern "C"{ #define D3D12_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 ) -#define D3D12_PREVIEW_SDK_VERSION ( 707 ) +#define D3D12_PREVIEW_SDK_VERSION ( 714 ) #define D3D12_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 16 ) @@ -1179,7 +1235,7 @@ extern "C"{ #define D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT ( 2 ) -#define D3D12_SDK_VERSION ( 608 ) +#define D3D12_SDK_VERSION ( 614 ) #define D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES ( 32 ) @@ -1297,6 +1353,16 @@ extern "C"{ #define D3D12_VIDEO_DECODE_STATUS_MACROBLOCKS_AFFECTED_UNKNOWN ( 0xffffffff ) +#define D3D12_VIDEO_ENCODER_AV1_INVALID_DPB_RESOURCE_INDEX ( 0xff ) + +#define D3D12_VIDEO_ENCODER_AV1_MAX_TILE_COLS ( 64 ) + +#define D3D12_VIDEO_ENCODER_AV1_MAX_TILE_ROWS ( 64 ) + +#define D3D12_VIDEO_ENCODER_AV1_SUPERRES_DENOM_MIN ( 9 ) + +#define D3D12_VIDEO_ENCODER_AV1_SUPERRES_NUM ( 8 ) + #define D3D12_VIDEO_PROCESS_MAX_FILTERS ( 32 ) #define D3D12_VIDEO_PROCESS_STEREO_VIEWS ( 2 ) @@ -1331,6 +1397,10 @@ extern "C"{ #define D3D12_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP ( 25 ) +#define D3D12_WORK_GRAPHS_BACKING_MEMORY_ALIGNMENT_IN_BYTES ( 8 ) + +#define D3D12_WORK_GRAPHS_MAX_NODE_DEPTH ( 32 ) + #endif typedef UINT64 D3D12_GPU_VIRTUAL_ADDRESS; @@ -1355,7 +1425,7 @@ enum D3D12_COMMAND_QUEUE_FLAGS D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1 } D3D12_COMMAND_QUEUE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_QUEUE_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_QUEUE_FLAGS ) typedef enum D3D12_COMMAND_QUEUE_PRIORITY { @@ -1664,6 +1734,29 @@ typedef struct D3D12_RASTERIZER_DESC1 D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster; } D3D12_RASTERIZER_DESC1; +typedef +enum D3D12_LINE_RASTERIZATION_MODE + { + D3D12_LINE_RASTERIZATION_MODE_ALIASED = 0, + D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED = ( D3D12_LINE_RASTERIZATION_MODE_ALIASED + 1 ) , + D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_WIDE = ( D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED + 1 ) , + D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_NARROW = ( D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_WIDE + 1 ) + } D3D12_LINE_RASTERIZATION_MODE; + +typedef struct D3D12_RASTERIZER_DESC2 + { + D3D12_FILL_MODE FillMode; + D3D12_CULL_MODE CullMode; + BOOL FrontCounterClockwise; + FLOAT DepthBias; + FLOAT DepthBiasClamp; + FLOAT SlopeScaledDepthBias; + BOOL DepthClipEnable; + D3D12_LINE_RASTERIZATION_MODE LineRasterizationMode; + UINT ForcedSampleCount; + D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster; + } D3D12_RASTERIZER_DESC2; + extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0000_v0_0_c_ifspec; @@ -2070,6 +2163,13 @@ enum D3D12_INDEX_BUFFER_STRIP_CUT_VALUE D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF = 2 } D3D12_INDEX_BUFFER_STRIP_CUT_VALUE; +typedef +enum D3D12_STANDARD_MULTISAMPLE_QUALITY_LEVELS + { + D3D12_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff, + D3D12_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe + } D3D12_STANDARD_MULTISAMPLE_QUALITY_LEVELS; + typedef struct D3D12_CACHED_PIPELINE_STATE { _Field_size_bytes_full_(CachedBlobSizeInBytes) const void *pCachedBlob; @@ -2085,7 +2185,7 @@ enum D3D12_PIPELINE_STATE_FLAGS D3D12_PIPELINE_STATE_FLAG_DYNAMIC_INDEX_BUFFER_STRIP_CUT = 0x8 } D3D12_PIPELINE_STATE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_PIPELINE_STATE_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_PIPELINE_STATE_FLAGS ) typedef struct D3D12_GRAPHICS_PIPELINE_STATE_DESC { ID3D12RootSignature *pRootSignature; @@ -2161,7 +2261,8 @@ enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS = 25, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 = 26, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1 = 27, - D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1 + 1 ) + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER2 = 28, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER2 + 1 ) } D3D12_PIPELINE_STATE_SUBOBJECT_TYPE; typedef @@ -2202,7 +2303,15 @@ enum D3D12_FEATURE D3D12_FEATURE_D3D12_OPTIONS13 = 42, D3D12_FEATURE_D3D12_OPTIONS14 = 43, D3D12_FEATURE_D3D12_OPTIONS15 = 44, - D3D12_FEATURE_D3D12_OPTIONS16 = 45 + D3D12_FEATURE_D3D12_OPTIONS16 = 45, + D3D12_FEATURE_D3D12_OPTIONS17 = 46, + D3D12_FEATURE_D3D12_OPTIONS18 = 47, + D3D12_FEATURE_D3D12_OPTIONS19 = 48, + D3D12_FEATURE_D3D12_OPTIONS20 = 49, + D3D12_FEATURE_PREDICATION = 50, + D3D12_FEATURE_PLACED_RESOURCE_SUPPORT_INFO = 51, + D3D12_FEATURE_HARDWARE_COPY = 52, + D3D12_FEATURE_D3D12_OPTIONS21 = 53 } D3D12_FEATURE; typedef @@ -2213,7 +2322,7 @@ enum D3D12_SHADER_MIN_PRECISION_SUPPORT D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT = 0x2 } D3D12_SHADER_MIN_PRECISION_SUPPORT; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_MIN_PRECISION_SUPPORT ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_MIN_PRECISION_SUPPORT ) typedef enum D3D12_TILED_RESOURCES_TIER { @@ -2276,7 +2385,7 @@ enum D3D12_FORMAT_SUPPORT1 D3D12_FORMAT_SUPPORT1_VIDEO_ENCODER = 0x40000000 } D3D12_FORMAT_SUPPORT1; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT1 ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT1 ) typedef enum D3D12_FORMAT_SUPPORT2 { @@ -2295,7 +2404,7 @@ enum D3D12_FORMAT_SUPPORT2 D3D12_FORMAT_SUPPORT2_SAMPLER_FEEDBACK = 0x8000 } D3D12_FORMAT_SUPPORT2; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 ) typedef enum D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS { @@ -2303,7 +2412,7 @@ enum D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE = 0x1 } D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS ) typedef enum D3D12_CROSS_NODE_SHARING_TIER { @@ -2338,6 +2447,13 @@ enum D3D12_VIEW_INSTANCING_TIER D3D12_VIEW_INSTANCING_TIER_3 = 3 } D3D12_VIEW_INSTANCING_TIER; +typedef +enum D3D12_WORK_GRAPHS_TIER + { + D3D12_WORK_GRAPHS_TIER_NOT_SUPPORTED = 0, + D3D12_WORK_GRAPHS_TIER_1_0 = 10 + } D3D12_WORK_GRAPHS_TIER; + typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS { _Out_ BOOL DoublePrecisionFloatShaderOps; @@ -2378,7 +2494,8 @@ enum D3D_ROOT_SIGNATURE_VERSION { D3D_ROOT_SIGNATURE_VERSION_1 = 0x1, D3D_ROOT_SIGNATURE_VERSION_1_0 = 0x1, - D3D_ROOT_SIGNATURE_VERSION_1_1 = 0x2 + D3D_ROOT_SIGNATURE_VERSION_1_1 = 0x2, + D3D_ROOT_SIGNATURE_VERSION_1_2 = 0x3 } D3D_ROOT_SIGNATURE_VERSION; typedef struct D3D12_FEATURE_DATA_ROOT_SIGNATURE @@ -2413,6 +2530,7 @@ typedef struct D3D12_FEATURE_DATA_FEATURE_LEVELS typedef enum D3D_SHADER_MODEL { + D3D_SHADER_MODEL_NONE = 0, D3D_SHADER_MODEL_5_1 = 0x51, D3D_SHADER_MODEL_6_0 = 0x60, D3D_SHADER_MODEL_6_1 = 0x61, @@ -2423,7 +2541,8 @@ enum D3D_SHADER_MODEL D3D_SHADER_MODEL_6_6 = 0x66, D3D_SHADER_MODEL_6_7 = 0x67, D3D_SHADER_MODEL_6_8 = 0x68, - D3D_HIGHEST_SHADER_MODEL = D3D_SHADER_MODEL_6_8 + D3D_SHADER_MODEL_6_9 = 0x69, + D3D_HIGHEST_SHADER_MODEL = D3D_SHADER_MODEL_6_9 } D3D_SHADER_MODEL; typedef struct D3D12_FEATURE_DATA_SHADER_MODEL @@ -2471,7 +2590,7 @@ enum D3D12_SHADER_CACHE_SUPPORT_FLAGS D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE = 0x40 } D3D12_SHADER_CACHE_SUPPORT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_SUPPORT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_SUPPORT_FLAGS ) typedef struct D3D12_FEATURE_DATA_SHADER_CACHE { _Out_ D3D12_SHADER_CACHE_SUPPORT_FLAGS SupportFlags; @@ -2497,7 +2616,7 @@ enum D3D12_COMMAND_LIST_SUPPORT_FLAGS D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_ENCODE = ( 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE ) } D3D12_COMMAND_LIST_SUPPORT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_SUPPORT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_SUPPORT_FLAGS ) typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3 { _Out_ BOOL CopyQueueTimestampQueriesSupported; @@ -2697,9 +2816,72 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS15 typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS16 { _Out_ BOOL DynamicDepthBiasSupported; - _Out_ BOOL Reserved; + _Out_ BOOL GPUUploadHeapSupported; } D3D12_FEATURE_DATA_D3D12_OPTIONS16; +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS17 + { + _Out_ BOOL NonNormalizedCoordinateSamplersSupported; + _Out_ BOOL ManualWriteTrackingResourceSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS17; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS18 + { + _Out_ BOOL RenderPassesValid; + } D3D12_FEATURE_DATA_D3D12_OPTIONS18; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS19 + { + BOOL MismatchingOutputDimensionsSupported; + UINT SupportedSampleCountsWithNoOutputs; + BOOL PointSamplingAddressesNeverRoundUp; + BOOL RasterizerDesc2Supported; + BOOL NarrowQuadrilateralLinesSupported; + BOOL AnisoFilterWithPointMipSupported; + UINT MaxSamplerDescriptorHeapSize; + UINT MaxSamplerDescriptorHeapSizeWithStaticSamplers; + UINT MaxViewDescriptorHeapSize; + _Out_ BOOL ComputeOnlyCustomHeapSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS19; + +typedef +enum D3D12_RECREATE_AT_TIER + { + D3D12_RECREATE_AT_TIER_NOT_SUPPORTED = 0, + D3D12_RECREATE_AT_TIER_1 = 1 + } D3D12_RECREATE_AT_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS20 + { + _Out_ BOOL ComputeOnlyWriteWatchSupported; + D3D12_RECREATE_AT_TIER RecreateAtTier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS20; + +typedef +enum D3D12_EXECUTE_INDIRECT_TIER + { + D3D12_EXECUTE_INDIRECT_TIER_1_0 = 10, + D3D12_EXECUTE_INDIRECT_TIER_1_1 = 11 + } D3D12_EXECUTE_INDIRECT_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS21 + { + _Out_ D3D12_WORK_GRAPHS_TIER WorkGraphsTier; + _Out_ D3D12_EXECUTE_INDIRECT_TIER ExecuteIndirectTier; + _Out_ BOOL SampleCmpGradientAndBiasSupported; + _Out_ BOOL ExtendedCommandInfoSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS21; + +typedef struct D3D12_FEATURE_DATA_PREDICATION + { + _Out_ BOOL Supported; + } D3D12_FEATURE_DATA_PREDICATION; + +typedef struct D3D12_FEATURE_DATA_HARDWARE_COPY + { + _Out_ BOOL Supported; + } D3D12_FEATURE_DATA_HARDWARE_COPY; + typedef struct D3D12_RESOURCE_ALLOCATION_INFO { UINT64 SizeInBytes; @@ -2719,7 +2901,8 @@ enum D3D12_HEAP_TYPE D3D12_HEAP_TYPE_DEFAULT = 1, D3D12_HEAP_TYPE_UPLOAD = 2, D3D12_HEAP_TYPE_READBACK = 3, - D3D12_HEAP_TYPE_CUSTOM = 4 + D3D12_HEAP_TYPE_CUSTOM = 4, + D3D12_HEAP_TYPE_GPU_UPLOAD = 5 } D3D12_HEAP_TYPE; typedef @@ -2763,13 +2946,14 @@ enum D3D12_HEAP_FLAGS D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS = 0x400, D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT = 0x800, D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = 0x1000, + D3D12_HEAP_FLAG_TOOLS_USE_MANUAL_WRITE_TRACKING = 0x2000, D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0, D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS = 0xc0, D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES = 0x44, D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES = 0x84 } D3D12_HEAP_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_HEAP_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_HEAP_FLAGS ) typedef struct D3D12_HEAP_DESC { UINT64 SizeInBytes; @@ -2788,6 +2972,14 @@ enum D3D12_RESOURCE_DIMENSION D3D12_RESOURCE_DIMENSION_TEXTURE3D = 4 } D3D12_RESOURCE_DIMENSION; +typedef struct D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO + { + _In_ DXGI_FORMAT Format; + _In_ D3D12_RESOURCE_DIMENSION Dimension; + _In_ D3D12_HEAP_PROPERTIES DestHeapProperties; + _Out_ BOOL Supported; + } D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO; + typedef enum D3D12_TEXTURE_LAYOUT { @@ -2812,7 +3004,7 @@ enum D3D12_RESOURCE_FLAGS D3D12_RESOURCE_FLAG_RAYTRACING_ACCELERATION_STRUCTURE = 0x100 } D3D12_RESOURCE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS ) typedef struct D3D12_MIP_REGION { UINT Width; @@ -2946,7 +3138,7 @@ enum D3D12_TILE_MAPPING_FLAGS D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1 } D3D12_TILE_MAPPING_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_MAPPING_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_MAPPING_FLAGS ) typedef enum D3D12_TILE_COPY_FLAGS { @@ -2956,7 +3148,7 @@ enum D3D12_TILE_COPY_FLAGS D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x4 } D3D12_TILE_COPY_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_COPY_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_COPY_FLAGS ) typedef enum D3D12_RESOURCE_STATES { @@ -2977,6 +3169,11 @@ enum D3D12_RESOURCE_STATES D3D12_RESOURCE_STATE_RESOLVE_SOURCE = 0x2000, D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE = 0x400000, D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE = 0x1000000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_8000 = 0x8000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_4000 = 0x4000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_100000 = 0x100000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_40000000 = 0x40000000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_80000000 = 0x80000000, D3D12_RESOURCE_STATE_GENERIC_READ = ( ( ( ( ( 0x1 | 0x2 ) | 0x40 ) | 0x80 ) | 0x200 ) | 0x800 ) , D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE = ( 0x40 | 0x80 ) , D3D12_RESOURCE_STATE_PRESENT = 0, @@ -2989,7 +3186,7 @@ enum D3D12_RESOURCE_STATES D3D12_RESOURCE_STATE_VIDEO_ENCODE_WRITE = 0x800000 } D3D12_RESOURCE_STATES; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_STATES ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_STATES ) typedef enum D3D12_RESOURCE_BARRIER_TYPE { @@ -3026,7 +3223,7 @@ enum D3D12_RESOURCE_BARRIER_FLAGS D3D12_RESOURCE_BARRIER_FLAG_END_ONLY = 0x2 } D3D12_RESOURCE_BARRIER_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_BARRIER_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_BARRIER_FLAGS ) typedef struct D3D12_RESOURCE_BARRIER { D3D12_RESOURCE_BARRIER_TYPE Type; @@ -3102,7 +3299,7 @@ enum D3D12_VIEW_INSTANCING_FLAGS D3D12_VIEW_INSTANCING_FLAG_ENABLE_VIEW_INSTANCE_MASKING = 0x1 } D3D12_VIEW_INSTANCING_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIEW_INSTANCING_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIEW_INSTANCING_FLAGS ) typedef struct D3D12_VIEW_INSTANCING_DESC { UINT ViewInstanceCount; @@ -3138,7 +3335,7 @@ enum D3D12_BUFFER_SRV_FLAGS D3D12_BUFFER_SRV_FLAG_RAW = 0x1 } D3D12_BUFFER_SRV_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_SRV_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_SRV_FLAGS ) typedef struct D3D12_BUFFER_SRV { UINT64 FirstElement; @@ -3275,6 +3472,7 @@ enum D3D12_FILTER D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, D3D12_FILTER_MIN_MAG_MIP_LINEAR = 0x15, + D3D12_FILTER_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x54, D3D12_FILTER_ANISOTROPIC = 0x55, D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, @@ -3284,6 +3482,7 @@ enum D3D12_FILTER D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, D3D12_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, + D3D12_FILTER_COMPARISON_MIN_MAG_ANISOTROPIC_MIP_POINT = 0xd4, D3D12_FILTER_COMPARISON_ANISOTROPIC = 0xd5, D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100, D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101, @@ -3293,6 +3492,7 @@ enum D3D12_FILTER D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111, D3D12_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114, D3D12_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115, + D3D12_FILTER_MINIMUM_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x154, D3D12_FILTER_MINIMUM_ANISOTROPIC = 0x155, D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180, D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181, @@ -3302,6 +3502,7 @@ enum D3D12_FILTER D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191, D3D12_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194, D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195, + D3D12_FILTER_MAXIMUM_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x1d4, D3D12_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5 } D3D12_FILTER; @@ -3348,6 +3549,13 @@ enum D3D12_FILTER_REDUCTION_TYPE D3D12_FILTER_TYPE_LINEAR, \ D3D12_FILTER_TYPE_LINEAR, \ reduction ) ) ) +#define D3D12_ENCODE_MIN_MAG_ANISOTROPIC_MIP_POINT_FILTER( reduction ) \ + ( ( D3D12_FILTER ) ( \ + D3D12_ANISOTROPIC_FILTERING_BIT | \ + D3D12_ENCODE_BASIC_FILTER( D3D12_FILTER_TYPE_LINEAR, \ + D3D12_FILTER_TYPE_LINEAR, \ + D3D12_FILTER_TYPE_POINT, \ + reduction ) ) ) #define D3D12_DECODE_MIN_FILTER( D3D12Filter ) \ ( ( D3D12_FILTER_TYPE ) \ ( ( ( D3D12Filter ) >> D3D12_MIN_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) @@ -3365,8 +3573,7 @@ enum D3D12_FILTER_REDUCTION_TYPE #define D3D12_DECODE_IS_ANISOTROPIC_FILTER( D3D12Filter ) \ ( ( ( D3D12Filter ) & D3D12_ANISOTROPIC_FILTERING_BIT ) && \ ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIN_FILTER( D3D12Filter ) ) && \ - ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) && \ - ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIP_FILTER( D3D12Filter ) ) ) + ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) ) typedef enum D3D12_TEXTURE_ADDRESS_MODE { @@ -3395,10 +3602,11 @@ typedef enum D3D12_SAMPLER_FLAGS { D3D12_SAMPLER_FLAG_NONE = 0, - D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x1 + D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x1, + D3D12_SAMPLER_FLAG_NON_NORMALIZED_COORDINATES = 0x2 } D3D12_SAMPLER_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_SAMPLER_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SAMPLER_FLAGS ) typedef struct D3D12_SAMPLER_DESC2 { D3D12_FILTER Filter; @@ -3425,7 +3633,7 @@ enum D3D12_BUFFER_UAV_FLAGS D3D12_BUFFER_UAV_FLAG_RAW = 0x1 } D3D12_BUFFER_UAV_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_UAV_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_UAV_FLAGS ) typedef struct D3D12_BUFFER_UAV { UINT64 FirstElement; @@ -3634,7 +3842,7 @@ enum D3D12_DSV_FLAGS D3D12_DSV_FLAG_READ_ONLY_STENCIL = 0x2 } D3D12_DSV_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_DSV_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DSV_FLAGS ) typedef enum D3D12_DSV_DIMENSION { @@ -3670,7 +3878,7 @@ enum D3D12_CLEAR_FLAGS D3D12_CLEAR_FLAG_STENCIL = 0x2 } D3D12_CLEAR_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_CLEAR_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_CLEAR_FLAGS ) typedef enum D3D12_FENCE_FLAGS { @@ -3680,7 +3888,7 @@ enum D3D12_FENCE_FLAGS D3D12_FENCE_FLAG_NON_MONITORED = 0x4 } D3D12_FENCE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_FENCE_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_FENCE_FLAGS ) typedef enum D3D12_DESCRIPTOR_HEAP_TYPE { @@ -3698,7 +3906,7 @@ enum D3D12_DESCRIPTOR_HEAP_FLAGS D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE = 0x1 } D3D12_DESCRIPTOR_HEAP_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_HEAP_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_HEAP_FLAGS ) typedef struct D3D12_DESCRIPTOR_HEAP_DESC { D3D12_DESCRIPTOR_HEAP_TYPE Type; @@ -3797,7 +4005,7 @@ enum D3D12_ROOT_SIGNATURE_FLAGS D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED = 0x800 } D3D12_ROOT_SIGNATURE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS ) typedef enum D3D12_STATIC_BORDER_COLOR { @@ -3825,6 +4033,24 @@ typedef struct D3D12_STATIC_SAMPLER_DESC D3D12_SHADER_VISIBILITY ShaderVisibility; } D3D12_STATIC_SAMPLER_DESC; +typedef struct D3D12_STATIC_SAMPLER_DESC1 + { + D3D12_FILTER Filter; + D3D12_TEXTURE_ADDRESS_MODE AddressU; + D3D12_TEXTURE_ADDRESS_MODE AddressV; + D3D12_TEXTURE_ADDRESS_MODE AddressW; + FLOAT MipLODBias; + UINT MaxAnisotropy; + D3D12_COMPARISON_FUNC ComparisonFunc; + D3D12_STATIC_BORDER_COLOR BorderColor; + FLOAT MinLOD; + FLOAT MaxLOD; + UINT ShaderRegister; + UINT RegisterSpace; + D3D12_SHADER_VISIBILITY ShaderVisibility; + D3D12_SAMPLER_FLAGS Flags; + } D3D12_STATIC_SAMPLER_DESC1; + typedef struct D3D12_ROOT_SIGNATURE_DESC { UINT NumParameters; @@ -3845,7 +4071,7 @@ enum D3D12_DESCRIPTOR_RANGE_FLAGS D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS = 0x10000 } D3D12_DESCRIPTOR_RANGE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_RANGE_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_RANGE_FLAGS ) typedef struct D3D12_DESCRIPTOR_RANGE1 { D3D12_DESCRIPTOR_RANGE_TYPE RangeType; @@ -3871,7 +4097,7 @@ enum D3D12_ROOT_DESCRIPTOR_FLAGS D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC = 0x8 } D3D12_ROOT_DESCRIPTOR_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_DESCRIPTOR_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_DESCRIPTOR_FLAGS ) typedef struct D3D12_ROOT_DESCRIPTOR1 { UINT ShaderRegister; @@ -3900,6 +4126,15 @@ typedef struct D3D12_ROOT_SIGNATURE_DESC1 D3D12_ROOT_SIGNATURE_FLAGS Flags; } D3D12_ROOT_SIGNATURE_DESC1; +typedef struct D3D12_ROOT_SIGNATURE_DESC2 + { + UINT NumParameters; + _Field_size_full_(NumParameters) const D3D12_ROOT_PARAMETER1 *pParameters; + UINT NumStaticSamplers; + _Field_size_full_(NumStaticSamplers) const D3D12_STATIC_SAMPLER_DESC1 *pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; + } D3D12_ROOT_SIGNATURE_DESC2; + typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC { D3D_ROOT_SIGNATURE_VERSION Version; @@ -3907,6 +4142,7 @@ typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC { D3D12_ROOT_SIGNATURE_DESC Desc_1_0; D3D12_ROOT_SIGNATURE_DESC1 Desc_1_1; + D3D12_ROOT_SIGNATURE_DESC2 Desc_1_2; } ; } D3D12_VERSIONED_ROOT_SIGNATURE_DESC; @@ -4297,7 +4533,8 @@ enum D3D12_INDIRECT_ARGUMENT_TYPE D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW + 1 ) , D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW + 1 ) , D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS = ( D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW + 1 ) , - D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH = ( D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS + 1 ) + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH = ( D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_INCREMENTING_CONSTANT = ( D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH + 1 ) } D3D12_INDIRECT_ARGUMENT_TYPE; typedef struct D3D12_INDIRECT_ARGUMENT_DESC @@ -4327,6 +4564,11 @@ typedef struct D3D12_INDIRECT_ARGUMENT_DESC { UINT RootParameterIndex; } UnorderedAccessView; + struct + { + UINT RootParameterIndex; + UINT DestOffsetIn32BitValues; + } IncrementingConstant; } ; } D3D12_INDIRECT_ARGUMENT_DESC; @@ -9825,7 +10067,7 @@ enum D3D12_MULTIPLE_FENCE_WAIT_FLAGS D3D12_MULTIPLE_FENCE_WAIT_FLAG_ALL = 0 } D3D12_MULTIPLE_FENCE_WAIT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTIPLE_FENCE_WAIT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTIPLE_FENCE_WAIT_FLAGS ) typedef enum D3D12_RESIDENCY_PRIORITY { @@ -11035,7 +11277,7 @@ enum D3D12_RESIDENCY_FLAGS D3D12_RESIDENCY_FLAG_DENY_OVERBUDGET = 0x1 } D3D12_RESIDENCY_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESIDENCY_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESIDENCY_FLAGS ) extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0025_v0_0_c_ifspec; @@ -11686,21 +11928,21 @@ enum D3D12_COMMAND_LIST_FLAGS D3D12_COMMAND_LIST_FLAG_NONE = 0 } D3D12_COMMAND_LIST_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_FLAGS ) typedef enum D3D12_COMMAND_POOL_FLAGS { D3D12_COMMAND_POOL_FLAG_NONE = 0 } D3D12_COMMAND_POOL_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_POOL_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_POOL_FLAGS ) typedef enum D3D12_COMMAND_RECORDER_FLAGS { D3D12_COMMAND_RECORDER_FLAG_NONE = 0 } D3D12_COMMAND_RECORDER_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_RECORDER_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_RECORDER_FLAGS ) typedef enum D3D12_PROTECTED_SESSION_STATUS { @@ -11865,7 +12107,7 @@ enum D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED = 0x1 } D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS ) typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT { UINT NodeIndex; @@ -11878,7 +12120,7 @@ enum D3D12_PROTECTED_RESOURCE_SESSION_FLAGS D3D12_PROTECTED_RESOURCE_SESSION_FLAG_NONE = 0 } D3D12_PROTECTED_RESOURCE_SESSION_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_FLAGS ) typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC { UINT NodeMask; @@ -13202,7 +13444,7 @@ enum D3D12_META_COMMAND_PARAMETER_FLAGS D3D12_META_COMMAND_PARAMETER_FLAG_OUTPUT = 0x2 } D3D12_META_COMMAND_PARAMETER_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_META_COMMAND_PARAMETER_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_META_COMMAND_PARAMETER_FLAGS ) typedef enum D3D12_META_COMMAND_PARAMETER_STAGE { @@ -13243,7 +13485,7 @@ enum D3D12_GRAPHICS_STATES D3D12_GRAPHICS_STATE_VIEW_INSTANCE_MASK = ( 1 << 16 ) } D3D12_GRAPHICS_STATES; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_GRAPHICS_STATES ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_GRAPHICS_STATES ) typedef struct D3D12_META_COMMAND_DESC { GUID Id; @@ -13495,562 +13737,3929 @@ EXTERN_C const IID IID_ID3D12StateObjectProperties; /* interface __MIDL_itf_d3d12_0000_0034 */ /* [local] */ -typedef -enum D3D12_STATE_SUBOBJECT_TYPE +typedef struct D3D12_PROGRAM_IDENTIFIER { - D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG = 0, - D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE = 1, - D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE = 2, - D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK = 3, - D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY = 5, - D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION = 6, - D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 7, - D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 8, - D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG = 9, - D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG = 10, - D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP = 11, - D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 = 12, - D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 + 1 ) - } D3D12_STATE_SUBOBJECT_TYPE; + UINT64 OpaqueData[ 4 ]; + } D3D12_PROGRAM_IDENTIFIER; -typedef struct D3D12_STATE_SUBOBJECT - { - D3D12_STATE_SUBOBJECT_TYPE Type; - const void *pDesc; - } D3D12_STATE_SUBOBJECT; -typedef -enum D3D12_STATE_OBJECT_FLAGS - { - D3D12_STATE_OBJECT_FLAG_NONE = 0, - D3D12_STATE_OBJECT_FLAG_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITIONS = 0x1, - D3D12_STATE_OBJECT_FLAG_ALLOW_EXTERNAL_DEPENDENCIES_ON_LOCAL_DEFINITIONS = 0x2, - D3D12_STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS = 0x4 - } D3D12_STATE_OBJECT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_STATE_OBJECT_FLAGS ); -typedef struct D3D12_STATE_OBJECT_CONFIG - { - D3D12_STATE_OBJECT_FLAGS Flags; - } D3D12_STATE_OBJECT_CONFIG; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0034_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0034_v0_0_s_ifspec; -typedef struct D3D12_GLOBAL_ROOT_SIGNATURE - { - ID3D12RootSignature *pGlobalRootSignature; - } D3D12_GLOBAL_ROOT_SIGNATURE; +#ifndef __ID3D12StateObjectProperties1_INTERFACE_DEFINED__ +#define __ID3D12StateObjectProperties1_INTERFACE_DEFINED__ -typedef struct D3D12_LOCAL_ROOT_SIGNATURE - { - ID3D12RootSignature *pLocalRootSignature; - } D3D12_LOCAL_ROOT_SIGNATURE; +/* interface ID3D12StateObjectProperties1 */ +/* [unique][local][object][uuid] */ -typedef struct D3D12_NODE_MASK - { - UINT NodeMask; - } D3D12_NODE_MASK; -typedef -enum D3D12_EXPORT_FLAGS - { - D3D12_EXPORT_FLAG_NONE = 0 - } D3D12_EXPORT_FLAGS; +EXTERN_C const IID IID_ID3D12StateObjectProperties1; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_EXPORT_FLAGS ); -typedef struct D3D12_EXPORT_DESC +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("460caac7-1d24-446a-a184-ca67db494138") + ID3D12StateObjectProperties1 : public ID3D12StateObjectProperties { - LPCWSTR Name; - _In_opt_ LPCWSTR ExportToRename; - D3D12_EXPORT_FLAGS Flags; - } D3D12_EXPORT_DESC; + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_PROGRAM_IDENTIFIER STDMETHODCALLTYPE GetProgramIdentifier( + LPCWSTR pProgramName) = 0; +#else + virtual D3D12_PROGRAM_IDENTIFIER *STDMETHODCALLTYPE GetProgramIdentifier( + D3D12_PROGRAM_IDENTIFIER * RetVal, + LPCWSTR pProgramName) = 0; +#endif + + }; + + +#else /* C style interface */ -typedef struct D3D12_DXIL_LIBRARY_DESC + typedef struct ID3D12StateObjectProperties1Vtbl { - D3D12_SHADER_BYTECODE DXILLibrary; - UINT NumExports; - _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports; - } D3D12_DXIL_LIBRARY_DESC; + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12StateObjectProperties1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12StateObjectProperties1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12StateObjectProperties1 * This); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetShaderIdentifier) + void *( STDMETHODCALLTYPE *GetShaderIdentifier )( + ID3D12StateObjectProperties1 * This, + _In_ LPCWSTR pExportName); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetShaderStackSize) + UINT64 ( STDMETHODCALLTYPE *GetShaderStackSize )( + ID3D12StateObjectProperties1 * This, + _In_ LPCWSTR pExportName); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetPipelineStackSize) + UINT64 ( STDMETHODCALLTYPE *GetPipelineStackSize )( + ID3D12StateObjectProperties1 * This); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, SetPipelineStackSize) + void ( STDMETHODCALLTYPE *SetPipelineStackSize )( + ID3D12StateObjectProperties1 * This, + UINT64 PipelineStackSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties1, GetProgramIdentifier) +#if !defined(_WIN32) + D3D12_PROGRAM_IDENTIFIER ( STDMETHODCALLTYPE *GetProgramIdentifier )( + ID3D12StateObjectProperties1 * This, + LPCWSTR pProgramName); + +#else + D3D12_PROGRAM_IDENTIFIER *( STDMETHODCALLTYPE *GetProgramIdentifier )( + ID3D12StateObjectProperties1 * This, + D3D12_PROGRAM_IDENTIFIER * RetVal, + LPCWSTR pProgramName); + +#endif + + END_INTERFACE + } ID3D12StateObjectProperties1Vtbl; -typedef struct D3D12_EXISTING_COLLECTION_DESC + interface ID3D12StateObjectProperties1 { - ID3D12StateObject *pExistingCollection; - UINT NumExports; - _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports; - } D3D12_EXISTING_COLLECTION_DESC; + CONST_VTBL struct ID3D12StateObjectProperties1Vtbl *lpVtbl; + }; -typedef struct D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION - { - const D3D12_STATE_SUBOBJECT *pSubobjectToAssociate; - UINT NumExports; - _In_reads_(NumExports) LPCWSTR *pExports; - } D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + -typedef struct D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION - { - LPCWSTR SubobjectToAssociate; - UINT NumExports; - _In_reads_(NumExports) LPCWSTR *pExports; - } D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; +#ifdef COBJMACROS -typedef -enum D3D12_HIT_GROUP_TYPE - { - D3D12_HIT_GROUP_TYPE_TRIANGLES = 0, - D3D12_HIT_GROUP_TYPE_PROCEDURAL_PRIMITIVE = 0x1 - } D3D12_HIT_GROUP_TYPE; -typedef struct D3D12_HIT_GROUP_DESC - { - LPCWSTR HitGroupExport; - D3D12_HIT_GROUP_TYPE Type; - _In_opt_ LPCWSTR AnyHitShaderImport; - _In_opt_ LPCWSTR ClosestHitShaderImport; - _In_opt_ LPCWSTR IntersectionShaderImport; - } D3D12_HIT_GROUP_DESC; +#define ID3D12StateObjectProperties1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -typedef struct D3D12_RAYTRACING_SHADER_CONFIG - { - UINT MaxPayloadSizeInBytes; - UINT MaxAttributeSizeInBytes; - } D3D12_RAYTRACING_SHADER_CONFIG; +#define ID3D12StateObjectProperties1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) -typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG - { - UINT MaxTraceRecursionDepth; - } D3D12_RAYTRACING_PIPELINE_CONFIG; +#define ID3D12StateObjectProperties1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) -typedef -enum D3D12_RAYTRACING_PIPELINE_FLAGS - { - D3D12_RAYTRACING_PIPELINE_FLAG_NONE = 0, - D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES = 0x100, - D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200 - } D3D12_RAYTRACING_PIPELINE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_PIPELINE_FLAGS ); -typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG1 - { - UINT MaxTraceRecursionDepth; - D3D12_RAYTRACING_PIPELINE_FLAGS Flags; - } D3D12_RAYTRACING_PIPELINE_CONFIG1; +#define ID3D12StateObjectProperties1_GetShaderIdentifier(This,pExportName) \ + ( (This)->lpVtbl -> GetShaderIdentifier(This,pExportName) ) -typedef -enum D3D12_STATE_OBJECT_TYPE - { - D3D12_STATE_OBJECT_TYPE_COLLECTION = 0, - D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE = 3 - } D3D12_STATE_OBJECT_TYPE; +#define ID3D12StateObjectProperties1_GetShaderStackSize(This,pExportName) \ + ( (This)->lpVtbl -> GetShaderStackSize(This,pExportName) ) -typedef struct D3D12_STATE_OBJECT_DESC - { - D3D12_STATE_OBJECT_TYPE Type; - UINT NumSubobjects; - _In_reads_(NumSubobjects) const D3D12_STATE_SUBOBJECT *pSubobjects; - } D3D12_STATE_OBJECT_DESC; +#define ID3D12StateObjectProperties1_GetPipelineStackSize(This) \ + ( (This)->lpVtbl -> GetPipelineStackSize(This) ) -typedef -enum D3D12_RAYTRACING_GEOMETRY_FLAGS - { - D3D12_RAYTRACING_GEOMETRY_FLAG_NONE = 0, - D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE = 0x1, - D3D12_RAYTRACING_GEOMETRY_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = 0x2 - } D3D12_RAYTRACING_GEOMETRY_FLAGS; +#define ID3D12StateObjectProperties1_SetPipelineStackSize(This,PipelineStackSizeInBytes) \ + ( (This)->lpVtbl -> SetPipelineStackSize(This,PipelineStackSizeInBytes) ) -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_GEOMETRY_FLAGS ); -typedef -enum D3D12_RAYTRACING_GEOMETRY_TYPE - { - D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES = 0, - D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS = ( D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES + 1 ) - } D3D12_RAYTRACING_GEOMETRY_TYPE; +#if !defined(_WIN32) -typedef -enum D3D12_RAYTRACING_INSTANCE_FLAGS - { - D3D12_RAYTRACING_INSTANCE_FLAG_NONE = 0, - D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_CULL_DISABLE = 0x1, - D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = 0x2, - D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE = 0x4, - D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_NON_OPAQUE = 0x8 - } D3D12_RAYTRACING_INSTANCE_FLAGS; +#define ID3D12StateObjectProperties1_GetProgramIdentifier(This,pProgramName) \ + ( (This)->lpVtbl -> GetProgramIdentifier(This,pProgramName) ) +#else +#define ID3D12StateObjectProperties1_GetProgramIdentifier(This,RetVal,pProgramName) \ + ( (This)->lpVtbl -> GetProgramIdentifier(This,RetVal,pProgramName) ) +#endif -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_INSTANCE_FLAGS ); -typedef struct D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE - { - D3D12_GPU_VIRTUAL_ADDRESS StartAddress; - UINT64 StrideInBytes; - } D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE; +#endif /* COBJMACROS */ -typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE - { - D3D12_GPU_VIRTUAL_ADDRESS StartAddress; - UINT64 SizeInBytes; - } D3D12_GPU_VIRTUAL_ADDRESS_RANGE; -typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE - { - D3D12_GPU_VIRTUAL_ADDRESS StartAddress; - UINT64 SizeInBytes; - UINT64 StrideInBytes; - } D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE; +#endif /* C style interface */ -typedef struct D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC - { - D3D12_GPU_VIRTUAL_ADDRESS Transform3x4; - DXGI_FORMAT IndexFormat; - DXGI_FORMAT VertexFormat; - UINT IndexCount; - UINT VertexCount; - D3D12_GPU_VIRTUAL_ADDRESS IndexBuffer; - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE VertexBuffer; - } D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC; -typedef struct D3D12_RAYTRACING_AABB - { - FLOAT MinX; - FLOAT MinY; - FLOAT MinZ; - FLOAT MaxX; - FLOAT MaxY; - FLOAT MaxZ; - } D3D12_RAYTRACING_AABB; -typedef struct D3D12_RAYTRACING_GEOMETRY_AABBS_DESC - { - UINT64 AABBCount; - D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE AABBs; - } D3D12_RAYTRACING_GEOMETRY_AABBS_DESC; -typedef -enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS - { - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_NONE = 0, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_UPDATE = 0x1, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_COMPACTION = 0x2, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE = 0x4, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_BUILD = 0x8, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY = 0x10, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE = 0x20 - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS; +#endif /* __ID3D12StateObjectProperties1_INTERFACE_DEFINED__ */ -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS ); -typedef -enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE - { - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_CLONE = 0, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_COMPACT = 0x1, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_VISUALIZATION_DECODE_FOR_TOOLS = 0x2, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_SERIALIZE = 0x3, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_DESERIALIZE = 0x4 - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE; -typedef -enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE - { - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL = 0, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL = 0x1 - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE; +/* interface __MIDL_itf_d3d12_0000_0035 */ +/* [local] */ -typedef -enum D3D12_ELEMENTS_LAYOUT +typedef struct D3D12_NODE_ID { - D3D12_ELEMENTS_LAYOUT_ARRAY = 0, - D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS = 0x1 - } D3D12_ELEMENTS_LAYOUT; + LPCWSTR Name; + UINT ArrayIndex; + } D3D12_NODE_ID; -typedef -enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE +typedef struct D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS { - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE = 0, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION = 0x1, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION = 0x2, - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE = 0x3 - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE; + UINT64 MinSizeInBytes; + UINT64 MaxSizeInBytes; + UINT SizeGranularityInBytes; + } D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS; -typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC - { - D3D12_GPU_VIRTUAL_ADDRESS DestBuffer; - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE InfoType; - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC; -typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC - { - UINT64 CompactedSizeInBytes; - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC; -typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC - { - UINT64 DecodedSizeInBytes; - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0035_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0035_v0_0_s_ifspec; -typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER - { - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; - UINT NumDescs; - } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER; +#ifndef __ID3D12WorkGraphProperties_INTERFACE_DEFINED__ +#define __ID3D12WorkGraphProperties_INTERFACE_DEFINED__ -// Regarding D3D12_BUILD_RAY_TRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER above, -// depending on Type field, NumDescs above is followed by either: -// D3D12_RAY_TRACING_INSTANCE_DESC InstanceDescs[NumDescs] -// or D3D12_RAY_TRACING_GEOMETRY_DESC GeometryDescs[NumDescs]. -// There is 4 bytes of padding between GeometryDesc structs in the array so alignment is natural when viewed by CPU. +/* interface ID3D12WorkGraphProperties */ +/* [unique][local][object][uuid] */ -typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC - { - UINT64 SerializedSizeInBytes; - UINT64 NumBottomLevelAccelerationStructurePointers; - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC; -typedef struct D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER - { - GUID DriverOpaqueGUID; - BYTE DriverOpaqueVersioningData[ 16 ]; - } D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER; +EXTERN_C const IID IID_ID3D12WorkGraphProperties; -typedef -enum D3D12_SERIALIZED_DATA_TYPE +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("065acf71-f863-4b89-82f4-02e4d5886757") + ID3D12WorkGraphProperties : public IUnknown { - D3D12_SERIALIZED_DATA_RAYTRACING_ACCELERATION_STRUCTURE = 0 - } D3D12_SERIALIZED_DATA_TYPE; + public: + virtual UINT STDMETHODCALLTYPE GetNumWorkGraphs( void) = 0; + + virtual LPCWSTR STDMETHODCALLTYPE GetProgramName( + UINT WorkGraphIndex) = 0; + + virtual UINT STDMETHODCALLTYPE GetWorkGraphIndex( + LPCWSTR pProgramName) = 0; + + virtual UINT STDMETHODCALLTYPE GetNumNodes( + UINT WorkGraphIndex) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_NODE_ID STDMETHODCALLTYPE GetNodeID( + UINT WorkGraphIndex, + UINT NodeIndex) = 0; +#else + virtual D3D12_NODE_ID *STDMETHODCALLTYPE GetNodeID( + D3D12_NODE_ID * RetVal, + UINT WorkGraphIndex, + UINT NodeIndex) = 0; +#endif + + virtual UINT STDMETHODCALLTYPE GetNodeIndex( + UINT WorkGraphIndex, + D3D12_NODE_ID NodeID) = 0; + + virtual UINT STDMETHODCALLTYPE GetNodeLocalRootArgumentsTableIndex( + UINT WorkGraphIndex, + UINT NodeIndex) = 0; + + virtual UINT STDMETHODCALLTYPE GetNumEntrypoints( + UINT WorkGraphIndex) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_NODE_ID STDMETHODCALLTYPE GetEntrypointID( + UINT WorkGraphIndex, + UINT EntrypointIndex) = 0; +#else + virtual D3D12_NODE_ID *STDMETHODCALLTYPE GetEntrypointID( + D3D12_NODE_ID * RetVal, + UINT WorkGraphIndex, + UINT EntrypointIndex) = 0; +#endif + + virtual UINT STDMETHODCALLTYPE GetEntrypointIndex( + UINT WorkGraphIndex, + D3D12_NODE_ID NodeID) = 0; + + virtual UINT STDMETHODCALLTYPE GetEntrypointRecordSizeInBytes( + UINT WorkGraphIndex, + UINT EntrypointIndex) = 0; + + virtual void STDMETHODCALLTYPE GetWorkGraphMemoryRequirements( + UINT WorkGraphIndex, + _Out_ D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS *pWorkGraphMemoryRequirements) = 0; + + virtual UINT STDMETHODCALLTYPE GetEntrypointRecordAlignmentInBytes( + UINT WorkGraphIndex, + UINT EntrypointIndex) = 0; + + }; + + +#else /* C style interface */ -typedef -enum D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS + typedef struct ID3D12WorkGraphPropertiesVtbl { - D3D12_DRIVER_MATCHING_IDENTIFIER_COMPATIBLE_WITH_DEVICE = 0, - D3D12_DRIVER_MATCHING_IDENTIFIER_UNSUPPORTED_TYPE = 0x1, - D3D12_DRIVER_MATCHING_IDENTIFIER_UNRECOGNIZED = 0x2, - D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_VERSION = 0x3, - D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_TYPE = 0x4 - } D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS; + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12WorkGraphProperties * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12WorkGraphProperties * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12WorkGraphProperties * This); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetNumWorkGraphs) + UINT ( STDMETHODCALLTYPE *GetNumWorkGraphs )( + ID3D12WorkGraphProperties * This); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetProgramName) + LPCWSTR ( STDMETHODCALLTYPE *GetProgramName )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetWorkGraphIndex) + UINT ( STDMETHODCALLTYPE *GetWorkGraphIndex )( + ID3D12WorkGraphProperties * This, + LPCWSTR pProgramName); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetNumNodes) + UINT ( STDMETHODCALLTYPE *GetNumNodes )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetNodeID) +#if !defined(_WIN32) + D3D12_NODE_ID ( STDMETHODCALLTYPE *GetNodeID )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex, + UINT NodeIndex); + +#else + D3D12_NODE_ID *( STDMETHODCALLTYPE *GetNodeID )( + ID3D12WorkGraphProperties * This, + D3D12_NODE_ID * RetVal, + UINT WorkGraphIndex, + UINT NodeIndex); + +#endif + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetNodeIndex) + UINT ( STDMETHODCALLTYPE *GetNodeIndex )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex, + D3D12_NODE_ID NodeID); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetNodeLocalRootArgumentsTableIndex) + UINT ( STDMETHODCALLTYPE *GetNodeLocalRootArgumentsTableIndex )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex, + UINT NodeIndex); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetNumEntrypoints) + UINT ( STDMETHODCALLTYPE *GetNumEntrypoints )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetEntrypointID) +#if !defined(_WIN32) + D3D12_NODE_ID ( STDMETHODCALLTYPE *GetEntrypointID )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex, + UINT EntrypointIndex); + +#else + D3D12_NODE_ID *( STDMETHODCALLTYPE *GetEntrypointID )( + ID3D12WorkGraphProperties * This, + D3D12_NODE_ID * RetVal, + UINT WorkGraphIndex, + UINT EntrypointIndex); + +#endif + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetEntrypointIndex) + UINT ( STDMETHODCALLTYPE *GetEntrypointIndex )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex, + D3D12_NODE_ID NodeID); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetEntrypointRecordSizeInBytes) + UINT ( STDMETHODCALLTYPE *GetEntrypointRecordSizeInBytes )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex, + UINT EntrypointIndex); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetWorkGraphMemoryRequirements) + void ( STDMETHODCALLTYPE *GetWorkGraphMemoryRequirements )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex, + _Out_ D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS *pWorkGraphMemoryRequirements); + + DECLSPEC_XFGVIRT(ID3D12WorkGraphProperties, GetEntrypointRecordAlignmentInBytes) + UINT ( STDMETHODCALLTYPE *GetEntrypointRecordAlignmentInBytes )( + ID3D12WorkGraphProperties * This, + UINT WorkGraphIndex, + UINT EntrypointIndex); + + END_INTERFACE + } ID3D12WorkGraphPropertiesVtbl; -typedef struct D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER + interface ID3D12WorkGraphProperties { - D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER DriverMatchingIdentifier; - UINT64 SerializedSizeInBytesIncludingHeader; - UINT64 DeserializedSizeInBytes; - UINT64 NumBottomLevelAccelerationStructurePointersAfterHeader; - } D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER; + CONST_VTBL struct ID3D12WorkGraphPropertiesVtbl *lpVtbl; + }; -typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC - { - UINT64 CurrentSizeInBytes; - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC; + -typedef struct D3D12_RAYTRACING_INSTANCE_DESC +#ifdef COBJMACROS + + +#define ID3D12WorkGraphProperties_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12WorkGraphProperties_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12WorkGraphProperties_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12WorkGraphProperties_GetNumWorkGraphs(This) \ + ( (This)->lpVtbl -> GetNumWorkGraphs(This) ) + +#define ID3D12WorkGraphProperties_GetProgramName(This,WorkGraphIndex) \ + ( (This)->lpVtbl -> GetProgramName(This,WorkGraphIndex) ) + +#define ID3D12WorkGraphProperties_GetWorkGraphIndex(This,pProgramName) \ + ( (This)->lpVtbl -> GetWorkGraphIndex(This,pProgramName) ) + +#define ID3D12WorkGraphProperties_GetNumNodes(This,WorkGraphIndex) \ + ( (This)->lpVtbl -> GetNumNodes(This,WorkGraphIndex) ) +#if !defined(_WIN32) + +#define ID3D12WorkGraphProperties_GetNodeID(This,WorkGraphIndex,NodeIndex) \ + ( (This)->lpVtbl -> GetNodeID(This,WorkGraphIndex,NodeIndex) ) +#else +#define ID3D12WorkGraphProperties_GetNodeID(This,RetVal,WorkGraphIndex,NodeIndex) \ + ( (This)->lpVtbl -> GetNodeID(This,RetVal,WorkGraphIndex,NodeIndex) ) +#endif + +#define ID3D12WorkGraphProperties_GetNodeIndex(This,WorkGraphIndex,NodeID) \ + ( (This)->lpVtbl -> GetNodeIndex(This,WorkGraphIndex,NodeID) ) + +#define ID3D12WorkGraphProperties_GetNodeLocalRootArgumentsTableIndex(This,WorkGraphIndex,NodeIndex) \ + ( (This)->lpVtbl -> GetNodeLocalRootArgumentsTableIndex(This,WorkGraphIndex,NodeIndex) ) + +#define ID3D12WorkGraphProperties_GetNumEntrypoints(This,WorkGraphIndex) \ + ( (This)->lpVtbl -> GetNumEntrypoints(This,WorkGraphIndex) ) +#if !defined(_WIN32) + +#define ID3D12WorkGraphProperties_GetEntrypointID(This,WorkGraphIndex,EntrypointIndex) \ + ( (This)->lpVtbl -> GetEntrypointID(This,WorkGraphIndex,EntrypointIndex) ) +#else +#define ID3D12WorkGraphProperties_GetEntrypointID(This,RetVal,WorkGraphIndex,EntrypointIndex) \ + ( (This)->lpVtbl -> GetEntrypointID(This,RetVal,WorkGraphIndex,EntrypointIndex) ) +#endif + +#define ID3D12WorkGraphProperties_GetEntrypointIndex(This,WorkGraphIndex,NodeID) \ + ( (This)->lpVtbl -> GetEntrypointIndex(This,WorkGraphIndex,NodeID) ) + +#define ID3D12WorkGraphProperties_GetEntrypointRecordSizeInBytes(This,WorkGraphIndex,EntrypointIndex) \ + ( (This)->lpVtbl -> GetEntrypointRecordSizeInBytes(This,WorkGraphIndex,EntrypointIndex) ) + +#define ID3D12WorkGraphProperties_GetWorkGraphMemoryRequirements(This,WorkGraphIndex,pWorkGraphMemoryRequirements) \ + ( (This)->lpVtbl -> GetWorkGraphMemoryRequirements(This,WorkGraphIndex,pWorkGraphMemoryRequirements) ) + +#define ID3D12WorkGraphProperties_GetEntrypointRecordAlignmentInBytes(This,WorkGraphIndex,EntrypointIndex) \ + ( (This)->lpVtbl -> GetEntrypointRecordAlignmentInBytes(This,WorkGraphIndex,EntrypointIndex) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12WorkGraphProperties_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0036 */ +/* [local] */ + +typedef +enum D3D12_STATE_SUBOBJECT_TYPE { - FLOAT Transform[ 3 ][ 4 ]; - UINT InstanceID : 24; - UINT InstanceMask : 8; - UINT InstanceContributionToHitGroupIndex : 24; - UINT Flags : 8; - D3D12_GPU_VIRTUAL_ADDRESS AccelerationStructure; - } D3D12_RAYTRACING_INSTANCE_DESC; + D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG = 0, + D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE = 1, + D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE = 2, + D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK = 3, + D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY = 5, + D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION = 6, + D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 7, + D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 8, + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG = 9, + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG = 10, + D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP = 11, + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 = 12, + D3D12_STATE_SUBOBJECT_TYPE_WORK_GRAPH = 13, + D3D12_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT = 14, + D3D12_STATE_SUBOBJECT_TYPE_BLEND = 15, + D3D12_STATE_SUBOBJECT_TYPE_SAMPLE_MASK = 16, + D3D12_STATE_SUBOBJECT_TYPE_RASTERIZER = 17, + D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL = 18, + D3D12_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT = 19, + D3D12_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE = 20, + D3D12_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY = 21, + D3D12_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS = 22, + D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT = 23, + D3D12_STATE_SUBOBJECT_TYPE_SAMPLE_DESC = 24, + D3D12_STATE_SUBOBJECT_TYPE_FLAGS = 26, + D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1 = 27, + D3D12_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING = 28, + D3D12_STATE_SUBOBJECT_TYPE_GENERIC_PROGRAM = 29, + D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 = 30, + D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 + 1 ) + } D3D12_STATE_SUBOBJECT_TYPE; -typedef struct D3D12_RAYTRACING_GEOMETRY_DESC +typedef struct D3D12_STATE_SUBOBJECT { - D3D12_RAYTRACING_GEOMETRY_TYPE Type; - D3D12_RAYTRACING_GEOMETRY_FLAGS Flags; - union - { - D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC Triangles; - D3D12_RAYTRACING_GEOMETRY_AABBS_DESC AABBs; - } ; - } D3D12_RAYTRACING_GEOMETRY_DESC; + D3D12_STATE_SUBOBJECT_TYPE Type; + const void *pDesc; + } D3D12_STATE_SUBOBJECT; -typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS +typedef +enum D3D12_STATE_OBJECT_FLAGS { - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; - D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS Flags; - UINT NumDescs; - D3D12_ELEMENTS_LAYOUT DescsLayout; - union - { - D3D12_GPU_VIRTUAL_ADDRESS InstanceDescs; - const D3D12_RAYTRACING_GEOMETRY_DESC *pGeometryDescs; - const D3D12_RAYTRACING_GEOMETRY_DESC *const *ppGeometryDescs; - } ; - } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS; + D3D12_STATE_OBJECT_FLAG_NONE = 0, + D3D12_STATE_OBJECT_FLAG_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITIONS = 0x1, + D3D12_STATE_OBJECT_FLAG_ALLOW_EXTERNAL_DEPENDENCIES_ON_LOCAL_DEFINITIONS = 0x2, + D3D12_STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS = 0x4 + } D3D12_STATE_OBJECT_FLAGS; -typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC +DEFINE_ENUM_FLAG_OPERATORS( D3D12_STATE_OBJECT_FLAGS ) +typedef struct D3D12_STATE_OBJECT_CONFIG { - D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData; - D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS Inputs; - _In_opt_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData; - D3D12_GPU_VIRTUAL_ADDRESS ScratchAccelerationStructureData; - } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC; + D3D12_STATE_OBJECT_FLAGS Flags; + } D3D12_STATE_OBJECT_CONFIG; -typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO +typedef struct D3D12_GLOBAL_ROOT_SIGNATURE { - UINT64 ResultDataMaxSizeInBytes; - UINT64 ScratchDataSizeInBytes; - UINT64 UpdateScratchDataSizeInBytes; - } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO; + ID3D12RootSignature *pGlobalRootSignature; + } D3D12_GLOBAL_ROOT_SIGNATURE; -typedef -enum D3D12_RAY_FLAGS +typedef struct D3D12_LOCAL_ROOT_SIGNATURE { - D3D12_RAY_FLAG_NONE = 0, - D3D12_RAY_FLAG_FORCE_OPAQUE = 0x1, - D3D12_RAY_FLAG_FORCE_NON_OPAQUE = 0x2, - D3D12_RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH = 0x4, - D3D12_RAY_FLAG_SKIP_CLOSEST_HIT_SHADER = 0x8, - D3D12_RAY_FLAG_CULL_BACK_FACING_TRIANGLES = 0x10, - D3D12_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES = 0x20, - D3D12_RAY_FLAG_CULL_OPAQUE = 0x40, - D3D12_RAY_FLAG_CULL_NON_OPAQUE = 0x80, - D3D12_RAY_FLAG_SKIP_TRIANGLES = 0x100, - D3D12_RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200 - } D3D12_RAY_FLAGS; + ID3D12RootSignature *pLocalRootSignature; + } D3D12_LOCAL_ROOT_SIGNATURE; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAY_FLAGS ); -typedef -enum D3D12_HIT_KIND +typedef struct D3D12_NODE_MASK { - D3D12_HIT_KIND_TRIANGLE_FRONT_FACE = 0xfe, - D3D12_HIT_KIND_TRIANGLE_BACK_FACE = 0xff - } D3D12_HIT_KIND; + UINT NodeMask; + } D3D12_NODE_MASK; +typedef struct D3D12_SAMPLE_MASK + { + UINT SampleMask; + } D3D12_SAMPLE_MASK; +typedef struct D3D12_IB_STRIP_CUT_VALUE + { + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IndexBufferStripCutValue; + } D3D12_IB_STRIP_CUT_VALUE; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0034_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0034_v0_0_s_ifspec; +typedef struct D3D12_PRIMITIVE_TOPOLOGY_DESC + { + D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopology; + } D3D12_PRIMITIVE_TOPOLOGY_DESC; -#ifndef __ID3D12Device5_INTERFACE_DEFINED__ -#define __ID3D12Device5_INTERFACE_DEFINED__ +typedef struct D3D12_DEPTH_STENCIL_FORMAT + { + DXGI_FORMAT DepthStencilFormat; + } D3D12_DEPTH_STENCIL_FORMAT; -/* interface ID3D12Device5 */ -/* [unique][local][object][uuid] */ +typedef +enum D3D12_EXPORT_FLAGS + { + D3D12_EXPORT_FLAG_NONE = 0 + } D3D12_EXPORT_FLAGS; +DEFINE_ENUM_FLAG_OPERATORS( D3D12_EXPORT_FLAGS ) +typedef struct D3D12_EXPORT_DESC + { + LPCWSTR Name; + _In_opt_ LPCWSTR ExportToRename; + D3D12_EXPORT_FLAGS Flags; + } D3D12_EXPORT_DESC; -EXTERN_C const IID IID_ID3D12Device5; +typedef struct D3D12_DXIL_LIBRARY_DESC + { + D3D12_SHADER_BYTECODE DXILLibrary; + UINT NumExports; + _In_reads_(NumExports) const D3D12_EXPORT_DESC *pExports; + } D3D12_DXIL_LIBRARY_DESC; -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8b4f173b-2fea-4b80-8f58-4307191ab95d") - ID3D12Device5 : public ID3D12Device4 +typedef struct D3D12_EXISTING_COLLECTION_DESC { - public: - virtual HRESULT STDMETHODCALLTYPE CreateLifetimeTracker( - _In_ ID3D12LifetimeOwner *pOwner, - REFIID riid, - _COM_Outptr_ void **ppvTracker) = 0; - - virtual void STDMETHODCALLTYPE RemoveDevice( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommands( - _Inout_ UINT *pNumMetaCommands, - _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommandParameters( - _In_ REFGUID CommandId, - _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, - _Out_opt_ UINT *pTotalStructureSizeInBytes, - _Inout_ UINT *pParameterCount, - _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateMetaCommand( - _In_ REFGUID CommandId, - _In_ UINT NodeMask, - _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, - _In_ SIZE_T CreationParametersDataSizeInBytes, - REFIID riid, - _COM_Outptr_ void **ppMetaCommand) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateStateObject( - const D3D12_STATE_OBJECT_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppStateObject) = 0; - - virtual void STDMETHODCALLTYPE GetRaytracingAccelerationStructurePrebuildInfo( - _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, - _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo) = 0; - - virtual D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE CheckDriverMatchingIdentifier( - _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, - _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck) = 0; - - }; - - -#else /* C style interface */ + ID3D12StateObject *pExistingCollection; + UINT NumExports; + _In_reads_(NumExports) const D3D12_EXPORT_DESC *pExports; + } D3D12_EXISTING_COLLECTION_DESC; - typedef struct ID3D12Device5Vtbl +typedef struct D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION { - BEGIN_INTERFACE - - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Device5 * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Device5 * This); - - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Device5 * This); - - DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Device5 * This, - _In_ REFGUID guid, - _Inout_ UINT *pDataSize, - _Out_writes_bytes_opt_( *pDataSize ) void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Device5 * This, - _In_ REFGUID guid, - _In_ UINT DataSize, - _In_reads_bytes_opt_( DataSize ) const void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Device5 * This, + const D3D12_STATE_SUBOBJECT *pSubobjectToAssociate; + UINT NumExports; + _In_reads_(NumExports) LPCWSTR *pExports; + } D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + +typedef struct D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION + { + LPCWSTR SubobjectToAssociate; + UINT NumExports; + _In_reads_(NumExports) LPCWSTR *pExports; + } D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + +typedef +enum D3D12_HIT_GROUP_TYPE + { + D3D12_HIT_GROUP_TYPE_TRIANGLES = 0, + D3D12_HIT_GROUP_TYPE_PROCEDURAL_PRIMITIVE = 0x1 + } D3D12_HIT_GROUP_TYPE; + +typedef struct D3D12_HIT_GROUP_DESC + { + LPCWSTR HitGroupExport; + D3D12_HIT_GROUP_TYPE Type; + _In_opt_ LPCWSTR AnyHitShaderImport; + _In_opt_ LPCWSTR ClosestHitShaderImport; + _In_opt_ LPCWSTR IntersectionShaderImport; + } D3D12_HIT_GROUP_DESC; + +typedef struct D3D12_RAYTRACING_SHADER_CONFIG + { + UINT MaxPayloadSizeInBytes; + UINT MaxAttributeSizeInBytes; + } D3D12_RAYTRACING_SHADER_CONFIG; + +typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG + { + UINT MaxTraceRecursionDepth; + } D3D12_RAYTRACING_PIPELINE_CONFIG; + +typedef +enum D3D12_RAYTRACING_PIPELINE_FLAGS + { + D3D12_RAYTRACING_PIPELINE_FLAG_NONE = 0, + D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES = 0x100, + D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200 + } D3D12_RAYTRACING_PIPELINE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_PIPELINE_FLAGS ) +typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG1 + { + UINT MaxTraceRecursionDepth; + D3D12_RAYTRACING_PIPELINE_FLAGS Flags; + } D3D12_RAYTRACING_PIPELINE_CONFIG1; + +typedef struct D3D12_NODE_OUTPUT_OVERRIDES + { + UINT OutputIndex; + _In_opt_ const D3D12_NODE_ID *pNewName; + _In_opt_ const BOOL *pAllowSparseNodes; + _In_opt_ const UINT *pMaxRecords; + _In_opt_ const UINT *pMaxRecordsSharedWithOutputIndex; + } D3D12_NODE_OUTPUT_OVERRIDES; + +typedef struct D3D12_BROADCASTING_LAUNCH_OVERRIDES + { + _In_opt_ const UINT *pLocalRootArgumentsTableIndex; + _In_opt_ const BOOL *pProgramEntry; + _In_opt_ const D3D12_NODE_ID *pNewName; + _In_opt_ const D3D12_NODE_ID *pShareInputOf; + _In_reads_opt_(3) const UINT *pDispatchGrid; + _In_reads_opt_(3) const UINT *pMaxDispatchGrid; + UINT NumOutputOverrides; + _In_reads_opt_(NumOutputOverrides) const D3D12_NODE_OUTPUT_OVERRIDES *pOutputOverrides; + } D3D12_BROADCASTING_LAUNCH_OVERRIDES; + +typedef struct D3D12_COALESCING_LAUNCH_OVERRIDES + { + _In_opt_ const UINT *pLocalRootArgumentsTableIndex; + _In_opt_ const BOOL *pProgramEntry; + _In_opt_ const D3D12_NODE_ID *pNewName; + _In_opt_ const D3D12_NODE_ID *pShareInputOf; + UINT NumOutputOverrides; + _In_reads_opt_(NumOutputOverrides) const D3D12_NODE_OUTPUT_OVERRIDES *pOutputOverrides; + } D3D12_COALESCING_LAUNCH_OVERRIDES; + +typedef struct D3D12_THREAD_LAUNCH_OVERRIDES + { + _In_opt_ const UINT *pLocalRootArgumentsTableIndex; + _In_opt_ const BOOL *pProgramEntry; + _In_opt_ const D3D12_NODE_ID *pNewName; + _In_opt_ const D3D12_NODE_ID *pShareInputOf; + UINT NumOutputOverrides; + _In_reads_opt_(NumOutputOverrides) const D3D12_NODE_OUTPUT_OVERRIDES *pOutputOverrides; + } D3D12_THREAD_LAUNCH_OVERRIDES; + +typedef struct D3D12_COMMON_COMPUTE_NODE_OVERRIDES + { + _In_opt_ const UINT *pLocalRootArgumentsTableIndex; + _In_opt_ const BOOL *pProgramEntry; + _In_opt_ const D3D12_NODE_ID *pNewName; + _In_opt_ const D3D12_NODE_ID *pShareInputOf; + UINT NumOutputOverrides; + _In_reads_opt_(NumOutputOverrides) const D3D12_NODE_OUTPUT_OVERRIDES *pOutputOverrides; + } D3D12_COMMON_COMPUTE_NODE_OVERRIDES; + +typedef +enum D3D12_NODE_OVERRIDES_TYPE + { + D3D12_NODE_OVERRIDES_TYPE_NONE = 0, + D3D12_NODE_OVERRIDES_TYPE_BROADCASTING_LAUNCH = 1, + D3D12_NODE_OVERRIDES_TYPE_COALESCING_LAUNCH = 2, + D3D12_NODE_OVERRIDES_TYPE_THREAD_LAUNCH = 3, + D3D12_NODE_OVERRIDES_TYPE_COMMON_COMPUTE = 4 + } D3D12_NODE_OVERRIDES_TYPE; + +typedef struct D3D12_SHADER_NODE + { + LPCWSTR Shader; + D3D12_NODE_OVERRIDES_TYPE OverridesType; + union + { + const D3D12_BROADCASTING_LAUNCH_OVERRIDES *pBroadcastingLaunchOverrides; + const D3D12_COALESCING_LAUNCH_OVERRIDES *pCoalescingLaunchOverrides; + const D3D12_THREAD_LAUNCH_OVERRIDES *pThreadLaunchOverrides; + const D3D12_COMMON_COMPUTE_NODE_OVERRIDES *pCommonComputeNodeOverrides; + } ; + } D3D12_SHADER_NODE; + +typedef +enum D3D12_NODE_TYPE + { + D3D12_NODE_TYPE_SHADER = 0 + } D3D12_NODE_TYPE; + +typedef struct D3D12_NODE + { + D3D12_NODE_TYPE NodeType; + union + { + D3D12_SHADER_NODE Shader; + } ; + } D3D12_NODE; + +typedef +enum D3D12_WORK_GRAPH_FLAGS + { + D3D12_WORK_GRAPH_FLAG_NONE = 0, + D3D12_WORK_GRAPH_FLAG_INCLUDE_ALL_AVAILABLE_NODES = 0x1 + } D3D12_WORK_GRAPH_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_WORK_GRAPH_FLAGS ) +typedef struct D3D12_WORK_GRAPH_DESC + { + LPCWSTR ProgramName; + D3D12_WORK_GRAPH_FLAGS Flags; + UINT NumEntrypoints; + _In_reads_opt_(NumEntrypoints) const D3D12_NODE_ID *pEntrypoints; + UINT NumExplicitlyDefinedNodes; + _In_reads_opt_(NumExplicitlyDefinedNodes) const D3D12_NODE *pExplicitlyDefinedNodes; + } D3D12_WORK_GRAPH_DESC; + +typedef struct D3D12_GENERIC_PROGRAM_DESC + { + LPCWSTR ProgramName; + UINT NumExports; + _In_reads_(NumExports) LPCWSTR *pExports; + UINT NumSubobjects; + _In_reads_opt_(NumSubobjects) const D3D12_STATE_SUBOBJECT *const *ppSubobjects; + } D3D12_GENERIC_PROGRAM_DESC; + +typedef +enum D3D12_STATE_OBJECT_TYPE + { + D3D12_STATE_OBJECT_TYPE_COLLECTION = 0, + D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE = 3, + D3D12_STATE_OBJECT_TYPE_EXECUTABLE = 4 + } D3D12_STATE_OBJECT_TYPE; + +typedef struct D3D12_STATE_OBJECT_DESC + { + D3D12_STATE_OBJECT_TYPE Type; + UINT NumSubobjects; + _In_reads_(NumSubobjects) const D3D12_STATE_SUBOBJECT *pSubobjects; + } D3D12_STATE_OBJECT_DESC; + +typedef +enum D3D12_RAYTRACING_GEOMETRY_FLAGS + { + D3D12_RAYTRACING_GEOMETRY_FLAG_NONE = 0, + D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE = 0x1, + D3D12_RAYTRACING_GEOMETRY_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = 0x2 + } D3D12_RAYTRACING_GEOMETRY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_GEOMETRY_FLAGS ) +typedef +enum D3D12_RAYTRACING_GEOMETRY_TYPE + { + D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES = 0, + D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS = ( D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES + 1 ) + } D3D12_RAYTRACING_GEOMETRY_TYPE; + +typedef +enum D3D12_RAYTRACING_INSTANCE_FLAGS + { + D3D12_RAYTRACING_INSTANCE_FLAG_NONE = 0, + D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_CULL_DISABLE = 0x1, + D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = 0x2, + D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE = 0x4, + D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_NON_OPAQUE = 0x8 + } D3D12_RAYTRACING_INSTANCE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_INSTANCE_FLAGS ) +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE + { + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 StrideInBytes; + } D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE; + +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE + { + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 SizeInBytes; + } D3D12_GPU_VIRTUAL_ADDRESS_RANGE; + +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE + { + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 SizeInBytes; + UINT64 StrideInBytes; + } D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE; + +typedef struct D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS Transform3x4; + DXGI_FORMAT IndexFormat; + DXGI_FORMAT VertexFormat; + UINT IndexCount; + UINT VertexCount; + D3D12_GPU_VIRTUAL_ADDRESS IndexBuffer; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE VertexBuffer; + } D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC; + +typedef struct D3D12_RAYTRACING_AABB + { + FLOAT MinX; + FLOAT MinY; + FLOAT MinZ; + FLOAT MaxX; + FLOAT MaxY; + FLOAT MaxZ; + } D3D12_RAYTRACING_AABB; + +typedef struct D3D12_RAYTRACING_GEOMETRY_AABBS_DESC + { + UINT64 AABBCount; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE AABBs; + } D3D12_RAYTRACING_GEOMETRY_AABBS_DESC; + +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_NONE = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_UPDATE = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_COMPACTION = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE = 0x4, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_BUILD = 0x8, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY = 0x10, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE = 0x20 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS ) +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_CLONE = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_COMPACT = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_VISUALIZATION_DECODE_FOR_TOOLS = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_SERIALIZE = 0x3, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_DESERIALIZE = 0x4 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE; + +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL = 0x1 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE; + +typedef +enum D3D12_ELEMENTS_LAYOUT + { + D3D12_ELEMENTS_LAYOUT_ARRAY = 0, + D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS = 0x1 + } D3D12_ELEMENTS_LAYOUT; + +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE = 0x3 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS DestBuffer; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE InfoType; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC + { + UINT64 CompactedSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC + { + UINT64 DecodedSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; + UINT NumDescs; + } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER; + +// Regarding D3D12_BUILD_RAY_TRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER above, +// depending on Type field, NumDescs above is followed by either: +// D3D12_RAY_TRACING_INSTANCE_DESC InstanceDescs[NumDescs] +// or D3D12_RAY_TRACING_GEOMETRY_DESC GeometryDescs[NumDescs]. +// There is 4 bytes of padding between GeometryDesc structs in the array so alignment is natural when viewed by CPU. + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC + { + UINT64 SerializedSizeInBytes; + UINT64 NumBottomLevelAccelerationStructurePointers; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC; + +typedef struct D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER + { + GUID DriverOpaqueGUID; + BYTE DriverOpaqueVersioningData[ 16 ]; + } D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER; + +typedef +enum D3D12_SERIALIZED_DATA_TYPE + { + D3D12_SERIALIZED_DATA_RAYTRACING_ACCELERATION_STRUCTURE = 0 + } D3D12_SERIALIZED_DATA_TYPE; + +typedef +enum D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS + { + D3D12_DRIVER_MATCHING_IDENTIFIER_COMPATIBLE_WITH_DEVICE = 0, + D3D12_DRIVER_MATCHING_IDENTIFIER_UNSUPPORTED_TYPE = 0x1, + D3D12_DRIVER_MATCHING_IDENTIFIER_UNRECOGNIZED = 0x2, + D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_VERSION = 0x3, + D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_TYPE = 0x4 + } D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS; + +typedef struct D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER + { + D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER DriverMatchingIdentifier; + UINT64 SerializedSizeInBytesIncludingHeader; + UINT64 DeserializedSizeInBytes; + UINT64 NumBottomLevelAccelerationStructurePointersAfterHeader; + } D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC + { + UINT64 CurrentSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC; + +typedef struct D3D12_RAYTRACING_INSTANCE_DESC + { + FLOAT Transform[ 3 ][ 4 ]; + UINT InstanceID : 24; + UINT InstanceMask : 8; + UINT InstanceContributionToHitGroupIndex : 24; + UINT Flags : 8; + D3D12_GPU_VIRTUAL_ADDRESS AccelerationStructure; + } D3D12_RAYTRACING_INSTANCE_DESC; + +typedef struct D3D12_RAYTRACING_GEOMETRY_DESC + { + D3D12_RAYTRACING_GEOMETRY_TYPE Type; + D3D12_RAYTRACING_GEOMETRY_FLAGS Flags; + union + { + D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC Triangles; + D3D12_RAYTRACING_GEOMETRY_AABBS_DESC AABBs; + } ; + } D3D12_RAYTRACING_GEOMETRY_DESC; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS Flags; + UINT NumDescs; + D3D12_ELEMENTS_LAYOUT DescsLayout; + union + { + D3D12_GPU_VIRTUAL_ADDRESS InstanceDescs; + const D3D12_RAYTRACING_GEOMETRY_DESC *pGeometryDescs; + const D3D12_RAYTRACING_GEOMETRY_DESC *const *ppGeometryDescs; + } ; + } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData; + D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS Inputs; + _In_opt_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData; + D3D12_GPU_VIRTUAL_ADDRESS ScratchAccelerationStructureData; + } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO + { + UINT64 ResultDataMaxSizeInBytes; + UINT64 ScratchDataSizeInBytes; + UINT64 UpdateScratchDataSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO; + +typedef +enum D3D12_RAY_FLAGS + { + D3D12_RAY_FLAG_NONE = 0, + D3D12_RAY_FLAG_FORCE_OPAQUE = 0x1, + D3D12_RAY_FLAG_FORCE_NON_OPAQUE = 0x2, + D3D12_RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH = 0x4, + D3D12_RAY_FLAG_SKIP_CLOSEST_HIT_SHADER = 0x8, + D3D12_RAY_FLAG_CULL_BACK_FACING_TRIANGLES = 0x10, + D3D12_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES = 0x20, + D3D12_RAY_FLAG_CULL_OPAQUE = 0x40, + D3D12_RAY_FLAG_CULL_NON_OPAQUE = 0x80, + D3D12_RAY_FLAG_SKIP_TRIANGLES = 0x100, + D3D12_RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200 + } D3D12_RAY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAY_FLAGS ) +typedef +enum D3D12_HIT_KIND + { + D3D12_HIT_KIND_TRIANGLE_FRONT_FACE = 0xfe, + D3D12_HIT_KIND_TRIANGLE_BACK_FACE = 0xff + } D3D12_HIT_KIND; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0036_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0036_v0_0_s_ifspec; + +#ifndef __ID3D12Device5_INTERFACE_DEFINED__ +#define __ID3D12Device5_INTERFACE_DEFINED__ + +/* interface ID3D12Device5 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device5; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8b4f173b-2fea-4b80-8f58-4307191ab95d") + ID3D12Device5 : public ID3D12Device4 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateLifetimeTracker( + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker) = 0; + + virtual void STDMETHODCALLTYPE RemoveDevice( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommands( + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommandParameters( + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateMetaCommand( + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateStateObject( + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject) = 0; + + virtual void STDMETHODCALLTYPE GetRaytracingAccelerationStructurePrebuildInfo( + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo) = 0; + + virtual D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE CheckDriverMatchingIdentifier( + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device5Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device5 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device5 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device5 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device5 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device5 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device5 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device5 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device5 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device5 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device5 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device5 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device5 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device5 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device5 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device5 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device5 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device5 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device5 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device5 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device5 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device5 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device5 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device5 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device5 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device5 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device5 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device5 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device5 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device5 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device5 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device5 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device5 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device5 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device5 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device5 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device5 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device5 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device5 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device5 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device5 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device5 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device5 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device5 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device5 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device5 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device5 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device5 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device5 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device5 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device5 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device5 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device5 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + END_INTERFACE + } ID3D12Device5Vtbl; + + interface ID3D12Device5 + { + CONST_VTBL struct ID3D12Device5Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device5_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device5_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device5_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device5_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device5_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device5_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device5_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device5_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device5_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device5_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device5_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device5_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device5_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device5_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device5_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device5_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device5_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device5_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device5_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device5_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device5_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device5_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device5_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device5_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device5_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device5_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device5_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device5_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device5_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device5_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device5_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device5_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device5_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device5_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device5_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device5_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device5_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device5_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device5_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device5_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device5_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device5_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device5_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device5_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device5_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device5_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device5_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device5_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device5_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device5_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device5_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device5_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device5_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device5_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device5_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device5_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device5_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device5_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device5_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device5_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device5_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device5_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device5_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device5_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0037 */ +/* [local] */ + +typedef +enum D3D12_AUTO_BREADCRUMB_OP + { + D3D12_AUTO_BREADCRUMB_OP_SETMARKER = 0, + D3D12_AUTO_BREADCRUMB_OP_BEGINEVENT = 1, + D3D12_AUTO_BREADCRUMB_OP_ENDEVENT = 2, + D3D12_AUTO_BREADCRUMB_OP_DRAWINSTANCED = 3, + D3D12_AUTO_BREADCRUMB_OP_DRAWINDEXEDINSTANCED = 4, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEINDIRECT = 5, + D3D12_AUTO_BREADCRUMB_OP_DISPATCH = 6, + D3D12_AUTO_BREADCRUMB_OP_COPYBUFFERREGION = 7, + D3D12_AUTO_BREADCRUMB_OP_COPYTEXTUREREGION = 8, + D3D12_AUTO_BREADCRUMB_OP_COPYRESOURCE = 9, + D3D12_AUTO_BREADCRUMB_OP_COPYTILES = 10, + D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCE = 11, + D3D12_AUTO_BREADCRUMB_OP_CLEARRENDERTARGETVIEW = 12, + D3D12_AUTO_BREADCRUMB_OP_CLEARUNORDEREDACCESSVIEW = 13, + D3D12_AUTO_BREADCRUMB_OP_CLEARDEPTHSTENCILVIEW = 14, + D3D12_AUTO_BREADCRUMB_OP_RESOURCEBARRIER = 15, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEBUNDLE = 16, + D3D12_AUTO_BREADCRUMB_OP_PRESENT = 17, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEQUERYDATA = 18, + D3D12_AUTO_BREADCRUMB_OP_BEGINSUBMISSION = 19, + D3D12_AUTO_BREADCRUMB_OP_ENDSUBMISSION = 20, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME = 21, + D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES = 22, + D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT = 23, + D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT64 = 24, + D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCEREGION = 25, + D3D12_AUTO_BREADCRUMB_OP_WRITEBUFFERIMMEDIATE = 26, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME1 = 27, + D3D12_AUTO_BREADCRUMB_OP_SETPROTECTEDRESOURCESESSION = 28, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME2 = 29, + D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES1 = 30, + D3D12_AUTO_BREADCRUMB_OP_BUILDRAYTRACINGACCELERATIONSTRUCTURE = 31, + D3D12_AUTO_BREADCRUMB_OP_EMITRAYTRACINGACCELERATIONSTRUCTUREPOSTBUILDINFO = 32, + D3D12_AUTO_BREADCRUMB_OP_COPYRAYTRACINGACCELERATIONSTRUCTURE = 33, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHRAYS = 34, + D3D12_AUTO_BREADCRUMB_OP_INITIALIZEMETACOMMAND = 35, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEMETACOMMAND = 36, + D3D12_AUTO_BREADCRUMB_OP_ESTIMATEMOTION = 37, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEMOTIONVECTORHEAP = 38, + D3D12_AUTO_BREADCRUMB_OP_SETPIPELINESTATE1 = 39, + D3D12_AUTO_BREADCRUMB_OP_INITIALIZEEXTENSIONCOMMAND = 40, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEEXTENSIONCOMMAND = 41, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHMESH = 42, + D3D12_AUTO_BREADCRUMB_OP_ENCODEFRAME = 43, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA = 44, + D3D12_AUTO_BREADCRUMB_OP_BARRIER = 45, + D3D12_AUTO_BREADCRUMB_OP_BEGIN_COMMAND_LIST = 46, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHGRAPH = 47, + D3D12_AUTO_BREADCRUMB_OP_SETPROGRAM = 48 + } D3D12_AUTO_BREADCRUMB_OP; + +typedef struct D3D12_AUTO_BREADCRUMB_NODE + { + const char *pCommandListDebugNameA; + const wchar_t *pCommandListDebugNameW; + const char *pCommandQueueDebugNameA; + const wchar_t *pCommandQueueDebugNameW; + ID3D12GraphicsCommandList *pCommandList; + ID3D12CommandQueue *pCommandQueue; + UINT32 BreadcrumbCount; + const UINT32 *pLastBreadcrumbValue; + const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; + const struct D3D12_AUTO_BREADCRUMB_NODE *pNext; + } D3D12_AUTO_BREADCRUMB_NODE; + +typedef struct D3D12_DRED_BREADCRUMB_CONTEXT + { + UINT BreadcrumbIndex; + const wchar_t *pContextString; + } D3D12_DRED_BREADCRUMB_CONTEXT; + +typedef struct D3D12_AUTO_BREADCRUMB_NODE1 + { + const char *pCommandListDebugNameA; + const wchar_t *pCommandListDebugNameW; + const char *pCommandQueueDebugNameA; + const wchar_t *pCommandQueueDebugNameW; + ID3D12GraphicsCommandList *pCommandList; + ID3D12CommandQueue *pCommandQueue; + UINT BreadcrumbCount; + const UINT *pLastBreadcrumbValue; + const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; + const struct D3D12_AUTO_BREADCRUMB_NODE1 *pNext; + UINT BreadcrumbContextsCount; + D3D12_DRED_BREADCRUMB_CONTEXT *pBreadcrumbContexts; + } D3D12_AUTO_BREADCRUMB_NODE1; + +typedef +enum D3D12_DRED_VERSION + { + D3D12_DRED_VERSION_1_0 = 0x1, + D3D12_DRED_VERSION_1_1 = 0x2, + D3D12_DRED_VERSION_1_2 = 0x3, + D3D12_DRED_VERSION_1_3 = 0x4 + } D3D12_DRED_VERSION; + +typedef +enum D3D12_DRED_FLAGS + { + D3D12_DRED_FLAG_NONE = 0, + D3D12_DRED_FLAG_FORCE_ENABLE = 1, + D3D12_DRED_FLAG_DISABLE_AUTOBREADCRUMBS = 2 + } D3D12_DRED_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_FLAGS ) +typedef +enum D3D12_DRED_ENABLEMENT + { + D3D12_DRED_ENABLEMENT_SYSTEM_CONTROLLED = 0, + D3D12_DRED_ENABLEMENT_FORCED_OFF = 1, + D3D12_DRED_ENABLEMENT_FORCED_ON = 2 + } D3D12_DRED_ENABLEMENT; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA + { + _In_ D3D12_DRED_FLAGS Flags; + _Out_ D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA; + +typedef +enum D3D12_DRED_ALLOCATION_TYPE + { + D3D12_DRED_ALLOCATION_TYPE_COMMAND_QUEUE = 19, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_ALLOCATOR = 20, + D3D12_DRED_ALLOCATION_TYPE_PIPELINE_STATE = 21, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_LIST = 22, + D3D12_DRED_ALLOCATION_TYPE_FENCE = 23, + D3D12_DRED_ALLOCATION_TYPE_DESCRIPTOR_HEAP = 24, + D3D12_DRED_ALLOCATION_TYPE_HEAP = 25, + D3D12_DRED_ALLOCATION_TYPE_QUERY_HEAP = 27, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_SIGNATURE = 28, + D3D12_DRED_ALLOCATION_TYPE_PIPELINE_LIBRARY = 29, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER = 30, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_PROCESSOR = 32, + D3D12_DRED_ALLOCATION_TYPE_RESOURCE = 34, + D3D12_DRED_ALLOCATION_TYPE_PASS = 35, + D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSION = 36, + D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSIONPOLICY = 37, + D3D12_DRED_ALLOCATION_TYPE_PROTECTEDRESOURCESESSION = 38, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER_HEAP = 39, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_POOL = 40, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_RECORDER = 41, + D3D12_DRED_ALLOCATION_TYPE_STATE_OBJECT = 42, + D3D12_DRED_ALLOCATION_TYPE_METACOMMAND = 43, + D3D12_DRED_ALLOCATION_TYPE_SCHEDULINGGROUP = 44, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_ESTIMATOR = 45, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_VECTOR_HEAP = 46, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_EXTENSION_COMMAND = 47, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER = 48, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER_HEAP = 49, + D3D12_DRED_ALLOCATION_TYPE_INVALID = 0xffffffff + } D3D12_DRED_ALLOCATION_TYPE; + +typedef struct D3D12_DRED_ALLOCATION_NODE + { + const char *ObjectNameA; + const wchar_t *ObjectNameW; + D3D12_DRED_ALLOCATION_TYPE AllocationType; + const struct D3D12_DRED_ALLOCATION_NODE *pNext; + } D3D12_DRED_ALLOCATION_NODE; + +typedef struct D3D12_DRED_ALLOCATION_NODE1 + { + const char *ObjectNameA; + const wchar_t *ObjectNameW; + D3D12_DRED_ALLOCATION_TYPE AllocationType; + const struct D3D12_DRED_ALLOCATION_NODE1 *pNext; + const IUnknown *pObject; + } D3D12_DRED_ALLOCATION_NODE1; + +typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT + { + _Out_ const D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; + } D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT; + +typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 + { + _Out_ const D3D12_AUTO_BREADCRUMB_NODE1 *pHeadAutoBreadcrumbNode; + } D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT + { + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; + _Out_ const D3D12_DRED_ALLOCATION_NODE *pHeadExistingAllocationNode; + _Out_ const D3D12_DRED_ALLOCATION_NODE *pHeadRecentFreedAllocationNode; + } D3D12_DRED_PAGE_FAULT_OUTPUT; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT1 + { + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; + } D3D12_DRED_PAGE_FAULT_OUTPUT1; + +typedef +enum D3D12_DRED_PAGE_FAULT_FLAGS + { + D3D12_DRED_PAGE_FAULT_FLAGS_NONE = 0 + } D3D12_DRED_PAGE_FAULT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_PAGE_FAULT_FLAGS ) +typedef +enum D3D12_DRED_DEVICE_STATE + { + D3D12_DRED_DEVICE_STATE_UNKNOWN = 0, + D3D12_DRED_DEVICE_STATE_HUNG = 3, + D3D12_DRED_DEVICE_STATE_FAULT = 6, + D3D12_DRED_DEVICE_STATE_PAGEFAULT = 7 + } D3D12_DRED_DEVICE_STATE; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT2 + { + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; + D3D12_DRED_PAGE_FAULT_FLAGS PageFaultFlags; + } D3D12_DRED_PAGE_FAULT_OUTPUT2; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA1 + { + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT PageFaultOutput; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA1; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA2 + { + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT1 PageFaultOutput; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA2; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA3 + { + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT2 PageFaultOutput; + D3D12_DRED_DEVICE_STATE DeviceState; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA3; + +typedef struct D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA + { + D3D12_DRED_VERSION Version; + union + { + D3D12_DEVICE_REMOVED_EXTENDED_DATA Dred_1_0; + D3D12_DEVICE_REMOVED_EXTENDED_DATA1 Dred_1_1; + D3D12_DEVICE_REMOVED_EXTENDED_DATA2 Dred_1_2; + D3D12_DEVICE_REMOVED_EXTENDED_DATA3 Dred_1_3; + } ; + } D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0037_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0037_v0_0_s_ifspec; + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedDataSettings */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("82BC481C-6B9B-4030-AEDB-7EE3D1DF1E63") + ID3D12DeviceRemovedExtendedDataSettings : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE SetAutoBreadcrumbsEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + virtual void STDMETHODCALLTYPE SetPageFaultEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + virtual void STDMETHODCALLTYPE SetWatsonDumpEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataSettingsVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedDataSettings * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedDataSettings * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedDataSettings * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) + void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( + ID3D12DeviceRemovedExtendedDataSettings * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) + void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( + ID3D12DeviceRemovedExtendedDataSettings * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) + void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( + ID3D12DeviceRemovedExtendedDataSettings * This, + D3D12_DRED_ENABLEMENT Enablement); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataSettingsVtbl; + + interface ID3D12DeviceRemovedExtendedDataSettings + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettingsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedDataSettings_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings_SetAutoBreadcrumbsEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_SetPageFaultEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_SetWatsonDumpEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedDataSettings1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DBD5AE51-3317-4F0A-ADF9-1D7CEDCAAE0B") + ID3D12DeviceRemovedExtendedDataSettings1 : public ID3D12DeviceRemovedExtendedDataSettings + { + public: + virtual void STDMETHODCALLTYPE SetBreadcrumbContextEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedDataSettings1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedDataSettings1 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) + void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) + void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) + void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement) + void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataSettings1Vtbl; + + interface ID3D12DeviceRemovedExtendedDataSettings1 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedDataSettings1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetAutoBreadcrumbsEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetPageFaultEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetWatsonDumpEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetBreadcrumbContextEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedDataSettings2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("61552388-01ab-4008-a436-83db189566ea") + ID3D12DeviceRemovedExtendedDataSettings2 : public ID3D12DeviceRemovedExtendedDataSettings1 + { + public: + virtual void STDMETHODCALLTYPE UseMarkersOnlyAutoBreadcrumbs( + BOOL MarkersOnly) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedDataSettings2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedDataSettings2 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) + void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) + void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) + void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement) + void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings2, UseMarkersOnlyAutoBreadcrumbs) + void ( STDMETHODCALLTYPE *UseMarkersOnlyAutoBreadcrumbs )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + BOOL MarkersOnly); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataSettings2Vtbl; + + interface ID3D12DeviceRemovedExtendedDataSettings2 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedDataSettings2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetAutoBreadcrumbsEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetPageFaultEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetWatsonDumpEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetBreadcrumbContextEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings2_UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) \ + ( (This)->lpVtbl -> UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedData */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("98931D33-5AE8-4791-AA3C-1A73A2934E71") + ID3D12DeviceRemovedExtendedData : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput( + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput( + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedData * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedData * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedData * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( + ID3D12DeviceRemovedExtendedData * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( + ID3D12DeviceRemovedExtendedData * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataVtbl; + + interface ID3D12DeviceRemovedExtendedData + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedData_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedData_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedData_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedData_GetAutoBreadcrumbsOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData_GetPageFaultAllocationOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedData1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9727A022-CF1D-4DDA-9EBA-EFFA653FC506") + ID3D12DeviceRemovedExtendedData1 : public ID3D12DeviceRemovedExtendedData + { + public: + virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput1( + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput1( + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedData1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedData1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedData1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedData1 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedData1Vtbl; + + interface ID3D12DeviceRemovedExtendedData1 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedData1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedData1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedData1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedData1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) + + +#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedData2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("67FC5816-E4CA-4915-BF18-42541272DA54") + ID3D12DeviceRemovedExtendedData2 : public ID3D12DeviceRemovedExtendedData1 + { + public: + virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput2( + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput) = 0; + + virtual D3D12_DRED_DEVICE_STATE STDMETHODCALLTYPE GetDeviceState( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedData2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedData2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedData2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedData2 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetPageFaultAllocationOutput2) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput2 )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetDeviceState) + D3D12_DRED_DEVICE_STATE ( STDMETHODCALLTYPE *GetDeviceState )( + ID3D12DeviceRemovedExtendedData2 * This); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedData2Vtbl; + + interface ID3D12DeviceRemovedExtendedData2 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedData2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedData2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedData2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedData2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) + + +#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) ) + + +#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput2(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput2(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData2_GetDeviceState(This) \ + ( (This)->lpVtbl -> GetDeviceState(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0043 */ +/* [local] */ + +typedef +enum D3D12_BACKGROUND_PROCESSING_MODE + { + D3D12_BACKGROUND_PROCESSING_MODE_ALLOWED = 0, + D3D12_BACKGROUND_PROCESSING_MODE_ALLOW_INTRUSIVE_MEASUREMENTS = ( D3D12_BACKGROUND_PROCESSING_MODE_ALLOWED + 1 ) , + D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_BACKGROUND_WORK = ( D3D12_BACKGROUND_PROCESSING_MODE_ALLOW_INTRUSIVE_MEASUREMENTS + 1 ) , + D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_PROFILING_BY_SYSTEM = ( D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_BACKGROUND_WORK + 1 ) + } D3D12_BACKGROUND_PROCESSING_MODE; + +typedef +enum D3D12_MEASUREMENTS_ACTION + { + D3D12_MEASUREMENTS_ACTION_KEEP_ALL = 0, + D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS = ( D3D12_MEASUREMENTS_ACTION_KEEP_ALL + 1 ) , + D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS_HIGH_PRIORITY = ( D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS + 1 ) , + D3D12_MEASUREMENTS_ACTION_DISCARD_PREVIOUS = ( D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS_HIGH_PRIORITY + 1 ) + } D3D12_MEASUREMENTS_ACTION; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0043_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0043_v0_0_s_ifspec; + +#ifndef __ID3D12Device6_INTERFACE_DEFINED__ +#define __ID3D12Device6_INTERFACE_DEFINED__ + +/* interface ID3D12Device6 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device6; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c70b221b-40e4-4a17-89af-025a0727a6dc") + ID3D12Device6 : public ID3D12Device5 + { + public: + virtual HRESULT STDMETHODCALLTYPE SetBackgroundProcessingMode( + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device6Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device6 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device6 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device6 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device6 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device6 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device6 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device6 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device6 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device6 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device6 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device6 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device6 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device6 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device6 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device6 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device6 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device6 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device6 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device6 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device6 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device6 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device6 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device6 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device6 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device6 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device6 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device6 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device6 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device6 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device6 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device6 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device6 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device6 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device6 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device6 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device6 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device6 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device6 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device6 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device6 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device6 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device6 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device6 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device6 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device6 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device6 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device6 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device6 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device6 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device6 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device6 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device6 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device6 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + END_INTERFACE + } ID3D12Device6Vtbl; + + interface ID3D12Device6 + { + CONST_VTBL struct ID3D12Device6Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device6_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device6_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device6_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device6_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device6_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device6_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device6_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device6_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device6_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device6_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device6_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device6_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device6_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device6_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device6_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device6_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device6_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device6_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device6_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device6_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device6_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device6_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device6_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device6_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device6_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device6_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device6_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device6_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device6_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device6_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device6_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device6_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device6_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device6_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device6_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device6_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device6_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device6_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device6_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device6_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device6_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device6_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device6_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device6_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device6_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device6_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device6_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device6_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device6_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device6_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device6_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device6_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device6_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device6_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device6_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device6_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device6_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device6_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device6_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device6_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device6_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device6_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device6_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device6_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device6_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0044 */ +/* [local] */ + +DEFINE_GUID(D3D12_PROTECTED_RESOURCES_SESSION_HARDWARE_PROTECTED, 0x62B0084E, 0xC70E, 0x4DAA, 0xA1, 0x09, 0x30, 0xFF, 0x8D, 0x5A, 0x04, 0x82); +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT + { + UINT NodeIndex; + UINT Count; + } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT; + +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES + { + UINT NodeIndex; + UINT Count; + GUID *pTypes; + } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES; + +typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC1 + { + UINT NodeMask; + D3D12_PROTECTED_RESOURCE_SESSION_FLAGS Flags; + GUID ProtectionType; + } D3D12_PROTECTED_RESOURCE_SESSION_DESC1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0044_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0044_v0_0_s_ifspec; + +#ifndef __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ +#define __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ + +/* interface ID3D12ProtectedResourceSession1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ProtectedResourceSession1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D6F12DD6-76FB-406E-8961-4296EEFC0409") + ID3D12ProtectedResourceSession1 : public ID3D12ProtectedResourceSession + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0; +#else + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *STDMETHODCALLTYPE GetDesc1( + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ProtectedResourceSession1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ProtectedResourceSession1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ProtectedResourceSession1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ProtectedResourceSession1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ProtectedResourceSession1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ProtectedResourceSession1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ProtectedResourceSession1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ProtectedResourceSession1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ProtectedResourceSession1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence) + HRESULT ( STDMETHODCALLTYPE *GetStatusFence )( + ID3D12ProtectedResourceSession1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus) + D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )( + ID3D12ProtectedResourceSession1 * This); + + DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession, GetDesc) +#if !defined(_WIN32) + D3D12_PROTECTED_RESOURCE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession1 * This); + +#else + D3D12_PROTECTED_RESOURCE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession1 * This, + D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession1, GetDesc1) +#if !defined(_WIN32) + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12ProtectedResourceSession1 * This); + +#else + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12ProtectedResourceSession1 * This, + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal); + +#endif + + END_INTERFACE + } ID3D12ProtectedResourceSession1Vtbl; + + interface ID3D12ProtectedResourceSession1 + { + CONST_VTBL struct ID3D12ProtectedResourceSession1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ProtectedResourceSession1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ProtectedResourceSession1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ProtectedResourceSession1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ProtectedResourceSession1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12ProtectedResourceSession1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12ProtectedResourceSession1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12ProtectedResourceSession1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12ProtectedResourceSession1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12ProtectedResourceSession1_GetStatusFence(This,riid,ppFence) \ + ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) ) + +#define ID3D12ProtectedResourceSession1_GetSessionStatus(This) \ + ( (This)->lpVtbl -> GetSessionStatus(This) ) + +#if !defined(_WIN32) + +#define ID3D12ProtectedResourceSession1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12ProtectedResourceSession1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#if !defined(_WIN32) + +#define ID3D12ProtectedResourceSession1_GetDesc1(This) \ + ( (This)->lpVtbl -> GetDesc1(This) ) +#else +#define ID3D12ProtectedResourceSession1_GetDesc1(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc1(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device7_INTERFACE_DEFINED__ +#define __ID3D12Device7_INTERFACE_DEFINED__ + +/* interface ID3D12Device7 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device7; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5c014b53-68a1-4b9b-8bd1-dd6046b9358b") + ID3D12Device7 : public ID3D12Device6 + { + public: + virtual HRESULT STDMETHODCALLTYPE AddToStateObject( + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateProtectedResourceSession1( + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device7Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device7 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device7 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device7 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device7 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_z_ LPCWSTR Name); DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) UINT ( STDMETHODCALLTYPE *GetNodeCount )( - ID3D12Device5 * This); + ID3D12Device7 * This); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppCommandQueue); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ D3D12_COMMAND_LIST_TYPE type, REFIID riid, _COM_Outptr_ void **ppCommandAllocator); DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ UINT nodeMask, _In_ D3D12_COMMAND_LIST_TYPE type, _In_ ID3D12CommandAllocator *pCommandAllocator, @@ -14060,26 +17669,26 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( - ID3D12Device5 * This, + ID3D12Device7 * This, D3D12_FEATURE Feature, _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, UINT FeatureSupportDataSize); DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, REFIID riid, _COM_Outptr_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ UINT nodeMask, _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, _In_ SIZE_T blobLengthInBytes, @@ -14088,20 +17697,20 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) void ( STDMETHODCALLTYPE *CreateConstantBufferView )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) void ( STDMETHODCALLTYPE *CreateShaderResourceView )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ ID3D12Resource *pCounterResource, _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, @@ -14109,27 +17718,27 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) void ( STDMETHODCALLTYPE *CreateRenderTargetView )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) void ( STDMETHODCALLTYPE *CreateDepthStencilView )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) void ( STDMETHODCALLTYPE *CreateSampler )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_SAMPLER_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) void ( STDMETHODCALLTYPE *CopyDescriptors )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ UINT NumDestDescriptorRanges, _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, @@ -14140,7 +17749,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ UINT NumDescriptors, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, @@ -14149,14 +17758,14 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) #if !defined(_WIN32) D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ UINT visibleMask, _In_ UINT numResourceDescs, _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); #else D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device5 * This, + ID3D12Device7 * This, D3D12_RESOURCE_ALLOCATION_INFO * RetVal, _In_ UINT visibleMask, _In_ UINT numResourceDescs, @@ -14167,13 +17776,13 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) #if !defined(_WIN32) D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ UINT nodeMask, D3D12_HEAP_TYPE heapType); #else D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device5 * This, + ID3D12Device7 * This, D3D12_HEAP_PROPERTIES * RetVal, _In_ UINT nodeMask, D3D12_HEAP_TYPE heapType); @@ -14182,7 +17791,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, _In_ const D3D12_RESOURCE_DESC *pDesc, @@ -14193,14 +17802,14 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) HRESULT ( STDMETHODCALLTYPE *CreateHeap )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_HEAP_DESC *pDesc, REFIID riid, _COM_Outptr_opt_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ ID3D12Heap *pHeap, UINT64 HeapOffset, _In_ const D3D12_RESOURCE_DESC *pDesc, @@ -14211,7 +17820,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_RESOURCE_DESC *pDesc, D3D12_RESOURCE_STATES InitialState, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, @@ -14220,7 +17829,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ ID3D12DeviceChild *pObject, _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, DWORD Access, @@ -14229,14 +17838,14 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ HANDLE NTHandle, REFIID riid, _COM_Outptr_opt_ void **ppvObj); DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ LPCWSTR Name, DWORD Access, /* [annotation][out] */ @@ -14244,19 +17853,19 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) HRESULT ( STDMETHODCALLTYPE *MakeResident )( - ID3D12Device5 * This, + ID3D12Device7 * This, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); DECLSPEC_XFGVIRT(ID3D12Device, Evict) HRESULT ( STDMETHODCALLTYPE *Evict )( - ID3D12Device5 * This, + ID3D12Device7 * This, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) HRESULT ( STDMETHODCALLTYPE *CreateFence )( - ID3D12Device5 * This, + ID3D12Device7 * This, UINT64 InitialValue, D3D12_FENCE_FLAGS Flags, REFIID riid, @@ -14264,11 +17873,11 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( - ID3D12Device5 * This); + ID3D12Device7 * This); DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) void ( STDMETHODCALLTYPE *GetCopyableFootprints )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_RESOURCE_DESC *pResourceDesc, _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, @@ -14280,19 +17889,19 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_QUERY_HEAP_DESC *pDesc, REFIID riid, _COM_Outptr_opt_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( - ID3D12Device5 * This, + ID3D12Device7 * This, BOOL Enable); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, _In_opt_ ID3D12RootSignature *pRootSignature, REFIID riid, @@ -14300,7 +17909,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) void ( STDMETHODCALLTYPE *GetResourceTiling )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ ID3D12Resource *pTiledResource, _Out_opt_ UINT *pNumTilesForEntireResource, _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, @@ -14312,18 +17921,18 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) #if !defined(_WIN32) LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device5 * This); + ID3D12Device7 * This); #else LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device5 * This, + ID3D12Device7 * This, LUID * RetVal); #endif DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_reads_(BlobLength) const void *pLibraryBlob, SIZE_T BlobLength, REFIID riid, @@ -14331,7 +17940,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_reads_(NumFences) ID3D12Fence *const *ppFences, _In_reads_(NumFences) const UINT64 *pFenceValues, UINT NumFences, @@ -14340,35 +17949,35 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( - ID3D12Device5 * This, + ID3D12Device7 * This, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( - ID3D12Device5 * This, + ID3D12Device7 * This, const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const void *pAddress, REFIID riid, _COM_Outptr_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ HANDLE hFileMapping, REFIID riid, _COM_Outptr_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( - ID3D12Device5 * This, + ID3D12Device7 * This, D3D12_RESIDENCY_FLAGS Flags, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, @@ -14377,7 +17986,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ UINT nodeMask, _In_ D3D12_COMMAND_LIST_TYPE type, _In_ D3D12_COMMAND_LIST_FLAGS flags, @@ -14386,14 +17995,14 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, _In_ REFIID riid, _COM_Outptr_ void **ppSession); DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, _In_ const D3D12_RESOURCE_DESC *pDesc, @@ -14405,7 +18014,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_HEAP_DESC *pDesc, _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, REFIID riid, @@ -14413,7 +18022,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_RESOURCE_DESC *pDesc, D3D12_RESOURCE_STATES InitialState, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, @@ -14424,7 +18033,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) #if !defined(_WIN32) D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device5 * This, + ID3D12Device7 * This, UINT visibleMask, UINT numResourceDescs, _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, @@ -14432,7 +18041,7 @@ EXTERN_C const IID IID_ID3D12Device5; #else D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device5 * This, + ID3D12Device7 * This, D3D12_RESOURCE_ALLOCATION_INFO * RetVal, UINT visibleMask, UINT numResourceDescs, @@ -14443,24 +18052,24 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ ID3D12LifetimeOwner *pOwner, REFIID riid, _COM_Outptr_ void **ppvTracker); DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) void ( STDMETHODCALLTYPE *RemoveDevice )( - ID3D12Device5 * This); + ID3D12Device7 * This); DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( - ID3D12Device5 * This, + ID3D12Device7 * This, _Inout_ UINT *pNumMetaCommands, _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ REFGUID CommandId, _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, _Out_opt_ UINT *pTotalStructureSizeInBytes, @@ -14469,7 +18078,7 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ REFGUID CommandId, _In_ UINT NodeMask, _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, @@ -14479,29 +18088,52 @@ EXTERN_C const IID IID_ID3D12Device5; DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( - ID3D12Device5 * This, + ID3D12Device7 * This, const D3D12_STATE_OBJECT_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppStateObject); DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( - ID3D12Device5 * This, + ID3D12Device7 * This, _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device7 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device7 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device7 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + END_INTERFACE - } ID3D12Device5Vtbl; + } ID3D12Device7Vtbl; - interface ID3D12Device5 + interface ID3D12Device7 { - CONST_VTBL struct ID3D12Device5Vtbl *lpVtbl; + CONST_VTBL struct ID3D12Device7Vtbl *lpVtbl; }; @@ -14509,992 +18141,933 @@ EXTERN_C const IID IID_ID3D12Device5; #ifdef COBJMACROS -#define ID3D12Device5_QueryInterface(This,riid,ppvObject) \ +#define ID3D12Device7_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device5_AddRef(This) \ +#define ID3D12Device7_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Device5_Release(This) \ +#define ID3D12Device7_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Device5_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12Device7_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12Device5_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12Device7_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12Device5_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12Device7_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12Device5_SetName(This,Name) \ +#define ID3D12Device7_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12Device5_GetNodeCount(This) \ +#define ID3D12Device7_GetNodeCount(This) \ ( (This)->lpVtbl -> GetNodeCount(This) ) -#define ID3D12Device5_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ +#define ID3D12Device7_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) -#define ID3D12Device5_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ +#define ID3D12Device7_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) -#define ID3D12Device5_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ +#define ID3D12Device7_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device5_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ +#define ID3D12Device7_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device5_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ +#define ID3D12Device7_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) -#define ID3D12Device5_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ +#define ID3D12Device7_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) -#define ID3D12Device5_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ +#define ID3D12Device7_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) -#define ID3D12Device5_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ +#define ID3D12Device7_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) -#define ID3D12Device5_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ +#define ID3D12Device7_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) -#define ID3D12Device5_CreateConstantBufferView(This,pDesc,DestDescriptor) \ +#define ID3D12Device7_CreateConstantBufferView(This,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) -#define ID3D12Device5_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ +#define ID3D12Device7_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device5_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ +#define ID3D12Device7_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) -#define ID3D12Device5_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ +#define ID3D12Device7_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device5_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ +#define ID3D12Device7_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device5_CreateSampler(This,pDesc,DestDescriptor) \ +#define ID3D12Device7_CreateSampler(This,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) -#define ID3D12Device5_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ +#define ID3D12Device7_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) -#define ID3D12Device5_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ +#define ID3D12Device7_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) #if !defined(_WIN32) -#define ID3D12Device5_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ +#define ID3D12Device7_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) #else -#define ID3D12Device5_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ +#define ID3D12Device7_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) #endif #if !defined(_WIN32) -#define ID3D12Device5_GetCustomHeapProperties(This,nodeMask,heapType) \ +#define ID3D12Device7_GetCustomHeapProperties(This,nodeMask,heapType) \ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) #else -#define ID3D12Device5_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ +#define ID3D12Device7_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) #endif -#define ID3D12Device5_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ +#define ID3D12Device7_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) -#define ID3D12Device5_CreateHeap(This,pDesc,riid,ppvHeap) \ +#define ID3D12Device7_CreateHeap(This,pDesc,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12Device5_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ +#define ID3D12Device7_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device5_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ +#define ID3D12Device7_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device5_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ +#define ID3D12Device7_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) -#define ID3D12Device5_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ +#define ID3D12Device7_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) -#define ID3D12Device5_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ +#define ID3D12Device7_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) -#define ID3D12Device5_MakeResident(This,NumObjects,ppObjects) \ +#define ID3D12Device7_MakeResident(This,NumObjects,ppObjects) \ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) -#define ID3D12Device5_Evict(This,NumObjects,ppObjects) \ +#define ID3D12Device7_Evict(This,NumObjects,ppObjects) \ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) -#define ID3D12Device5_CreateFence(This,InitialValue,Flags,riid,ppFence) \ +#define ID3D12Device7_CreateFence(This,InitialValue,Flags,riid,ppFence) \ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) -#define ID3D12Device5_GetDeviceRemovedReason(This) \ +#define ID3D12Device7_GetDeviceRemovedReason(This) \ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) -#define ID3D12Device5_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ +#define ID3D12Device7_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) -#define ID3D12Device5_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ +#define ID3D12Device7_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12Device5_SetStablePowerState(This,Enable) \ +#define ID3D12Device7_SetStablePowerState(This,Enable) \ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) -#define ID3D12Device5_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ +#define ID3D12Device7_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) -#define ID3D12Device5_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ +#define ID3D12Device7_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) #if !defined(_WIN32) -#define ID3D12Device5_GetAdapterLuid(This) \ +#define ID3D12Device7_GetAdapterLuid(This) \ ( (This)->lpVtbl -> GetAdapterLuid(This) ) #else -#define ID3D12Device5_GetAdapterLuid(This,RetVal) \ +#define ID3D12Device7_GetAdapterLuid(This,RetVal) \ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) #endif -#define ID3D12Device5_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ +#define ID3D12Device7_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) -#define ID3D12Device5_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ +#define ID3D12Device7_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) -#define ID3D12Device5_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ +#define ID3D12Device7_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) -#define ID3D12Device5_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ +#define ID3D12Device7_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device5_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ +#define ID3D12Device7_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) -#define ID3D12Device5_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ +#define ID3D12Device7_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) -#define ID3D12Device5_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ +#define ID3D12Device7_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) -#define ID3D12Device5_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ +#define ID3D12Device7_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) -#define ID3D12Device5_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ +#define ID3D12Device7_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) -#define ID3D12Device5_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ +#define ID3D12Device7_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -#define ID3D12Device5_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ +#define ID3D12Device7_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) -#define ID3D12Device5_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ +#define ID3D12Device7_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) #if !defined(_WIN32) -#define ID3D12Device5_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device7_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else -#define ID3D12Device5_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device7_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif -#define ID3D12Device5_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ +#define ID3D12Device7_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) -#define ID3D12Device5_RemoveDevice(This) \ +#define ID3D12Device7_RemoveDevice(This) \ ( (This)->lpVtbl -> RemoveDevice(This) ) -#define ID3D12Device5_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ +#define ID3D12Device7_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) -#define ID3D12Device5_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ +#define ID3D12Device7_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) -#define ID3D12Device5_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ +#define ID3D12Device7_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) -#define ID3D12Device5_CreateStateObject(This,pDesc,riid,ppStateObject) \ +#define ID3D12Device7_CreateStateObject(This,pDesc,riid,ppStateObject) \ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) -#define ID3D12Device5_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ +#define ID3D12Device7_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) -#define ID3D12Device5_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ +#define ID3D12Device7_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D12Device5_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_d3d12_0000_0035 */ -/* [local] */ - -typedef -enum D3D12_AUTO_BREADCRUMB_OP - { - D3D12_AUTO_BREADCRUMB_OP_SETMARKER = 0, - D3D12_AUTO_BREADCRUMB_OP_BEGINEVENT = 1, - D3D12_AUTO_BREADCRUMB_OP_ENDEVENT = 2, - D3D12_AUTO_BREADCRUMB_OP_DRAWINSTANCED = 3, - D3D12_AUTO_BREADCRUMB_OP_DRAWINDEXEDINSTANCED = 4, - D3D12_AUTO_BREADCRUMB_OP_EXECUTEINDIRECT = 5, - D3D12_AUTO_BREADCRUMB_OP_DISPATCH = 6, - D3D12_AUTO_BREADCRUMB_OP_COPYBUFFERREGION = 7, - D3D12_AUTO_BREADCRUMB_OP_COPYTEXTUREREGION = 8, - D3D12_AUTO_BREADCRUMB_OP_COPYRESOURCE = 9, - D3D12_AUTO_BREADCRUMB_OP_COPYTILES = 10, - D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCE = 11, - D3D12_AUTO_BREADCRUMB_OP_CLEARRENDERTARGETVIEW = 12, - D3D12_AUTO_BREADCRUMB_OP_CLEARUNORDEREDACCESSVIEW = 13, - D3D12_AUTO_BREADCRUMB_OP_CLEARDEPTHSTENCILVIEW = 14, - D3D12_AUTO_BREADCRUMB_OP_RESOURCEBARRIER = 15, - D3D12_AUTO_BREADCRUMB_OP_EXECUTEBUNDLE = 16, - D3D12_AUTO_BREADCRUMB_OP_PRESENT = 17, - D3D12_AUTO_BREADCRUMB_OP_RESOLVEQUERYDATA = 18, - D3D12_AUTO_BREADCRUMB_OP_BEGINSUBMISSION = 19, - D3D12_AUTO_BREADCRUMB_OP_ENDSUBMISSION = 20, - D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME = 21, - D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES = 22, - D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT = 23, - D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT64 = 24, - D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCEREGION = 25, - D3D12_AUTO_BREADCRUMB_OP_WRITEBUFFERIMMEDIATE = 26, - D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME1 = 27, - D3D12_AUTO_BREADCRUMB_OP_SETPROTECTEDRESOURCESESSION = 28, - D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME2 = 29, - D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES1 = 30, - D3D12_AUTO_BREADCRUMB_OP_BUILDRAYTRACINGACCELERATIONSTRUCTURE = 31, - D3D12_AUTO_BREADCRUMB_OP_EMITRAYTRACINGACCELERATIONSTRUCTUREPOSTBUILDINFO = 32, - D3D12_AUTO_BREADCRUMB_OP_COPYRAYTRACINGACCELERATIONSTRUCTURE = 33, - D3D12_AUTO_BREADCRUMB_OP_DISPATCHRAYS = 34, - D3D12_AUTO_BREADCRUMB_OP_INITIALIZEMETACOMMAND = 35, - D3D12_AUTO_BREADCRUMB_OP_EXECUTEMETACOMMAND = 36, - D3D12_AUTO_BREADCRUMB_OP_ESTIMATEMOTION = 37, - D3D12_AUTO_BREADCRUMB_OP_RESOLVEMOTIONVECTORHEAP = 38, - D3D12_AUTO_BREADCRUMB_OP_SETPIPELINESTATE1 = 39, - D3D12_AUTO_BREADCRUMB_OP_INITIALIZEEXTENSIONCOMMAND = 40, - D3D12_AUTO_BREADCRUMB_OP_EXECUTEEXTENSIONCOMMAND = 41, - D3D12_AUTO_BREADCRUMB_OP_DISPATCHMESH = 42, - D3D12_AUTO_BREADCRUMB_OP_ENCODEFRAME = 43, - D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA = 44 - } D3D12_AUTO_BREADCRUMB_OP; - -typedef struct D3D12_AUTO_BREADCRUMB_NODE - { - const char *pCommandListDebugNameA; - const wchar_t *pCommandListDebugNameW; - const char *pCommandQueueDebugNameA; - const wchar_t *pCommandQueueDebugNameW; - ID3D12GraphicsCommandList *pCommandList; - ID3D12CommandQueue *pCommandQueue; - UINT32 BreadcrumbCount; - const UINT32 *pLastBreadcrumbValue; - const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; - const struct D3D12_AUTO_BREADCRUMB_NODE *pNext; - } D3D12_AUTO_BREADCRUMB_NODE; - -typedef struct D3D12_DRED_BREADCRUMB_CONTEXT - { - UINT BreadcrumbIndex; - const wchar_t *pContextString; - } D3D12_DRED_BREADCRUMB_CONTEXT; - -typedef struct D3D12_AUTO_BREADCRUMB_NODE1 - { - const char *pCommandListDebugNameA; - const wchar_t *pCommandListDebugNameW; - const char *pCommandQueueDebugNameA; - const wchar_t *pCommandQueueDebugNameW; - ID3D12GraphicsCommandList *pCommandList; - ID3D12CommandQueue *pCommandQueue; - UINT BreadcrumbCount; - const UINT *pLastBreadcrumbValue; - const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; - const struct D3D12_AUTO_BREADCRUMB_NODE1 *pNext; - UINT BreadcrumbContextsCount; - D3D12_DRED_BREADCRUMB_CONTEXT *pBreadcrumbContexts; - } D3D12_AUTO_BREADCRUMB_NODE1; - -typedef -enum D3D12_DRED_VERSION - { - D3D12_DRED_VERSION_1_0 = 0x1, - D3D12_DRED_VERSION_1_1 = 0x2, - D3D12_DRED_VERSION_1_2 = 0x3, - D3D12_DRED_VERSION_1_3 = 0x4 - } D3D12_DRED_VERSION; - -typedef -enum D3D12_DRED_FLAGS - { - D3D12_DRED_FLAG_NONE = 0, - D3D12_DRED_FLAG_FORCE_ENABLE = 1, - D3D12_DRED_FLAG_DISABLE_AUTOBREADCRUMBS = 2 - } D3D12_DRED_FLAGS; - -DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_FLAGS ); -typedef -enum D3D12_DRED_ENABLEMENT - { - D3D12_DRED_ENABLEMENT_SYSTEM_CONTROLLED = 0, - D3D12_DRED_ENABLEMENT_FORCED_OFF = 1, - D3D12_DRED_ENABLEMENT_FORCED_ON = 2 - } D3D12_DRED_ENABLEMENT; - -typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA - { - _In_ D3D12_DRED_FLAGS Flags; - _Out_ D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; - } D3D12_DEVICE_REMOVED_EXTENDED_DATA; - -typedef -enum D3D12_DRED_ALLOCATION_TYPE - { - D3D12_DRED_ALLOCATION_TYPE_COMMAND_QUEUE = 19, - D3D12_DRED_ALLOCATION_TYPE_COMMAND_ALLOCATOR = 20, - D3D12_DRED_ALLOCATION_TYPE_PIPELINE_STATE = 21, - D3D12_DRED_ALLOCATION_TYPE_COMMAND_LIST = 22, - D3D12_DRED_ALLOCATION_TYPE_FENCE = 23, - D3D12_DRED_ALLOCATION_TYPE_DESCRIPTOR_HEAP = 24, - D3D12_DRED_ALLOCATION_TYPE_HEAP = 25, - D3D12_DRED_ALLOCATION_TYPE_QUERY_HEAP = 27, - D3D12_DRED_ALLOCATION_TYPE_COMMAND_SIGNATURE = 28, - D3D12_DRED_ALLOCATION_TYPE_PIPELINE_LIBRARY = 29, - D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER = 30, - D3D12_DRED_ALLOCATION_TYPE_VIDEO_PROCESSOR = 32, - D3D12_DRED_ALLOCATION_TYPE_RESOURCE = 34, - D3D12_DRED_ALLOCATION_TYPE_PASS = 35, - D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSION = 36, - D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSIONPOLICY = 37, - D3D12_DRED_ALLOCATION_TYPE_PROTECTEDRESOURCESESSION = 38, - D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER_HEAP = 39, - D3D12_DRED_ALLOCATION_TYPE_COMMAND_POOL = 40, - D3D12_DRED_ALLOCATION_TYPE_COMMAND_RECORDER = 41, - D3D12_DRED_ALLOCATION_TYPE_STATE_OBJECT = 42, - D3D12_DRED_ALLOCATION_TYPE_METACOMMAND = 43, - D3D12_DRED_ALLOCATION_TYPE_SCHEDULINGGROUP = 44, - D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_ESTIMATOR = 45, - D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_VECTOR_HEAP = 46, - D3D12_DRED_ALLOCATION_TYPE_VIDEO_EXTENSION_COMMAND = 47, - D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER = 48, - D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER_HEAP = 49, - D3D12_DRED_ALLOCATION_TYPE_INVALID = 0xffffffff - } D3D12_DRED_ALLOCATION_TYPE; - -typedef struct D3D12_DRED_ALLOCATION_NODE - { - const char *ObjectNameA; - const wchar_t *ObjectNameW; - D3D12_DRED_ALLOCATION_TYPE AllocationType; - const struct D3D12_DRED_ALLOCATION_NODE *pNext; - } D3D12_DRED_ALLOCATION_NODE; - -typedef struct D3D12_DRED_ALLOCATION_NODE1 - { - const char *ObjectNameA; - const wchar_t *ObjectNameW; - D3D12_DRED_ALLOCATION_TYPE AllocationType; - const struct D3D12_DRED_ALLOCATION_NODE1 *pNext; - const IUnknown *pObject; - } D3D12_DRED_ALLOCATION_NODE1; - -typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT - { - _Out_ const D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; - } D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT; - -typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 - { - _Out_ const D3D12_AUTO_BREADCRUMB_NODE1 *pHeadAutoBreadcrumbNode; - } D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1; - -typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT - { - D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; - _Out_ const D3D12_DRED_ALLOCATION_NODE *pHeadExistingAllocationNode; - _Out_ const D3D12_DRED_ALLOCATION_NODE *pHeadRecentFreedAllocationNode; - } D3D12_DRED_PAGE_FAULT_OUTPUT; - -typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT1 - { - D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; - _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; - _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; - } D3D12_DRED_PAGE_FAULT_OUTPUT1; -typedef -enum D3D12_DRED_PAGE_FAULT_FLAGS - { - D3D12_DRED_PAGE_FAULT_FLAGS_NONE = 0 - } D3D12_DRED_PAGE_FAULT_FLAGS; +#define ID3D12Device7_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) -DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_PAGE_FAULT_FLAGS ); -typedef -enum D3D12_DRED_DEVICE_STATE - { - D3D12_DRED_DEVICE_STATE_UNKNOWN = 0, - D3D12_DRED_DEVICE_STATE_HUNG = 3, - D3D12_DRED_DEVICE_STATE_FAULT = 6, - D3D12_DRED_DEVICE_STATE_PAGEFAULT = 7 - } D3D12_DRED_DEVICE_STATE; -typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT2 - { - D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; - _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; - _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; - D3D12_DRED_PAGE_FAULT_FLAGS PageFaultFlags; - } D3D12_DRED_PAGE_FAULT_OUTPUT2; +#define ID3D12Device7_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) -typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA1 - { - HRESULT DeviceRemovedReason; - D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT AutoBreadcrumbsOutput; - D3D12_DRED_PAGE_FAULT_OUTPUT PageFaultOutput; - } D3D12_DEVICE_REMOVED_EXTENDED_DATA1; +#define ID3D12Device7_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) -typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA2 - { - HRESULT DeviceRemovedReason; - D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; - D3D12_DRED_PAGE_FAULT_OUTPUT1 PageFaultOutput; - } D3D12_DEVICE_REMOVED_EXTENDED_DATA2; +#endif /* COBJMACROS */ -typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA3 - { - HRESULT DeviceRemovedReason; - D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; - D3D12_DRED_PAGE_FAULT_OUTPUT2 PageFaultOutput; - D3D12_DRED_DEVICE_STATE DeviceState; - } D3D12_DEVICE_REMOVED_EXTENDED_DATA3; -typedef struct D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA - { - D3D12_DRED_VERSION Version; - union - { - D3D12_DEVICE_REMOVED_EXTENDED_DATA Dred_1_0; - D3D12_DEVICE_REMOVED_EXTENDED_DATA1 Dred_1_1; - D3D12_DEVICE_REMOVED_EXTENDED_DATA2 Dred_1_2; - D3D12_DEVICE_REMOVED_EXTENDED_DATA3 Dred_1_3; - } ; - } D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA; +#endif /* C style interface */ -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0035_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0035_v0_0_s_ifspec; -#ifndef __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ -#define __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ +#endif /* __ID3D12Device7_INTERFACE_DEFINED__ */ -/* interface ID3D12DeviceRemovedExtendedDataSettings */ + +#ifndef __ID3D12Device8_INTERFACE_DEFINED__ +#define __ID3D12Device8_INTERFACE_DEFINED__ + +/* interface ID3D12Device8 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings; +EXTERN_C const IID IID_ID3D12Device8; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("82BC481C-6B9B-4030-AEDB-7EE3D1DF1E63") - ID3D12DeviceRemovedExtendedDataSettings : public IUnknown + MIDL_INTERFACE("9218E6BB-F944-4F7E-A75C-B1B2C7B701F3") + ID3D12Device8 : public ID3D12Device7 { public: - virtual void STDMETHODCALLTYPE SetAutoBreadcrumbsEnablement( - D3D12_DRED_ENABLEMENT Enablement) = 0; +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo2( + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#else + virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo2( + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource2( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource1( + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual void STDMETHODCALLTYPE CreateSamplerFeedbackUnorderedAccessView( + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE GetCopyableFootprints1( + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device8Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device8 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device8 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device8 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device8 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device8 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device8 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device8 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device8 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device8 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device8 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device8 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device8 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device8 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - virtual void STDMETHODCALLTYPE SetPageFaultEnablement( - D3D12_DRED_ENABLEMENT Enablement) = 0; + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - virtual void STDMETHODCALLTYPE SetWatsonDumpEnablement( - D3D12_DRED_ENABLEMENT Enablement) = 0; + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device8 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - }; - - -#else /* C style interface */ - - typedef struct ID3D12DeviceRemovedExtendedDataSettingsVtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device8 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12DeviceRemovedExtendedDataSettings * This, + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device8 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device8 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device8 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device8 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_DESC *pDesc, REFIID riid, - _COM_Outptr_ void **ppvObject); + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12DeviceRemovedExtendedDataSettings * This); + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device8 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12DeviceRemovedExtendedDataSettings * This); + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) - void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( - ID3D12DeviceRemovedExtendedDataSettings * This, - D3D12_DRED_ENABLEMENT Enablement); + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device8 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) - void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( - ID3D12DeviceRemovedExtendedDataSettings * This, - D3D12_DRED_ENABLEMENT Enablement); + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device8 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) - void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( - ID3D12DeviceRemovedExtendedDataSettings * This, - D3D12_DRED_ENABLEMENT Enablement); + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device8 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); - END_INTERFACE - } ID3D12DeviceRemovedExtendedDataSettingsVtbl; - - interface ID3D12DeviceRemovedExtendedDataSettings - { - CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettingsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D12DeviceRemovedExtendedDataSettings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D12DeviceRemovedExtendedDataSettings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D12DeviceRemovedExtendedDataSettings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D12DeviceRemovedExtendedDataSettings_SetAutoBreadcrumbsEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) - -#define ID3D12DeviceRemovedExtendedDataSettings_SetPageFaultEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) - -#define ID3D12DeviceRemovedExtendedDataSettings_SetWatsonDumpEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ */ - - -#ifndef __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ -#define __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ - -/* interface ID3D12DeviceRemovedExtendedDataSettings1 */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings1; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("DBD5AE51-3317-4F0A-ADF9-1D7CEDCAAE0B") - ID3D12DeviceRemovedExtendedDataSettings1 : public ID3D12DeviceRemovedExtendedDataSettings - { - public: - virtual void STDMETHODCALLTYPE SetBreadcrumbContextEnablement( - D3D12_DRED_ENABLEMENT Enablement) = 0; + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device8 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); - }; - - -#else /* C style interface */ - - typedef struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device8 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device8 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device8 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12DeviceRemovedExtendedDataSettings1 * This, + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device8 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device8 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, REFIID riid, - _COM_Outptr_ void **ppvObject); + _COM_Outptr_opt_ void **ppvCommandSignature); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12DeviceRemovedExtendedDataSettings1 * This); + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device8 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12DeviceRemovedExtendedDataSettings1 * This); + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device8 * This); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) - void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( - ID3D12DeviceRemovedExtendedDataSettings1 * This, - D3D12_DRED_ENABLEMENT Enablement); +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device8 * This, + LUID * RetVal); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) - void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( - ID3D12DeviceRemovedExtendedDataSettings1 * This, - D3D12_DRED_ENABLEMENT Enablement); +#endif - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) - void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( - ID3D12DeviceRemovedExtendedDataSettings1 * This, - D3D12_DRED_ENABLEMENT Enablement); + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device8 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement) - void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )( - ID3D12DeviceRemovedExtendedDataSettings1 * This, - D3D12_DRED_ENABLEMENT Enablement); + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device8 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); - END_INTERFACE - } ID3D12DeviceRemovedExtendedDataSettings1Vtbl; - - interface ID3D12DeviceRemovedExtendedDataSettings1 - { - CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D12DeviceRemovedExtendedDataSettings1_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D12DeviceRemovedExtendedDataSettings1_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D12DeviceRemovedExtendedDataSettings1_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D12DeviceRemovedExtendedDataSettings1_SetAutoBreadcrumbsEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) - -#define ID3D12DeviceRemovedExtendedDataSettings1_SetPageFaultEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) - -#define ID3D12DeviceRemovedExtendedDataSettings1_SetWatsonDumpEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) - - -#define ID3D12DeviceRemovedExtendedDataSettings1_SetBreadcrumbContextEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ */ - - -#ifndef __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ -#define __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ - -/* interface ID3D12DeviceRemovedExtendedDataSettings2 */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("61552388-01ab-4008-a436-83db189566ea") - ID3D12DeviceRemovedExtendedDataSettings2 : public ID3D12DeviceRemovedExtendedDataSettings1 - { - public: - virtual void STDMETHODCALLTYPE UseMarkersOnlyAutoBreadcrumbs( - BOOL MarkersOnly) = 0; + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device8 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); - }; - - -#else /* C style interface */ - - typedef struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device8 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12DeviceRemovedExtendedDataSettings2 * This, + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device8 * This, + _In_ const void *pAddress, REFIID riid, - _COM_Outptr_ void **ppvObject); + _COM_Outptr_ void **ppvHeap); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12DeviceRemovedExtendedDataSettings2 * This); + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device8 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12DeviceRemovedExtendedDataSettings2 * This); + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device8 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) - void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( - ID3D12DeviceRemovedExtendedDataSettings2 * This, - D3D12_DRED_ENABLEMENT Enablement); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) - void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( - ID3D12DeviceRemovedExtendedDataSettings2 * This, - D3D12_DRED_ENABLEMENT Enablement); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device8 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) - void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( - ID3D12DeviceRemovedExtendedDataSettings2 * This, - D3D12_DRED_ENABLEMENT Enablement); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device8 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device8 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement) - void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )( - ID3D12DeviceRemovedExtendedDataSettings2 * This, - D3D12_DRED_ENABLEMENT Enablement); +#endif - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings2, UseMarkersOnlyAutoBreadcrumbs) - void ( STDMETHODCALLTYPE *UseMarkersOnlyAutoBreadcrumbs )( - ID3D12DeviceRemovedExtendedDataSettings2 * This, - BOOL MarkersOnly); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device8 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); - END_INTERFACE - } ID3D12DeviceRemovedExtendedDataSettings2Vtbl; - - interface ID3D12DeviceRemovedExtendedDataSettings2 - { - CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D12DeviceRemovedExtendedDataSettings2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D12DeviceRemovedExtendedDataSettings2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D12DeviceRemovedExtendedDataSettings2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D12DeviceRemovedExtendedDataSettings2_SetAutoBreadcrumbsEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) - -#define ID3D12DeviceRemovedExtendedDataSettings2_SetPageFaultEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) - -#define ID3D12DeviceRemovedExtendedDataSettings2_SetWatsonDumpEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) - - -#define ID3D12DeviceRemovedExtendedDataSettings2_SetBreadcrumbContextEnablement(This,Enablement) \ - ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) ) - - -#define ID3D12DeviceRemovedExtendedDataSettings2_UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) \ - ( (This)->lpVtbl -> UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ */ - - -#ifndef __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ -#define __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ - -/* interface ID3D12DeviceRemovedExtendedData */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("98931D33-5AE8-4791-AA3C-1A73A2934E71") - ID3D12DeviceRemovedExtendedData : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput( - _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput) = 0; + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device8 * This); - virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput( - _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput) = 0; + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device8 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); - }; - - -#else /* C style interface */ - - typedef struct ID3D12DeviceRemovedExtendedDataVtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device8 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12DeviceRemovedExtendedData * This, + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device8 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12DeviceRemovedExtendedData * This); + _COM_Outptr_ void **ppMetaCommand); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12DeviceRemovedExtendedData * This); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device8 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) - HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( - ID3D12DeviceRemovedExtendedData * This, - _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device8 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) - HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( - ID3D12DeviceRemovedExtendedData * This, - _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device8 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); - END_INTERFACE - } ID3D12DeviceRemovedExtendedDataVtbl; - - interface ID3D12DeviceRemovedExtendedData - { - CONST_VTBL struct ID3D12DeviceRemovedExtendedDataVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D12DeviceRemovedExtendedData_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D12DeviceRemovedExtendedData_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D12DeviceRemovedExtendedData_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D12DeviceRemovedExtendedData_GetAutoBreadcrumbsOutput(This,pOutput) \ - ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) - -#define ID3D12DeviceRemovedExtendedData_GetPageFaultAllocationOutput(This,pOutput) \ - ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ */ - - -#ifndef __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ -#define __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ - -/* interface ID3D12DeviceRemovedExtendedData1 */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData1; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9727A022-CF1D-4DDA-9EBA-EFFA653FC506") - ID3D12DeviceRemovedExtendedData1 : public ID3D12DeviceRemovedExtendedData - { - public: - virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput1( - _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput) = 0; + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device8 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); - virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput1( - _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput) = 0; + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device8 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); - }; - - -#else /* C style interface */ - - typedef struct ID3D12DeviceRemovedExtendedData1Vtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device8 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12DeviceRemovedExtendedData1 * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device8 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12DeviceRemovedExtendedData1 * This); +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device8 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12DeviceRemovedExtendedData1 * This); +#endif - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) - HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( - ID3D12DeviceRemovedExtendedData1 * This, - _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) - HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( - ID3D12DeviceRemovedExtendedData1 * This, - _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device8 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1) - HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )( - ID3D12DeviceRemovedExtendedData1 * This, - _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput); + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1) - HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )( - ID3D12DeviceRemovedExtendedData1 * This, - _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput); + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); END_INTERFACE - } ID3D12DeviceRemovedExtendedData1Vtbl; + } ID3D12Device8Vtbl; - interface ID3D12DeviceRemovedExtendedData1 + interface ID3D12Device8 { - CONST_VTBL struct ID3D12DeviceRemovedExtendedData1Vtbl *lpVtbl; + CONST_VTBL struct ID3D12Device8Vtbl *lpVtbl; }; @@ -15502,755 +19075,409 @@ EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData1; #ifdef COBJMACROS -#define ID3D12DeviceRemovedExtendedData1_QueryInterface(This,riid,ppvObject) \ +#define ID3D12Device8_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12DeviceRemovedExtendedData1_AddRef(This) \ +#define ID3D12Device8_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12DeviceRemovedExtendedData1_Release(This) \ +#define ID3D12Device8_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput(This,pOutput) \ - ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) - -#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput(This,pOutput) \ - ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) - - -#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput1(This,pOutput) \ - ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) ) - -#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput1(This,pOutput) \ - ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - +#define ID3D12Device8_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) +#define ID3D12Device8_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#endif /* __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ */ +#define ID3D12Device8_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) +#define ID3D12Device8_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) -#ifndef __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ -#define __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ -/* interface ID3D12DeviceRemovedExtendedData2 */ -/* [unique][local][object][uuid] */ +#define ID3D12Device8_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) +#define ID3D12Device8_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) -EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData2; +#define ID3D12Device8_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("67FC5816-E4CA-4915-BF18-42541272DA54") - ID3D12DeviceRemovedExtendedData2 : public ID3D12DeviceRemovedExtendedData1 - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput2( - _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput) = 0; - - virtual D3D12_DRED_DEVICE_STATE STDMETHODCALLTYPE GetDeviceState( void) = 0; - - }; - - -#else /* C style interface */ +#define ID3D12Device8_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) - typedef struct ID3D12DeviceRemovedExtendedData2Vtbl - { - BEGIN_INTERFACE - - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12DeviceRemovedExtendedData2 * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12DeviceRemovedExtendedData2 * This); - - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12DeviceRemovedExtendedData2 * This); - - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) - HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( - ID3D12DeviceRemovedExtendedData2 * This, - _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); - - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) - HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( - ID3D12DeviceRemovedExtendedData2 * This, - _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); - - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1) - HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )( - ID3D12DeviceRemovedExtendedData2 * This, - _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput); - - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1) - HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )( - ID3D12DeviceRemovedExtendedData2 * This, - _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput); - - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetPageFaultAllocationOutput2) - HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput2 )( - ID3D12DeviceRemovedExtendedData2 * This, - _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput); - - DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetDeviceState) - D3D12_DRED_DEVICE_STATE ( STDMETHODCALLTYPE *GetDeviceState )( - ID3D12DeviceRemovedExtendedData2 * This); - - END_INTERFACE - } ID3D12DeviceRemovedExtendedData2Vtbl; +#define ID3D12Device8_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) - interface ID3D12DeviceRemovedExtendedData2 - { - CONST_VTBL struct ID3D12DeviceRemovedExtendedData2Vtbl *lpVtbl; - }; +#define ID3D12Device8_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) - +#define ID3D12Device8_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) -#ifdef COBJMACROS +#define ID3D12Device8_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) +#define ID3D12Device8_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) -#define ID3D12DeviceRemovedExtendedData2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) +#define ID3D12Device8_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) -#define ID3D12DeviceRemovedExtendedData2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) +#define ID3D12Device8_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) -#define ID3D12DeviceRemovedExtendedData2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) +#define ID3D12Device8_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) +#define ID3D12Device8_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) -#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput(This,pOutput) \ - ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) +#define ID3D12Device8_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput(This,pOutput) \ - ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) +#define ID3D12Device8_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) +#define ID3D12Device8_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) -#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput1(This,pOutput) \ - ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) ) +#define ID3D12Device8_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) -#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput1(This,pOutput) \ - ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) ) +#define ID3D12Device8_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) +#define ID3D12Device8_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device8_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) -#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput2(This,pOutput) \ - ( (This)->lpVtbl -> GetPageFaultAllocationOutput2(This,pOutput) ) +#define ID3D12Device8_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device8_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif -#define ID3D12DeviceRemovedExtendedData2_GetDeviceState(This) \ - ( (This)->lpVtbl -> GetDeviceState(This) ) +#define ID3D12Device8_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) -#endif /* COBJMACROS */ +#define ID3D12Device8_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) +#define ID3D12Device8_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#endif /* C style interface */ +#define ID3D12Device8_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) +#define ID3D12Device8_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) +#define ID3D12Device8_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) +#define ID3D12Device8_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) -#endif /* __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ */ +#define ID3D12Device8_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) +#define ID3D12Device8_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) -/* interface __MIDL_itf_d3d12_0000_0041 */ -/* [local] */ +#define ID3D12Device8_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) -typedef -enum D3D12_BACKGROUND_PROCESSING_MODE - { - D3D12_BACKGROUND_PROCESSING_MODE_ALLOWED = 0, - D3D12_BACKGROUND_PROCESSING_MODE_ALLOW_INTRUSIVE_MEASUREMENTS = ( D3D12_BACKGROUND_PROCESSING_MODE_ALLOWED + 1 ) , - D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_BACKGROUND_WORK = ( D3D12_BACKGROUND_PROCESSING_MODE_ALLOW_INTRUSIVE_MEASUREMENTS + 1 ) , - D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_PROFILING_BY_SYSTEM = ( D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_BACKGROUND_WORK + 1 ) - } D3D12_BACKGROUND_PROCESSING_MODE; +#define ID3D12Device8_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) -typedef -enum D3D12_MEASUREMENTS_ACTION - { - D3D12_MEASUREMENTS_ACTION_KEEP_ALL = 0, - D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS = ( D3D12_MEASUREMENTS_ACTION_KEEP_ALL + 1 ) , - D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS_HIGH_PRIORITY = ( D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS + 1 ) , - D3D12_MEASUREMENTS_ACTION_DISCARD_PREVIOUS = ( D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS_HIGH_PRIORITY + 1 ) - } D3D12_MEASUREMENTS_ACTION; +#define ID3D12Device8_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) +#define ID3D12Device8_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) +#define ID3D12Device8_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_s_ifspec; +#define ID3D12Device8_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) -#ifndef __ID3D12Device6_INTERFACE_DEFINED__ -#define __ID3D12Device6_INTERFACE_DEFINED__ +#define ID3D12Device8_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) -/* interface ID3D12Device6 */ -/* [unique][local][object][uuid] */ +#define ID3D12Device8_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device8_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif -EXTERN_C const IID IID_ID3D12Device6; +#define ID3D12Device8_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c70b221b-40e4-4a17-89af-025a0727a6dc") - ID3D12Device6 : public ID3D12Device5 - { - public: - virtual HRESULT STDMETHODCALLTYPE SetBackgroundProcessingMode( - D3D12_BACKGROUND_PROCESSING_MODE Mode, - D3D12_MEASUREMENTS_ACTION MeasurementsAction, - _In_opt_ HANDLE hEventToSignalUponCompletion, - _Out_opt_ BOOL *pbFurtherMeasurementsDesired) = 0; - - }; - - -#else /* C style interface */ +#define ID3D12Device8_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) - typedef struct ID3D12Device6Vtbl - { - BEGIN_INTERFACE - - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Device6 * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Device6 * This); - - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Device6 * This); - - DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Device6 * This, - _In_ REFGUID guid, - _Inout_ UINT *pDataSize, - _Out_writes_bytes_opt_( *pDataSize ) void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Device6 * This, - _In_ REFGUID guid, - _In_ UINT DataSize, - _In_reads_bytes_opt_( DataSize ) const void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Device6 * This, - _In_ REFGUID guid, - _In_opt_ const IUnknown *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetName) - HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Device6 * This, - _In_z_ LPCWSTR Name); - - DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) - UINT ( STDMETHODCALLTYPE *GetNodeCount )( - ID3D12Device6 * This); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) - HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( - ID3D12Device6 * This, - _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppCommandQueue); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) - HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( - ID3D12Device6 * This, - _In_ D3D12_COMMAND_LIST_TYPE type, - REFIID riid, - _COM_Outptr_ void **ppCommandAllocator); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) - HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( - ID3D12Device6 * This, - _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) - HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( - ID3D12Device6 * This, - _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) - HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( - ID3D12Device6 * This, - _In_ UINT nodeMask, - _In_ D3D12_COMMAND_LIST_TYPE type, - _In_ ID3D12CommandAllocator *pCommandAllocator, - _In_opt_ ID3D12PipelineState *pInitialState, - REFIID riid, - _COM_Outptr_ void **ppCommandList); - - DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) - HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( - ID3D12Device6 * This, - D3D12_FEATURE Feature, - _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, - UINT FeatureSupportDataSize); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) - HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( - ID3D12Device6 * This, - _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, - REFIID riid, - _COM_Outptr_ void **ppvHeap); - - DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) - UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( - ID3D12Device6 * This, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) - HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( - ID3D12Device6 * This, - _In_ UINT nodeMask, - _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, - _In_ SIZE_T blobLengthInBytes, - REFIID riid, - _COM_Outptr_ void **ppvRootSignature); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) - void ( STDMETHODCALLTYPE *CreateConstantBufferView )( - ID3D12Device6 * This, - _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) - void ( STDMETHODCALLTYPE *CreateShaderResourceView )( - ID3D12Device6 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) - void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( - ID3D12Device6 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ ID3D12Resource *pCounterResource, - _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) - void ( STDMETHODCALLTYPE *CreateRenderTargetView )( - ID3D12Device6 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) - void ( STDMETHODCALLTYPE *CreateDepthStencilView )( - ID3D12Device6 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) - void ( STDMETHODCALLTYPE *CreateSampler )( - ID3D12Device6 * This, - _In_ const D3D12_SAMPLER_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - - DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) - void ( STDMETHODCALLTYPE *CopyDescriptors )( - ID3D12Device6 * This, - _In_ UINT NumDestDescriptorRanges, - _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, - _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, - _In_ UINT NumSrcDescriptorRanges, - _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, - _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); - - DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) - void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( - ID3D12Device6 * This, - _In_ UINT NumDescriptors, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); - - DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#define ID3D12Device8_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device8_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device8_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device8_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device8_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device8_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device8_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device8_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device8_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device8_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) #if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device6 * This, - _In_ UINT visibleMask, - _In_ UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); - + +#define ID3D12Device8_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device6 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - _In_ UINT visibleMask, - _In_ UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); - +#define ID3D12Device8_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif - - DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) + + +#define ID3D12Device8_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device8_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device8_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device8_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device8_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device8_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device8_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device8_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device8_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device8_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device8_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + #if !defined(_WIN32) - D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device6 * This, - _In_ UINT nodeMask, - D3D12_HEAP_TYPE heapType); - + +#define ID3D12Device8_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else - D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device6 * This, - D3D12_HEAP_PROPERTIES * RetVal, - _In_ UINT nodeMask, - D3D12_HEAP_TYPE heapType); - +#define ID3D12Device8_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif - - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( - ID3D12Device6 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) - HRESULT ( STDMETHODCALLTYPE *CreateHeap )( - ID3D12Device6 * This, - _In_ const D3D12_HEAP_DESC *pDesc, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); - - DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) - HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( - ID3D12Device6 * This, - _In_ ID3D12Heap *pHeap, - UINT64 HeapOffset, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) - HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( - ID3D12Device6 * This, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) - HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( - ID3D12Device6 * This, - _In_ ID3D12DeviceChild *pObject, - _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, - DWORD Access, - _In_opt_ LPCWSTR Name, - _Out_ HANDLE *pHandle); - - DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) - HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( - ID3D12Device6 * This, - _In_ HANDLE NTHandle, - REFIID riid, - _COM_Outptr_opt_ void **ppvObj); - - DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) - HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( - ID3D12Device6 * This, - _In_ LPCWSTR Name, - DWORD Access, - /* [annotation][out] */ - _Out_ HANDLE *pNTHandle); - - DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) - HRESULT ( STDMETHODCALLTYPE *MakeResident )( - ID3D12Device6 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); - - DECLSPEC_XFGVIRT(ID3D12Device, Evict) - HRESULT ( STDMETHODCALLTYPE *Evict )( - ID3D12Device6 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) - HRESULT ( STDMETHODCALLTYPE *CreateFence )( - ID3D12Device6 * This, - UINT64 InitialValue, - D3D12_FENCE_FLAGS Flags, - REFIID riid, - _COM_Outptr_ void **ppFence); - - DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) - HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( - ID3D12Device6 * This); - - DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) - void ( STDMETHODCALLTYPE *GetCopyableFootprints )( - ID3D12Device6 * This, - _In_ const D3D12_RESOURCE_DESC *pResourceDesc, - _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, - _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, - UINT64 BaseOffset, - _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, - _Out_writes_opt_(NumSubresources) UINT *pNumRows, - _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, - _Out_opt_ UINT64 *pTotalBytes); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) - HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( - ID3D12Device6 * This, - _In_ const D3D12_QUERY_HEAP_DESC *pDesc, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); - - DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) - HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( - ID3D12Device6 * This, - BOOL Enable); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) - HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( - ID3D12Device6 * This, - _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, - _In_opt_ ID3D12RootSignature *pRootSignature, + +#define ID3D12Device8_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device8_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device8_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device8_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device8_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Resource1_INTERFACE_DEFINED__ +#define __ID3D12Resource1_INTERFACE_DEFINED__ + +/* interface ID3D12Resource1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Resource1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9D5E227A-4430-4161-88B3-3ECA6BB16E19") + ID3D12Resource1 : public ID3D12Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( REFIID riid, - _COM_Outptr_opt_ void **ppvCommandSignature); - - DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) - void ( STDMETHODCALLTYPE *GetResourceTiling )( - ID3D12Device6 * This, - _In_ ID3D12Resource *pTiledResource, - _Out_opt_ UINT *pNumTilesForEntireResource, - _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, - _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, - _Inout_opt_ UINT *pNumSubresourceTilings, - _In_ UINT FirstSubresourceTilingToGet, - _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); - - DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) -#if !defined(_WIN32) - LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device6 * This); - -#else - LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device6 * This, - LUID * RetVal); + _COM_Outptr_opt_ void **ppProtectedSession) = 0; -#endif + }; + + +#else /* C style interface */ + + typedef struct ID3D12Resource1Vtbl + { + BEGIN_INTERFACE - DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) - HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( - ID3D12Device6 * This, - _In_reads_(BlobLength) const void *pLibraryBlob, - SIZE_T BlobLength, + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Resource1 * This, REFIID riid, - _COM_Outptr_ void **ppPipelineLibrary); + _COM_Outptr_ void **ppvObject); - DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) - HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( - ID3D12Device6 * This, - _In_reads_(NumFences) ID3D12Fence *const *ppFences, - _In_reads_(NumFences) const UINT64 *pFenceValues, - UINT NumFences, - D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, - HANDLE hEvent); + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Resource1 * This); - DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) - HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( - ID3D12Device6 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, - _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Resource1 * This); - DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) - HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( - ID3D12Device6 * This, - const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Resource1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); - DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) - HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( - ID3D12Device6 * This, - _In_ const void *pAddress, - REFIID riid, - _COM_Outptr_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Resource1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); - DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) - HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( - ID3D12Device6 * This, - _In_ HANDLE hFileMapping, - REFIID riid, - _COM_Outptr_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Resource1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); - DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) - HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( - ID3D12Device6 * This, - D3D12_RESIDENCY_FLAGS Flags, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, - _In_ ID3D12Fence *pFenceToSignal, - UINT64 FenceValueToSignal); + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Resource1 * This, + _In_z_ LPCWSTR Name); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) - HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( - ID3D12Device6 * This, - _In_ UINT nodeMask, - _In_ D3D12_COMMAND_LIST_TYPE type, - _In_ D3D12_COMMAND_LIST_FLAGS flags, + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Resource1 * This, REFIID riid, - _COM_Outptr_ void **ppCommandList); - - DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) - HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( - ID3D12Device6 * This, - _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, - _In_ REFIID riid, - _COM_Outptr_ void **ppSession); - - DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( - ID3D12Device6 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); + _COM_Outptr_opt_ void **ppvDevice); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) - HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( - ID3D12Device6 * This, - _In_ const D3D12_HEAP_DESC *pDesc, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12Resource, Map) + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D12Resource1 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) - HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( - ID3D12Device6 * This, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) + void ( STDMETHODCALLTYPE *Unmap )( + ID3D12Resource1 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange); - DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) + DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) #if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device6 * This, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource1 * This); #else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device6 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource1 * This, + D3D12_RESOURCE_DESC * RetVal); #endif - DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) - HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( - ID3D12Device6 * This, - _In_ ID3D12LifetimeOwner *pOwner, - REFIID riid, - _COM_Outptr_ void **ppvTracker); - - DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) - void ( STDMETHODCALLTYPE *RemoveDevice )( - ID3D12Device6 * This); - - DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) - HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( - ID3D12Device6 * This, - _Inout_ UINT *pNumMetaCommands, - _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); - - DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) - HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( - ID3D12Device6 * This, - _In_ REFGUID CommandId, - _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, - _Out_opt_ UINT *pTotalStructureSizeInBytes, - _Inout_ UINT *pParameterCount, - _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); - - DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) - HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( - ID3D12Device6 * This, - _In_ REFGUID CommandId, - _In_ UINT NodeMask, - _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, - _In_ SIZE_T CreationParametersDataSizeInBytes, - REFIID riid, - _COM_Outptr_ void **ppMetaCommand); + DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) + D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( + ID3D12Resource1 * This); - DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) - HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( - ID3D12Device6 * This, - const D3D12_STATE_OBJECT_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppStateObject); + DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) + HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( + ID3D12Resource1 * This, + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch); - DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) - void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( - ID3D12Device6 * This, - _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, - _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) + HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( + ID3D12Resource1 * This, + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox); - DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) - D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( - ID3D12Device6 * This, - _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, - _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) + HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( + ID3D12Resource1 * This, + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); - DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) - HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( - ID3D12Device6 * This, - D3D12_BACKGROUND_PROCESSING_MODE Mode, - D3D12_MEASUREMENTS_ACTION MeasurementsAction, - _In_opt_ HANDLE hEventToSignalUponCompletion, - _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12Resource1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); END_INTERFACE - } ID3D12Device6Vtbl; + } ID3D12Resource1Vtbl; - interface ID3D12Device6 + interface ID3D12Resource1 { - CONST_VTBL struct ID3D12Device6Vtbl *lpVtbl; + CONST_VTBL struct ID3D12Resource1Vtbl *lpVtbl; }; @@ -16258,232 +19485,302 @@ EXTERN_C const IID IID_ID3D12Device6; #ifdef COBJMACROS -#define ID3D12Device6_QueryInterface(This,riid,ppvObject) \ +#define ID3D12Resource1_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device6_AddRef(This) \ +#define ID3D12Resource1_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Device6_Release(This) \ +#define ID3D12Resource1_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Device6_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12Resource1_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12Device6_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12Resource1_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12Device6_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12Resource1_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12Device6_SetName(This,Name) \ +#define ID3D12Resource1_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12Device6_GetNodeCount(This) \ - ( (This)->lpVtbl -> GetNodeCount(This) ) +#define ID3D12Resource1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12Device6_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ - ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) -#define ID3D12Device6_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ - ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) -#define ID3D12Device6_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) +#define ID3D12Resource1_Map(This,Subresource,pReadRange,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) -#define ID3D12Device6_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) +#define ID3D12Resource1_Unmap(This,Subresource,pWrittenRange) \ + ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) +#if !defined(_WIN32) -#define ID3D12Device6_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ - ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) +#define ID3D12Resource1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Resource1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif -#define ID3D12Device6_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ - ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) +#define ID3D12Resource1_GetGPUVirtualAddress(This) \ + ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) -#define ID3D12Device6_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) +#define ID3D12Resource1_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) -#define ID3D12Device6_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ - ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) +#define ID3D12Resource1_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) -#define ID3D12Device6_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ - ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) +#define ID3D12Resource1_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ + ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) -#define ID3D12Device6_CreateConstantBufferView(This,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) -#define ID3D12Device6_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) +#define ID3D12Resource1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) -#define ID3D12Device6_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) +#endif /* COBJMACROS */ -#define ID3D12Device6_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device6_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) +#endif /* C style interface */ -#define ID3D12Device6_CreateSampler(This,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) -#define ID3D12Device6_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ - ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) -#define ID3D12Device6_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ - ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) -#if !defined(_WIN32) -#define ID3D12Device6_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#endif /* __ID3D12Resource1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Resource2_INTERFACE_DEFINED__ +#define __ID3D12Resource2_INTERFACE_DEFINED__ + +/* interface ID3D12Resource2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Resource2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("BE36EC3B-EA85-4AEB-A45A-E9D76404A495") + ID3D12Resource2 : public ID3D12Resource1 + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0; #else -#define ID3D12Device6_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) + virtual D3D12_RESOURCE_DESC1 *STDMETHODCALLTYPE GetDesc1( + D3D12_RESOURCE_DESC1 * RetVal) = 0; #endif -#if !defined(_WIN32) + + }; + + +#else /* C style interface */ -#define ID3D12Device6_GetCustomHeapProperties(This,nodeMask,heapType) \ - ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) + typedef struct ID3D12Resource2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Resource2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Resource2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Resource2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Resource2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Resource2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Resource2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Resource2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Resource2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Resource, Map) + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D12Resource2 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); + + DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) + void ( STDMETHODCALLTYPE *Unmap )( + ID3D12Resource2 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource2 * This); + #else -#define ID3D12Device6_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ - ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) + D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource2 * This, + D3D12_RESOURCE_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) + D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( + ID3D12Resource2 * This); + + DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) + HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( + ID3D12Resource2 * This, + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch); + + DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) + HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( + ID3D12Resource2 * This, + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) + HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( + ID3D12Resource2 * This, + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); + + DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12Resource2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + DECLSPEC_XFGVIRT(ID3D12Resource2, GetDesc1) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12Resource2 * This); + +#else + D3D12_RESOURCE_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12Resource2 * This, + D3D12_RESOURCE_DESC1 * RetVal); + #endif + + END_INTERFACE + } ID3D12Resource2Vtbl; -#define ID3D12Device6_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + interface ID3D12Resource2 + { + CONST_VTBL struct ID3D12Resource2Vtbl *lpVtbl; + }; -#define ID3D12Device6_CreateHeap(This,pDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + -#define ID3D12Device6_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) +#ifdef COBJMACROS -#define ID3D12Device6_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device6_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ - ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) +#define ID3D12Resource2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device6_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ - ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) +#define ID3D12Resource2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Device6_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ - ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) +#define ID3D12Resource2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Device6_MakeResident(This,NumObjects,ppObjects) \ - ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) -#define ID3D12Device6_Evict(This,NumObjects,ppObjects) \ - ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) +#define ID3D12Resource2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12Device6_CreateFence(This,InitialValue,Flags,riid,ppFence) \ - ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) +#define ID3D12Resource2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12Device6_GetDeviceRemovedReason(This) \ - ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) +#define ID3D12Resource2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12Device6_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ - ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) +#define ID3D12Resource2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12Device6_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12Device6_SetStablePowerState(This,Enable) \ - ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) +#define ID3D12Resource2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12Device6_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ - ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) -#define ID3D12Device6_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ - ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) + +#define ID3D12Resource2_Map(This,Subresource,pReadRange,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) + +#define ID3D12Resource2_Unmap(This,Subresource,pWrittenRange) \ + ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) #if !defined(_WIN32) -#define ID3D12Device6_GetAdapterLuid(This) \ - ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#define ID3D12Resource2_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) #else -#define ID3D12Device6_GetAdapterLuid(This,RetVal) \ - ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#define ID3D12Resource2_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) #endif +#define ID3D12Resource2_GetGPUVirtualAddress(This) \ + ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) -#define ID3D12Device6_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ - ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) - -#define ID3D12Device6_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ - ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) - -#define ID3D12Device6_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ - ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) - - -#define ID3D12Device6_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) - - -#define ID3D12Device6_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ - ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) - -#define ID3D12Device6_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ - ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) - -#define ID3D12Device6_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ - ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) - +#define ID3D12Resource2_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) -#define ID3D12Device6_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ - ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) +#define ID3D12Resource2_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) -#define ID3D12Device6_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ - ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) +#define ID3D12Resource2_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ + ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) -#define ID3D12Device6_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -#define ID3D12Device6_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) +#define ID3D12Resource2_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) -#define ID3D12Device6_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ - ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) #if !defined(_WIN32) -#define ID3D12Device6_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#define ID3D12Resource2_GetDesc1(This) \ + ( (This)->lpVtbl -> GetDesc1(This) ) #else -#define ID3D12Device6_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#define ID3D12Resource2_GetDesc1(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc1(This,RetVal) ) #endif - -#define ID3D12Device6_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ - ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) - -#define ID3D12Device6_RemoveDevice(This) \ - ( (This)->lpVtbl -> RemoveDevice(This) ) - -#define ID3D12Device6_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ - ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) - -#define ID3D12Device6_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ - ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) - -#define ID3D12Device6_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ - ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) - -#define ID3D12Device6_CreateStateObject(This,pDesc,riid,ppStateObject) \ - ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) - -#define ID3D12Device6_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ - ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) - -#define ID3D12Device6_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ - ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) - - -#define ID3D12Device6_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ - ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) - #endif /* COBJMACROS */ @@ -16492,154 +19789,106 @@ EXTERN_C const IID IID_ID3D12Device6; -#endif /* __ID3D12Device6_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_d3d12_0000_0042 */ -/* [local] */ - -DEFINE_GUID(D3D12_PROTECTED_RESOURCES_SESSION_HARDWARE_PROTECTED, 0x62B0084E, 0xC70E, 0x4DAA, 0xA1, 0x09, 0x30, 0xFF, 0x8D, 0x5A, 0x04, 0x82); -typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT - { - UINT NodeIndex; - UINT Count; - } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT; - -typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES - { - UINT NodeIndex; - UINT Count; - GUID *pTypes; - } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES; - -typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC1 - { - UINT NodeMask; - D3D12_PROTECTED_RESOURCE_SESSION_FLAGS Flags; - GUID ProtectionType; - } D3D12_PROTECTED_RESOURCE_SESSION_DESC1; - - +#endif /* __ID3D12Resource2_INTERFACE_DEFINED__ */ -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_s_ifspec; -#ifndef __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ -#define __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ +#ifndef __ID3D12Heap1_INTERFACE_DEFINED__ +#define __ID3D12Heap1_INTERFACE_DEFINED__ -/* interface ID3D12ProtectedResourceSession1 */ +/* interface ID3D12Heap1 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12ProtectedResourceSession1; +EXTERN_C const IID IID_ID3D12Heap1; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("D6F12DD6-76FB-406E-8961-4296EEFC0409") - ID3D12ProtectedResourceSession1 : public ID3D12ProtectedResourceSession + MIDL_INTERFACE("572F7389-2168-49E3-9693-D6DF5871BF6D") + ID3D12Heap1 : public ID3D12Heap { public: -#if defined(_MSC_VER) || !defined(_WIN32) - virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0; -#else - virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *STDMETHODCALLTYPE GetDesc1( - D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal) = 0; -#endif + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; }; #else /* C style interface */ - typedef struct ID3D12ProtectedResourceSession1Vtbl + typedef struct ID3D12Heap1Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12ProtectedResourceSession1 * This, + ID3D12Heap1 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12ProtectedResourceSession1 * This); + ID3D12Heap1 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12ProtectedResourceSession1 * This); + ID3D12Heap1 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12ProtectedResourceSession1 * This, + ID3D12Heap1 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12ProtectedResourceSession1 * This, + ID3D12Heap1 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12ProtectedResourceSession1 * This, + ID3D12Heap1 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12ProtectedResourceSession1 * This, + ID3D12Heap1 * This, _In_z_ LPCWSTR Name); DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12ProtectedResourceSession1 * This, + ID3D12Heap1 * This, REFIID riid, _COM_Outptr_opt_ void **ppvDevice); - DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence) - HRESULT ( STDMETHODCALLTYPE *GetStatusFence )( - ID3D12ProtectedResourceSession1 * This, - REFIID riid, - _COM_Outptr_opt_ void **ppFence); - - DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus) - D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )( - ID3D12ProtectedResourceSession1 * This); - - DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession, GetDesc) + DECLSPEC_XFGVIRT(ID3D12Heap, GetDesc) #if !defined(_WIN32) - D3D12_PROTECTED_RESOURCE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( - ID3D12ProtectedResourceSession1 * This); + D3D12_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap1 * This); #else - D3D12_PROTECTED_RESOURCE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( - ID3D12ProtectedResourceSession1 * This, - D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal); + D3D12_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap1 * This, + D3D12_HEAP_DESC * RetVal); #endif - DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession1, GetDesc1) -#if !defined(_WIN32) - D3D12_PROTECTED_RESOURCE_SESSION_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )( - ID3D12ProtectedResourceSession1 * This); - -#else - D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )( - ID3D12ProtectedResourceSession1 * This, - D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal); - -#endif + DECLSPEC_XFGVIRT(ID3D12Heap1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12Heap1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); END_INTERFACE - } ID3D12ProtectedResourceSession1Vtbl; + } ID3D12Heap1Vtbl; - interface ID3D12ProtectedResourceSession1 + interface ID3D12Heap1 { - CONST_VTBL struct ID3D12ProtectedResourceSession1Vtbl *lpVtbl; + CONST_VTBL struct ID3D12Heap1Vtbl *lpVtbl; }; @@ -16647,56 +19896,45 @@ EXTERN_C const IID IID_ID3D12ProtectedResourceSession1; #ifdef COBJMACROS -#define ID3D12ProtectedResourceSession1_QueryInterface(This,riid,ppvObject) \ +#define ID3D12Heap1_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12ProtectedResourceSession1_AddRef(This) \ +#define ID3D12Heap1_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12ProtectedResourceSession1_Release(This) \ +#define ID3D12Heap1_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12ProtectedResourceSession1_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12Heap1_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12ProtectedResourceSession1_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12Heap1_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12ProtectedResourceSession1_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12Heap1_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12ProtectedResourceSession1_SetName(This,Name) \ +#define ID3D12Heap1_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12ProtectedResourceSession1_GetDevice(This,riid,ppvDevice) \ +#define ID3D12Heap1_GetDevice(This,riid,ppvDevice) \ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12ProtectedResourceSession1_GetStatusFence(This,riid,ppFence) \ - ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) ) - -#define ID3D12ProtectedResourceSession1_GetSessionStatus(This) \ - ( (This)->lpVtbl -> GetSessionStatus(This) ) - #if !defined(_WIN32) -#define ID3D12ProtectedResourceSession1_GetDesc(This) \ +#define ID3D12Heap1_GetDesc(This) \ ( (This)->lpVtbl -> GetDesc(This) ) #else -#define ID3D12ProtectedResourceSession1_GetDesc(This,RetVal) \ +#define ID3D12Heap1_GetDesc(This,RetVal) \ ( (This)->lpVtbl -> GetDesc(This,RetVal) ) #endif -#if !defined(_WIN32) -#define ID3D12ProtectedResourceSession1_GetDesc1(This) \ - ( (This)->lpVtbl -> GetDesc1(This) ) -#else -#define ID3D12ProtectedResourceSession1_GetDesc1(This,RetVal) \ - ( (This)->lpVtbl -> GetDesc1(This,RetVal) ) -#endif +#define ID3D12Heap1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) #endif /* COBJMACROS */ @@ -16706,592 +19944,937 @@ EXTERN_C const IID IID_ID3D12ProtectedResourceSession1; -#endif /* __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ */ +#endif /* __ID3D12Heap1_INTERFACE_DEFINED__ */ -#ifndef __ID3D12Device7_INTERFACE_DEFINED__ -#define __ID3D12Device7_INTERFACE_DEFINED__ +#ifndef __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ -/* interface ID3D12Device7 */ +/* interface ID3D12GraphicsCommandList3 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12Device7; +EXTERN_C const IID IID_ID3D12GraphicsCommandList3; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("5c014b53-68a1-4b9b-8bd1-dd6046b9358b") - ID3D12Device7 : public ID3D12Device6 + MIDL_INTERFACE("6FDA83A7-B84C-4E38-9AC8-C7BD22016B3D") + ID3D12GraphicsCommandList3 : public ID3D12GraphicsCommandList2 { public: - virtual HRESULT STDMETHODCALLTYPE AddToStateObject( - const D3D12_STATE_OBJECT_DESC *pAddition, - ID3D12StateObject *pStateObjectToGrowFrom, - REFIID riid, - _COM_Outptr_ void **ppNewStateObject) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateProtectedResourceSession1( - _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, - _In_ REFIID riid, - _COM_Outptr_ void **ppSession) = 0; + virtual void STDMETHODCALLTYPE SetProtectedResourceSession( + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; }; #else /* C style interface */ - typedef struct ID3D12Device7Vtbl + typedef struct ID3D12GraphicsCommandList3Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Device7 * This, + ID3D12GraphicsCommandList3 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Device7 * This); + ID3D12GraphicsCommandList3 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Device7 * This); + ID3D12GraphicsCommandList3 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Device7 * This, + ID3D12GraphicsCommandList3 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Device7 * This, + ID3D12GraphicsCommandList3 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Device7 * This, + ID3D12GraphicsCommandList3 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Device7 * This, + ID3D12GraphicsCommandList3 * This, _In_z_ LPCWSTR Name); - DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) - UINT ( STDMETHODCALLTYPE *GetNodeCount )( - ID3D12Device7 * This); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) - HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( - ID3D12Device7 * This, - _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList3 * This, REFIID riid, - _COM_Outptr_ void **ppCommandQueue); + _COM_Outptr_opt_ void **ppvDevice); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) - HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( - ID3D12Device7 * This, - _In_ D3D12_COMMAND_LIST_TYPE type, - REFIID riid, - _COM_Outptr_ void **ppCommandAllocator); + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList3 * This); - DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) - HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( - ID3D12Device7 * This, - _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList3 * This); - DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) - HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( - ID3D12Device7 * This, - _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) - HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( - ID3D12Device7 * This, - _In_ UINT nodeMask, - _In_ D3D12_COMMAND_LIST_TYPE type, - _In_ ID3D12CommandAllocator *pCommandAllocator, - _In_opt_ ID3D12PipelineState *pInitialState, - REFIID riid, - _COM_Outptr_ void **ppCommandList); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); - DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) - HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( - ID3D12Device7 * This, - D3D12_FEATURE Feature, - _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, - UINT FeatureSupportDataSize); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); - DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) - HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( - ID3D12Device7 * This, - _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, - REFIID riid, - _COM_Outptr_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); - DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) - UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( - ID3D12Device7 * This, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); - DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) - HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( - ID3D12Device7 * This, - _In_ UINT nodeMask, - _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, - _In_ SIZE_T blobLengthInBytes, - REFIID riid, - _COM_Outptr_ void **ppvRootSignature); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); - DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) - void ( STDMETHODCALLTYPE *CreateConstantBufferView )( - ID3D12Device7 * This, - _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList3 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); - DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) - void ( STDMETHODCALLTYPE *CreateShaderResourceView )( - ID3D12Device7 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); - DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) - void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( - ID3D12Device7 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ ID3D12Resource *pCounterResource, - _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList3 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList3 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) - void ( STDMETHODCALLTYPE *CreateRenderTargetView )( - ID3D12Device7 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList3 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); - DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) - void ( STDMETHODCALLTYPE *CreateDepthStencilView )( - ID3D12Device7 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT StencilRef); - DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) - void ( STDMETHODCALLTYPE *CreateSampler )( - ID3D12Device7 * This, - _In_ const D3D12_SAMPLER_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12PipelineState *pPipelineState); - DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) - void ( STDMETHODCALLTYPE *CopyDescriptors )( - ID3D12Device7 * This, - _In_ UINT NumDestDescriptorRanges, - _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, - _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, - _In_ UINT NumSrcDescriptorRanges, - _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, - _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); - DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) - void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( - ID3D12Device7 * This, - _In_ UINT NumDescriptors, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); - DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) -#if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device7 * This, - _In_ UINT visibleMask, - _In_ UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); -#else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device7 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - _In_ UINT visibleMask, - _In_ UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); -#endif + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); - DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) -#if !defined(_WIN32) - D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device7 * This, - _In_ UINT nodeMask, - D3D12_HEAP_TYPE heapType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); -#else - D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device7 * This, - D3D12_HEAP_PROPERTIES * RetVal, - _In_ UINT nodeMask, - D3D12_HEAP_TYPE heapType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); -#endif + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( - ID3D12Device7 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); - DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) - HRESULT ( STDMETHODCALLTYPE *CreateHeap )( - ID3D12Device7 * This, - _In_ const D3D12_HEAP_DESC *pDesc, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); - DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) - HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( - ID3D12Device7 * This, - _In_ ID3D12Heap *pHeap, - UINT64 HeapOffset, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); - DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) - HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( - ID3D12Device7 * This, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) - HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( - ID3D12Device7 * This, - _In_ ID3D12DeviceChild *pObject, - _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, - DWORD Access, - _In_opt_ LPCWSTR Name, - _Out_ HANDLE *pHandle); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) - HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( - ID3D12Device7 * This, - _In_ HANDLE NTHandle, - REFIID riid, - _COM_Outptr_opt_ void **ppvObj); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) - HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( - ID3D12Device7 * This, - _In_ LPCWSTR Name, - DWORD Access, - /* [annotation][out] */ - _Out_ HANDLE *pNTHandle); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) - HRESULT ( STDMETHODCALLTYPE *MakeResident )( - ID3D12Device7 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, Evict) - HRESULT ( STDMETHODCALLTYPE *Evict )( - ID3D12Device7 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) - HRESULT ( STDMETHODCALLTYPE *CreateFence )( - ID3D12Device7 * This, - UINT64 InitialValue, - D3D12_FENCE_FLAGS Flags, - REFIID riid, - _COM_Outptr_ void **ppFence); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); - DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) - HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( - ID3D12Device7 * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); - DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) - void ( STDMETHODCALLTYPE *GetCopyableFootprints )( - ID3D12Device7 * This, - _In_ const D3D12_RESOURCE_DESC *pResourceDesc, - _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, - _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, - UINT64 BaseOffset, - _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, - _Out_writes_opt_(NumSubresources) UINT *pNumRows, - _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, - _Out_opt_ UINT64 *pTotalBytes); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); - DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) - HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( - ID3D12Device7 * This, - _In_ const D3D12_QUERY_HEAP_DESC *pDesc, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) - HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( - ID3D12Device7 * This, - BOOL Enable); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) - HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( - ID3D12Device7 * This, - _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, - _In_opt_ ID3D12RootSignature *pRootSignature, - REFIID riid, - _COM_Outptr_opt_ void **ppvCommandSignature); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) - void ( STDMETHODCALLTYPE *GetResourceTiling )( - ID3D12Device7 * This, - _In_ ID3D12Resource *pTiledResource, - _Out_opt_ UINT *pNumTilesForEntireResource, - _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, - _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, - _Inout_opt_ UINT *pNumSubresourceTilings, - _In_ UINT FirstSubresourceTilingToGet, - _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) -#if !defined(_WIN32) - LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device7 * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); -#else - LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device7 * This, - LUID * RetVal); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); -#endif + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); - DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) - HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( - ID3D12Device7 * This, - _In_reads_(BlobLength) const void *pLibraryBlob, - SIZE_T BlobLength, - REFIID riid, - _COM_Outptr_ void **ppPipelineLibrary); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); - DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) - HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( - ID3D12Device7 * This, - _In_reads_(NumFences) ID3D12Fence *const *ppFences, - _In_reads_(NumFences) const UINT64 *pFenceValues, - UINT NumFences, - D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, - HANDLE hEvent); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); - DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) - HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( - ID3D12Device7 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, - _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); - DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) - HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( - ID3D12Device7 * This, - const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); - DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) - HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( - ID3D12Device7 * This, - _In_ const void *pAddress, - REFIID riid, - _COM_Outptr_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList3 * This); - DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) - HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( - ID3D12Device7 * This, - _In_ HANDLE hFileMapping, - REFIID riid, - _COM_Outptr_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); - DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) - HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( - ID3D12Device7 * This, - D3D12_RESIDENCY_FLAGS Flags, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, - _In_ ID3D12Fence *pFenceToSignal, - UINT64 FenceValueToSignal); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) - HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( - ID3D12Device7 * This, - _In_ UINT nodeMask, - _In_ D3D12_COMMAND_LIST_TYPE type, - _In_ D3D12_COMMAND_LIST_FLAGS flags, - REFIID riid, - _COM_Outptr_ void **ppCommandList); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) - HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( - ID3D12Device7 * This, - _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, - _In_ REFIID riid, - _COM_Outptr_ void **ppSession); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList3 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( - ID3D12Device7 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) - HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( - ID3D12Device7 * This, - _In_ const D3D12_HEAP_DESC *pDesc, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT Mask); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) - HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( - ID3D12Device7 * This, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList3 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); - DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) -#if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device7 * This, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); -#else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device7 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + END_INTERFACE + } ID3D12GraphicsCommandList3Vtbl; + + interface ID3D12GraphicsCommandList3 + { + CONST_VTBL struct ID3D12GraphicsCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList3_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList3_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList3_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList3_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList3_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList3_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList3_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList3_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList3_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList3_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList3_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList3_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList3_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList3_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList3_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList3_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList3_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList3_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList3_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList3_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList3_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList3_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList3_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList3_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList3_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList3_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList3_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList3_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList3_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList3_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList3_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList3_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList3_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList3_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList3_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0051 */ +/* [local] */ + +typedef +enum D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD = 0, + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD + 1 ) , + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE + 1 ) , + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR + 1 ) , + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS + 1 ) , + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_SRV = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER + 1 ) , + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_UAV = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_SRV + 1 ) + } D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE; + +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS + { + D3D12_CLEAR_VALUE ClearValue; + } D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS + { + UINT AdditionalWidth; + UINT AdditionalHeight; + } D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE Type; + union + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS Clear; + D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS PreserveLocal; + } ; + } D3D12_RENDER_PASS_BEGINNING_ACCESS; + +typedef +enum D3D12_RENDER_PASS_ENDING_ACCESS_TYPE + { + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD = 0, + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD + 1 ) , + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE + 1 ) , + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE + 1 ) , + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS + 1 ) , + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_SRV = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER + 1 ) , + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_UAV = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_SRV + 1 ) + } D3D12_RENDER_PASS_ENDING_ACCESS_TYPE; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS + { + UINT SrcSubresource; + UINT DstSubresource; + UINT DstX; + UINT DstY; + D3D12_RECT SrcRect; + } D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS + { + ID3D12Resource *pSrcResource; + ID3D12Resource *pDstResource; + UINT SubresourceCount; + _Field_size_full_(SubresourceCount) const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS *pSubresourceParameters; + DXGI_FORMAT Format; + D3D12_RESOLVE_MODE ResolveMode; + BOOL PreserveResolveSource; + } D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS + { + UINT AdditionalWidth; + UINT AdditionalHeight; + } D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS + { + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE Type; + union + { + D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS Resolve; + D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS PreserveLocal; + } ; + } D3D12_RENDER_PASS_ENDING_ACCESS; + +typedef struct D3D12_RENDER_PASS_RENDER_TARGET_DESC + { + D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; + D3D12_RENDER_PASS_BEGINNING_ACCESS BeginningAccess; + D3D12_RENDER_PASS_ENDING_ACCESS EndingAccess; + } D3D12_RENDER_PASS_RENDER_TARGET_DESC; + +typedef struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC + { + D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; + D3D12_RENDER_PASS_BEGINNING_ACCESS DepthBeginningAccess; + D3D12_RENDER_PASS_BEGINNING_ACCESS StencilBeginningAccess; + D3D12_RENDER_PASS_ENDING_ACCESS DepthEndingAccess; + D3D12_RENDER_PASS_ENDING_ACCESS StencilEndingAccess; + } D3D12_RENDER_PASS_DEPTH_STENCIL_DESC; + +typedef +enum D3D12_RENDER_PASS_FLAGS + { + D3D12_RENDER_PASS_FLAG_NONE = 0, + D3D12_RENDER_PASS_FLAG_ALLOW_UAV_WRITES = 0x1, + D3D12_RENDER_PASS_FLAG_SUSPENDING_PASS = 0x2, + D3D12_RENDER_PASS_FLAG_RESUMING_PASS = 0x4, + D3D12_RENDER_PASS_FLAG_BIND_READ_ONLY_DEPTH = 0x8, + D3D12_RENDER_PASS_FLAG_BIND_READ_ONLY_STENCIL = 0x10 + } D3D12_RENDER_PASS_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RENDER_PASS_FLAGS ) + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_s_ifspec; + +#ifndef __ID3D12MetaCommand_INTERFACE_DEFINED__ +#define __ID3D12MetaCommand_INTERFACE_DEFINED__ + +/* interface ID3D12MetaCommand */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12MetaCommand; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DBB84C27-36CE-4FC9-B801-F048C46AC570") + ID3D12MetaCommand : public ID3D12Pageable + { + public: + virtual UINT64 STDMETHODCALLTYPE GetRequiredParameterResourceSize( + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _In_ UINT ParameterIndex) = 0; -#endif + }; + + +#else /* C style interface */ + + typedef struct ID3D12MetaCommandVtbl + { + BEGIN_INTERFACE - DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) - HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( - ID3D12Device7 * This, - _In_ ID3D12LifetimeOwner *pOwner, + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12MetaCommand * This, REFIID riid, - _COM_Outptr_ void **ppvTracker); - - DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) - void ( STDMETHODCALLTYPE *RemoveDevice )( - ID3D12Device7 * This); - - DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) - HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( - ID3D12Device7 * This, - _Inout_ UINT *pNumMetaCommands, - _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + _COM_Outptr_ void **ppvObject); - DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) - HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( - ID3D12Device7 * This, - _In_ REFGUID CommandId, - _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, - _Out_opt_ UINT *pTotalStructureSizeInBytes, - _Inout_ UINT *pParameterCount, - _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12MetaCommand * This); - DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) - HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( - ID3D12Device7 * This, - _In_ REFGUID CommandId, - _In_ UINT NodeMask, - _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, - _In_ SIZE_T CreationParametersDataSizeInBytes, - REFIID riid, - _COM_Outptr_ void **ppMetaCommand); + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12MetaCommand * This); - DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) - HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( - ID3D12Device7 * This, - const D3D12_STATE_OBJECT_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppStateObject); + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12MetaCommand * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); - DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) - void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( - ID3D12Device7 * This, - _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, - _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12MetaCommand * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); - DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) - D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( - ID3D12Device7 * This, - _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, - _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12MetaCommand * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); - DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) - HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( - ID3D12Device7 * This, - D3D12_BACKGROUND_PROCESSING_MODE Mode, - D3D12_MEASUREMENTS_ACTION MeasurementsAction, - _In_opt_ HANDLE hEventToSignalUponCompletion, - _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12MetaCommand * This, + _In_z_ LPCWSTR Name); - DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) - HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( - ID3D12Device7 * This, - const D3D12_STATE_OBJECT_DESC *pAddition, - ID3D12StateObject *pStateObjectToGrowFrom, + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12MetaCommand * This, REFIID riid, - _COM_Outptr_ void **ppNewStateObject); + _COM_Outptr_opt_ void **ppvDevice); - DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) - HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( - ID3D12Device7 * This, - _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, - _In_ REFIID riid, - _COM_Outptr_ void **ppSession); + DECLSPEC_XFGVIRT(ID3D12MetaCommand, GetRequiredParameterResourceSize) + UINT64 ( STDMETHODCALLTYPE *GetRequiredParameterResourceSize )( + ID3D12MetaCommand * This, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _In_ UINT ParameterIndex); END_INTERFACE - } ID3D12Device7Vtbl; + } ID3D12MetaCommandVtbl; - interface ID3D12Device7 + interface ID3D12MetaCommand { - CONST_VTBL struct ID3D12Device7Vtbl *lpVtbl; + CONST_VTBL struct ID3D12MetaCommandVtbl *lpVtbl; }; @@ -17299,933 +20882,1349 @@ EXTERN_C const IID IID_ID3D12Device7; #ifdef COBJMACROS -#define ID3D12Device7_QueryInterface(This,riid,ppvObject) \ +#define ID3D12MetaCommand_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device7_AddRef(This) \ +#define ID3D12MetaCommand_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Device7_Release(This) \ +#define ID3D12MetaCommand_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Device7_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12MetaCommand_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12Device7_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12MetaCommand_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12Device7_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12MetaCommand_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12Device7_SetName(This,Name) \ +#define ID3D12MetaCommand_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12Device7_GetNodeCount(This) \ - ( (This)->lpVtbl -> GetNodeCount(This) ) - -#define ID3D12Device7_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ - ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) - -#define ID3D12Device7_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ - ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) - -#define ID3D12Device7_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) - -#define ID3D12Device7_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) - -#define ID3D12Device7_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ - ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) - -#define ID3D12Device7_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ - ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) - -#define ID3D12Device7_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) - -#define ID3D12Device7_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ - ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) - -#define ID3D12Device7_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ - ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) - -#define ID3D12Device7_CreateConstantBufferView(This,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) - -#define ID3D12Device7_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) - -#define ID3D12Device7_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) - -#define ID3D12Device7_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) - -#define ID3D12Device7_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) - -#define ID3D12Device7_CreateSampler(This,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) - -#define ID3D12Device7_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ - ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) - -#define ID3D12Device7_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ - ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) -#if !defined(_WIN32) - -#define ID3D12Device7_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) -#else -#define ID3D12Device7_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) -#endif -#if !defined(_WIN32) - -#define ID3D12Device7_GetCustomHeapProperties(This,nodeMask,heapType) \ - ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) -#else -#define ID3D12Device7_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ - ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) -#endif - -#define ID3D12Device7_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) - -#define ID3D12Device7_CreateHeap(This,pDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) - -#define ID3D12Device7_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) - -#define ID3D12Device7_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) - -#define ID3D12Device7_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ - ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) - -#define ID3D12Device7_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ - ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) - -#define ID3D12Device7_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ - ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) - -#define ID3D12Device7_MakeResident(This,NumObjects,ppObjects) \ - ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) - -#define ID3D12Device7_Evict(This,NumObjects,ppObjects) \ - ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) - -#define ID3D12Device7_CreateFence(This,InitialValue,Flags,riid,ppFence) \ - ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) - -#define ID3D12Device7_GetDeviceRemovedReason(This) \ - ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) - -#define ID3D12Device7_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ - ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) - -#define ID3D12Device7_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) - -#define ID3D12Device7_SetStablePowerState(This,Enable) \ - ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) - -#define ID3D12Device7_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ - ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) - -#define ID3D12Device7_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ - ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) -#if !defined(_WIN32) - -#define ID3D12Device7_GetAdapterLuid(This) \ - ( (This)->lpVtbl -> GetAdapterLuid(This) ) -#else -#define ID3D12Device7_GetAdapterLuid(This,RetVal) \ - ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) -#endif - - -#define ID3D12Device7_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ - ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) - -#define ID3D12Device7_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ - ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) - -#define ID3D12Device7_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ - ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) - - -#define ID3D12Device7_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) - - -#define ID3D12Device7_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ - ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) - -#define ID3D12Device7_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ - ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) - -#define ID3D12Device7_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ - ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) - +#define ID3D12MetaCommand_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12Device7_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ - ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) -#define ID3D12Device7_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ - ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) -#define ID3D12Device7_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) +#define ID3D12MetaCommand_GetRequiredParameterResourceSize(This,Stage,ParameterIndex) \ + ( (This)->lpVtbl -> GetRequiredParameterResourceSize(This,Stage,ParameterIndex) ) -#define ID3D12Device7_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) +#endif /* COBJMACROS */ -#define ID3D12Device7_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ - ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) -#if !defined(_WIN32) -#define ID3D12Device7_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) -#else -#define ID3D12Device7_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) -#endif +#endif /* C style interface */ -#define ID3D12Device7_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ - ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) -#define ID3D12Device7_RemoveDevice(This) \ - ( (This)->lpVtbl -> RemoveDevice(This) ) -#define ID3D12Device7_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ - ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) +#endif /* __ID3D12MetaCommand_INTERFACE_DEFINED__ */ -#define ID3D12Device7_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ - ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) -#define ID3D12Device7_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ - ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) +/* interface __MIDL_itf_d3d12_0000_0052 */ +/* [local] */ -#define ID3D12Device7_CreateStateObject(This,pDesc,riid,ppStateObject) \ - ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) +typedef struct D3D12_DISPATCH_RAYS_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS_RANGE RayGenerationShaderRecord; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE MissShaderTable; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE HitGroupTable; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE CallableShaderTable; + UINT Width; + UINT Height; + UINT Depth; + } D3D12_DISPATCH_RAYS_DESC; -#define ID3D12Device7_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ - ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) +typedef +enum D3D12_SET_WORK_GRAPH_FLAGS + { + D3D12_SET_WORK_GRAPH_FLAG_NONE = 0, + D3D12_SET_WORK_GRAPH_FLAG_INITIALIZE = 0x1 + } D3D12_SET_WORK_GRAPH_FLAGS; -#define ID3D12Device7_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ - ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SET_WORK_GRAPH_FLAGS ) +typedef struct D3D12_SET_WORK_GRAPH_DESC + { + D3D12_PROGRAM_IDENTIFIER ProgramIdentifier; + D3D12_SET_WORK_GRAPH_FLAGS Flags; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE BackingMemory; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE NodeLocalRootArgumentsTable; + } D3D12_SET_WORK_GRAPH_DESC; +typedef struct D3D12_SET_RAYTRACING_PIPELINE_DESC + { + D3D12_PROGRAM_IDENTIFIER ProgramIdentifier; + } D3D12_SET_RAYTRACING_PIPELINE_DESC; -#define ID3D12Device7_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ - ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) +typedef struct D3D12_SET_GENERIC_PIPELINE_DESC + { + D3D12_PROGRAM_IDENTIFIER ProgramIdentifier; + } D3D12_SET_GENERIC_PIPELINE_DESC; +typedef +enum D3D12_PROGRAM_TYPE + { + D3D12_PROGRAM_TYPE_GENERIC_PIPELINE = 1, + D3D12_PROGRAM_TYPE_RAYTRACING_PIPELINE = 4, + D3D12_PROGRAM_TYPE_WORK_GRAPH = 5 + } D3D12_PROGRAM_TYPE; -#define ID3D12Device7_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ - ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) +typedef struct D3D12_SET_PROGRAM_DESC + { + D3D12_PROGRAM_TYPE Type; + union + { + D3D12_SET_GENERIC_PIPELINE_DESC GenericPipeline; + D3D12_SET_RAYTRACING_PIPELINE_DESC RaytracingPipeline; + D3D12_SET_WORK_GRAPH_DESC WorkGraph; + } ; + } D3D12_SET_PROGRAM_DESC; -#define ID3D12Device7_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ - ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) +typedef +enum D3D12_DISPATCH_MODE + { + D3D12_DISPATCH_MODE_NODE_CPU_INPUT = 0, + D3D12_DISPATCH_MODE_NODE_GPU_INPUT = 1, + D3D12_DISPATCH_MODE_MULTI_NODE_CPU_INPUT = 2, + D3D12_DISPATCH_MODE_MULTI_NODE_GPU_INPUT = 3 + } D3D12_DISPATCH_MODE; -#endif /* COBJMACROS */ +typedef struct D3D12_NODE_CPU_INPUT + { + UINT EntrypointIndex; + UINT NumRecords; + const void *pRecords; + UINT64 RecordStrideInBytes; + } D3D12_NODE_CPU_INPUT; +typedef struct D3D12_NODE_GPU_INPUT + { + UINT EntrypointIndex; + UINT NumRecords; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE Records; + } D3D12_NODE_GPU_INPUT; -#endif /* C style interface */ +typedef struct D3D12_MULTI_NODE_CPU_INPUT + { + UINT NumNodeInputs; + const D3D12_NODE_CPU_INPUT *pNodeInputs; + UINT64 NodeInputStrideInBytes; + } D3D12_MULTI_NODE_CPU_INPUT; +typedef struct D3D12_MULTI_NODE_GPU_INPUT + { + UINT NumNodeInputs; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE NodeInputs; + } D3D12_MULTI_NODE_GPU_INPUT; +typedef struct D3D12_DISPATCH_GRAPH_DESC + { + D3D12_DISPATCH_MODE Mode; + union + { + D3D12_NODE_CPU_INPUT NodeCPUInput; + D3D12_GPU_VIRTUAL_ADDRESS NodeGPUInput; + D3D12_MULTI_NODE_CPU_INPUT MultiNodeCPUInput; + D3D12_GPU_VIRTUAL_ADDRESS MultiNodeGPUInput; + } ; + } D3D12_DISPATCH_GRAPH_DESC; -#endif /* __ID3D12Device7_INTERFACE_DEFINED__ */ +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_s_ifspec; -#ifndef __ID3D12Device8_INTERFACE_DEFINED__ -#define __ID3D12Device8_INTERFACE_DEFINED__ +#ifndef __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ -/* interface ID3D12Device8 */ +/* interface ID3D12GraphicsCommandList4 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12Device8; +EXTERN_C const IID IID_ID3D12GraphicsCommandList4; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("9218E6BB-F944-4F7E-A75C-B1B2C7B701F3") - ID3D12Device8 : public ID3D12Device7 + MIDL_INTERFACE("8754318e-d3a9-4541-98cf-645b50dc4874") + ID3D12GraphicsCommandList4 : public ID3D12GraphicsCommandList3 { public: -#if defined(_MSC_VER) || !defined(_WIN32) - virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo2( - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; -#else - virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo2( - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; -#endif + virtual void STDMETHODCALLTYPE BeginRenderPass( + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags) = 0; - virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource2( - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource) = 0; + virtual void STDMETHODCALLTYPE EndRenderPass( void) = 0; - virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource1( - _In_ ID3D12Heap *pHeap, - UINT64 HeapOffset, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource) = 0; + virtual void STDMETHODCALLTYPE InitializeMetaCommand( + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes) = 0; - virtual void STDMETHODCALLTYPE CreateSamplerFeedbackUnorderedAccessView( - _In_opt_ ID3D12Resource *pTargetedResource, - _In_opt_ ID3D12Resource *pFeedbackResource, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + virtual void STDMETHODCALLTYPE ExecuteMetaCommand( + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes) = 0; - virtual void STDMETHODCALLTYPE GetCopyableFootprints1( - _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, - _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, - _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, - UINT64 BaseOffset, - _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, - _Out_writes_opt_(NumSubresources) UINT *pNumRows, - _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, - _Out_opt_ UINT64 *pTotalBytes) = 0; + virtual void STDMETHODCALLTYPE BuildRaytracingAccelerationStructure( + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs) = 0; + + virtual void STDMETHODCALLTYPE EmitRaytracingAccelerationStructurePostbuildInfo( + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData) = 0; + + virtual void STDMETHODCALLTYPE CopyRaytracingAccelerationStructure( + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode) = 0; + + virtual void STDMETHODCALLTYPE SetPipelineState1( + _In_ ID3D12StateObject *pStateObject) = 0; + + virtual void STDMETHODCALLTYPE DispatchRays( + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc) = 0; }; #else /* C style interface */ - typedef struct ID3D12Device8Vtbl + typedef struct ID3D12GraphicsCommandList4Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Device8 * This, + ID3D12GraphicsCommandList4 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Device8 * This); + ID3D12GraphicsCommandList4 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Device8 * This); + ID3D12GraphicsCommandList4 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Device8 * This, + ID3D12GraphicsCommandList4 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Device8 * This, + ID3D12GraphicsCommandList4 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Device8 * This, + ID3D12GraphicsCommandList4 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Device8 * This, + ID3D12GraphicsCommandList4 * This, _In_z_ LPCWSTR Name); - DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) - UINT ( STDMETHODCALLTYPE *GetNodeCount )( - ID3D12Device8 * This); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) - HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( - ID3D12Device8 * This, - _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList4 * This, REFIID riid, - _COM_Outptr_ void **ppCommandQueue); + _COM_Outptr_opt_ void **ppvDevice); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) - HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( - ID3D12Device8 * This, - _In_ D3D12_COMMAND_LIST_TYPE type, - REFIID riid, - _COM_Outptr_ void **ppCommandAllocator); + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList4 * This); - DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) - HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( - ID3D12Device8 * This, - _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList4 * This); - DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) - HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( - ID3D12Device8 * This, - _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList4 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList4 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList4 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) - HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( - ID3D12Device8 * This, - _In_ UINT nodeMask, - _In_ D3D12_COMMAND_LIST_TYPE type, - _In_ ID3D12CommandAllocator *pCommandAllocator, - _In_opt_ ID3D12PipelineState *pInitialState, - REFIID riid, - _COM_Outptr_ void **ppCommandList); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); - DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) - HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( - ID3D12Device8 * This, - D3D12_FEATURE Feature, - _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, - UINT FeatureSupportDataSize); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); - DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) - HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( - ID3D12Device8 * This, - _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, - REFIID riid, - _COM_Outptr_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); - DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) - UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( - ID3D12Device8 * This, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); - DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) - HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( - ID3D12Device8 * This, - _In_ UINT nodeMask, - _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, - _In_ SIZE_T blobLengthInBytes, - REFIID riid, - _COM_Outptr_ void **ppvRootSignature); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); - DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) - void ( STDMETHODCALLTYPE *CreateConstantBufferView )( - ID3D12Device8 * This, - _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); - DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) - void ( STDMETHODCALLTYPE *CreateShaderResourceView )( - ID3D12Device8 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); - DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) - void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( - ID3D12Device8 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ ID3D12Resource *pCounterResource, - _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); - DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) - void ( STDMETHODCALLTYPE *CreateRenderTargetView )( - ID3D12Device8 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); - DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) - void ( STDMETHODCALLTYPE *CreateDepthStencilView )( - ID3D12Device8 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); - DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) - void ( STDMETHODCALLTYPE *CreateSampler )( - ID3D12Device8 * This, - _In_ const D3D12_SAMPLER_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) - void ( STDMETHODCALLTYPE *CopyDescriptors )( - ID3D12Device8 * This, - _In_ UINT NumDestDescriptorRanges, - _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, - _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, - _In_ UINT NumSrcDescriptorRanges, - _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, - _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) - void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( - ID3D12Device8 * This, - _In_ UINT NumDescriptors, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) -#if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device8 * This, - _In_ UINT visibleMask, - _In_ UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); -#else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device8 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - _In_ UINT visibleMask, - _In_ UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); -#endif + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); - DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) -#if !defined(_WIN32) - D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device8 * This, - _In_ UINT nodeMask, - D3D12_HEAP_TYPE heapType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); -#else - D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device8 * This, - D3D12_HEAP_PROPERTIES * RetVal, - _In_ UINT nodeMask, - D3D12_HEAP_TYPE heapType); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); -#endif + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( - ID3D12Device8 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); - DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) - HRESULT ( STDMETHODCALLTYPE *CreateHeap )( - ID3D12Device8 * This, - _In_ const D3D12_HEAP_DESC *pDesc, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) - HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( - ID3D12Device8 * This, - _In_ ID3D12Heap *pHeap, - UINT64 HeapOffset, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) - HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( - ID3D12Device8 * This, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) - HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( - ID3D12Device8 * This, - _In_ ID3D12DeviceChild *pObject, - _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, - DWORD Access, - _In_opt_ LPCWSTR Name, - _Out_ HANDLE *pHandle); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); - DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) - HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( - ID3D12Device8 * This, - _In_ HANDLE NTHandle, - REFIID riid, - _COM_Outptr_opt_ void **ppvObj); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); - DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) - HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( - ID3D12Device8 * This, - _In_ LPCWSTR Name, - DWORD Access, - /* [annotation][out] */ - _Out_ HANDLE *pNTHandle); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); - DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) - HRESULT ( STDMETHODCALLTYPE *MakeResident )( - ID3D12Device8 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); - DECLSPEC_XFGVIRT(ID3D12Device, Evict) - HRESULT ( STDMETHODCALLTYPE *Evict )( - ID3D12Device8 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); - DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) - HRESULT ( STDMETHODCALLTYPE *CreateFence )( - ID3D12Device8 * This, - UINT64 InitialValue, - D3D12_FENCE_FLAGS Flags, - REFIID riid, - _COM_Outptr_ void **ppFence); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList4 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); - DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) - HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( - ID3D12Device8 * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList4 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); - DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) - void ( STDMETHODCALLTYPE *GetCopyableFootprints )( - ID3D12Device8 * This, - _In_ const D3D12_RESOURCE_DESC *pResourceDesc, - _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, - _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, - UINT64 BaseOffset, - _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, - _Out_writes_opt_(NumSubresources) UINT *pNumRows, - _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, - _Out_opt_ UINT64 *pTotalBytes); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList4 * This); - DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) - HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( - ID3D12Device8 * This, - _In_ const D3D12_QUERY_HEAP_DESC *pDesc, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); - DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) - HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( - ID3D12Device8 * This, - BOOL Enable); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) - HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( - ID3D12Device8 * This, - _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, - _In_opt_ ID3D12RootSignature *pRootSignature, - REFIID riid, - _COM_Outptr_opt_ void **ppvCommandSignature); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); - DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) - void ( STDMETHODCALLTYPE *GetResourceTiling )( - ID3D12Device8 * This, - _In_ ID3D12Resource *pTiledResource, - _Out_opt_ UINT *pNumTilesForEntireResource, - _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, - _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, - _Inout_opt_ UINT *pNumSubresourceTilings, - _In_ UINT FirstSubresourceTilingToGet, - _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList4 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); - DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) -#if !defined(_WIN32) - LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device8 * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); -#else - LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device8 * This, - LUID * RetVal); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); -#endif + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT Mask); - DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) - HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( - ID3D12Device8 * This, - _In_reads_(BlobLength) const void *pLibraryBlob, - SIZE_T BlobLength, - REFIID riid, - _COM_Outptr_ void **ppPipelineLibrary); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList4 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); - DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) - HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( - ID3D12Device8 * This, - _In_reads_(NumFences) ID3D12Fence *const *ppFences, - _In_reads_(NumFences) const UINT64 *pFenceValues, - UINT NumFences, - D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, - HANDLE hEvent); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); - DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) - HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( - ID3D12Device8 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, - _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList4 * This); - DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) - HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( - ID3D12Device8 * This, - const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); - DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) - HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( - ID3D12Device8 * This, - _In_ const void *pAddress, - REFIID riid, - _COM_Outptr_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); - DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) - HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( - ID3D12Device8 * This, - _In_ HANDLE hFileMapping, - REFIID riid, - _COM_Outptr_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); - DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) - HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( - ID3D12Device8 * This, - D3D12_RESIDENCY_FLAGS Flags, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, - _In_ ID3D12Fence *pFenceToSignal, - UINT64 FenceValueToSignal); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) - HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( - ID3D12Device8 * This, - _In_ UINT nodeMask, - _In_ D3D12_COMMAND_LIST_TYPE type, - _In_ D3D12_COMMAND_LIST_FLAGS flags, - REFIID riid, - _COM_Outptr_ void **ppCommandList); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) - HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( - ID3D12Device8 * This, - _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, - _In_ REFIID riid, - _COM_Outptr_ void **ppSession); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12StateObject *pStateObject); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( - ID3D12Device8 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) - HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( - ID3D12Device8 * This, - _In_ const D3D12_HEAP_DESC *pDesc, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); + END_INTERFACE + } ID3D12GraphicsCommandList4Vtbl; + + interface ID3D12GraphicsCommandList4 + { + CONST_VTBL struct ID3D12GraphicsCommandList4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList4_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList4_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList4_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList4_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList4_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList4_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList4_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList4_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList4_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList4_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList4_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList4_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList4_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList4_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList4_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList4_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList4_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList4_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList4_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList4_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList4_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList4_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList4_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList4_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList4_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList4_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList4_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList4_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList4_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList4_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList4_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList4_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList4_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList4_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList4_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList4_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList4_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList4_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList4_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList4_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList4_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList4_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList4_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList4_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList4_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList4_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList4_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList4_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList4_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList4_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList4_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList4_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList4_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList4_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList4_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0053 */ +/* [local] */ + +typedef +enum D3D12_SHADER_CACHE_MODE + { + D3D12_SHADER_CACHE_MODE_MEMORY = 0, + D3D12_SHADER_CACHE_MODE_DISK = ( D3D12_SHADER_CACHE_MODE_MEMORY + 1 ) + } D3D12_SHADER_CACHE_MODE; + +typedef +enum D3D12_SHADER_CACHE_FLAGS + { + D3D12_SHADER_CACHE_FLAG_NONE = 0, + D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED = 0x1, + D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR = 0x2 + } D3D12_SHADER_CACHE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_FLAGS ) +typedef struct D3D12_SHADER_CACHE_SESSION_DESC + { + GUID Identifier; + D3D12_SHADER_CACHE_MODE Mode; + D3D12_SHADER_CACHE_FLAGS Flags; + UINT MaximumInMemoryCacheSizeBytes; + UINT MaximumInMemoryCacheEntries; + UINT MaximumValueFileSizeBytes; + UINT64 Version; + } D3D12_SHADER_CACHE_SESSION_DESC; + +typedef +enum D3D12_BARRIER_LAYOUT + { + D3D12_BARRIER_LAYOUT_UNDEFINED = 0xffffffff, + D3D12_BARRIER_LAYOUT_COMMON = 0, + D3D12_BARRIER_LAYOUT_PRESENT = 0, + D3D12_BARRIER_LAYOUT_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_PRESENT + 1 ) , + D3D12_BARRIER_LAYOUT_RENDER_TARGET = ( D3D12_BARRIER_LAYOUT_GENERIC_READ + 1 ) , + D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_RENDER_TARGET + 1 ) , + D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE = ( D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS + 1 ) , + D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ + 1 ) , + D3D12_BARRIER_LAYOUT_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_SHADER_RESOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COPY_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE = ( D3D12_BARRIER_LAYOUT_COPY_DEST + 1 ) , + D3D12_BARRIER_LAYOUT_RESOLVE_DEST = ( D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE = ( D3D12_BARRIER_LAYOUT_RESOLVE_DEST + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ = ( D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST + 1 ) + } D3D12_BARRIER_LAYOUT; + +typedef +enum D3D12_BARRIER_SYNC + { + D3D12_BARRIER_SYNC_NONE = 0, + D3D12_BARRIER_SYNC_ALL = 0x1, + D3D12_BARRIER_SYNC_DRAW = 0x2, + D3D12_BARRIER_SYNC_INDEX_INPUT = 0x4, + D3D12_BARRIER_SYNC_VERTEX_SHADING = 0x8, + D3D12_BARRIER_SYNC_PIXEL_SHADING = 0x10, + D3D12_BARRIER_SYNC_DEPTH_STENCIL = 0x20, + D3D12_BARRIER_SYNC_RENDER_TARGET = 0x40, + D3D12_BARRIER_SYNC_COMPUTE_SHADING = 0x80, + D3D12_BARRIER_SYNC_RAYTRACING = 0x100, + D3D12_BARRIER_SYNC_COPY = 0x200, + D3D12_BARRIER_SYNC_RESOLVE = 0x400, + D3D12_BARRIER_SYNC_EXECUTE_INDIRECT = 0x800, + D3D12_BARRIER_SYNC_PREDICATION = 0x800, + D3D12_BARRIER_SYNC_ALL_SHADING = 0x1000, + D3D12_BARRIER_SYNC_NON_PIXEL_SHADING = 0x2000, + D3D12_BARRIER_SYNC_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO = 0x4000, + D3D12_BARRIER_SYNC_CLEAR_UNORDERED_ACCESS_VIEW = 0x8000, + D3D12_BARRIER_SYNC_VIDEO_DECODE = 0x100000, + D3D12_BARRIER_SYNC_VIDEO_PROCESS = 0x200000, + D3D12_BARRIER_SYNC_VIDEO_ENCODE = 0x400000, + D3D12_BARRIER_SYNC_BUILD_RAYTRACING_ACCELERATION_STRUCTURE = 0x800000, + D3D12_BARRIER_SYNC_COPY_RAYTRACING_ACCELERATION_STRUCTURE = 0x1000000, + D3D12_BARRIER_SYNC_SPLIT = 0x80000000 + } D3D12_BARRIER_SYNC; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_SYNC ) +typedef +enum D3D12_BARRIER_ACCESS + { + D3D12_BARRIER_ACCESS_COMMON = 0, + D3D12_BARRIER_ACCESS_VERTEX_BUFFER = 0x1, + D3D12_BARRIER_ACCESS_CONSTANT_BUFFER = 0x2, + D3D12_BARRIER_ACCESS_INDEX_BUFFER = 0x4, + D3D12_BARRIER_ACCESS_RENDER_TARGET = 0x8, + D3D12_BARRIER_ACCESS_UNORDERED_ACCESS = 0x10, + D3D12_BARRIER_ACCESS_DEPTH_STENCIL_WRITE = 0x20, + D3D12_BARRIER_ACCESS_DEPTH_STENCIL_READ = 0x40, + D3D12_BARRIER_ACCESS_SHADER_RESOURCE = 0x80, + D3D12_BARRIER_ACCESS_STREAM_OUTPUT = 0x100, + D3D12_BARRIER_ACCESS_INDIRECT_ARGUMENT = 0x200, + D3D12_BARRIER_ACCESS_PREDICATION = 0x200, + D3D12_BARRIER_ACCESS_COPY_DEST = 0x400, + D3D12_BARRIER_ACCESS_COPY_SOURCE = 0x800, + D3D12_BARRIER_ACCESS_RESOLVE_DEST = 0x1000, + D3D12_BARRIER_ACCESS_RESOLVE_SOURCE = 0x2000, + D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_READ = 0x4000, + D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_WRITE = 0x8000, + D3D12_BARRIER_ACCESS_SHADING_RATE_SOURCE = 0x10000, + D3D12_BARRIER_ACCESS_VIDEO_DECODE_READ = 0x20000, + D3D12_BARRIER_ACCESS_VIDEO_DECODE_WRITE = 0x40000, + D3D12_BARRIER_ACCESS_VIDEO_PROCESS_READ = 0x80000, + D3D12_BARRIER_ACCESS_VIDEO_PROCESS_WRITE = 0x100000, + D3D12_BARRIER_ACCESS_VIDEO_ENCODE_READ = 0x200000, + D3D12_BARRIER_ACCESS_VIDEO_ENCODE_WRITE = 0x400000, + D3D12_BARRIER_ACCESS_NO_ACCESS = 0x80000000 + } D3D12_BARRIER_ACCESS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_ACCESS ) +typedef +enum D3D12_BARRIER_TYPE + { + D3D12_BARRIER_TYPE_GLOBAL = 0, + D3D12_BARRIER_TYPE_TEXTURE = ( D3D12_BARRIER_TYPE_GLOBAL + 1 ) , + D3D12_BARRIER_TYPE_BUFFER = ( D3D12_BARRIER_TYPE_TEXTURE + 1 ) + } D3D12_BARRIER_TYPE; + +typedef +enum D3D12_TEXTURE_BARRIER_FLAGS + { + D3D12_TEXTURE_BARRIER_FLAG_NONE = 0, + D3D12_TEXTURE_BARRIER_FLAG_DISCARD = 0x1 + } D3D12_TEXTURE_BARRIER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_TEXTURE_BARRIER_FLAGS ) +typedef struct D3D12_BARRIER_SUBRESOURCE_RANGE + { + UINT IndexOrFirstMipLevel; + UINT NumMipLevels; + UINT FirstArraySlice; + UINT NumArraySlices; + UINT FirstPlane; + UINT NumPlanes; + } D3D12_BARRIER_SUBRESOURCE_RANGE; + +typedef struct D3D12_GLOBAL_BARRIER + { + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + } D3D12_GLOBAL_BARRIER; + +typedef struct D3D12_TEXTURE_BARRIER + { + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + D3D12_BARRIER_LAYOUT LayoutBefore; + D3D12_BARRIER_LAYOUT LayoutAfter; + _In_ ID3D12Resource *pResource; + D3D12_BARRIER_SUBRESOURCE_RANGE Subresources; + D3D12_TEXTURE_BARRIER_FLAGS Flags; + } D3D12_TEXTURE_BARRIER; + +typedef struct D3D12_BUFFER_BARRIER + { + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + _In_ ID3D12Resource *pResource; + UINT64 Offset; + UINT64 Size; + } D3D12_BUFFER_BARRIER; + +typedef struct D3D12_BARRIER_GROUP + { + D3D12_BARRIER_TYPE Type; + UINT32 NumBarriers; + union + { + _In_reads_(NumBarriers) const D3D12_GLOBAL_BARRIER *pGlobalBarriers; + _In_reads_(NumBarriers) const D3D12_TEXTURE_BARRIER *pTextureBarriers; + _In_reads_(NumBarriers) const D3D12_BUFFER_BARRIER *pBufferBarriers; + } ; + } D3D12_BARRIER_GROUP; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0053_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0053_v0_0_s_ifspec; + +#ifndef __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ +#define __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ + +/* interface ID3D12ShaderCacheSession */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ShaderCacheSession; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("28e2495d-0f64-4ae4-a6ec-129255dc49a8") + ID3D12ShaderCacheSession : public ID3D12DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE FindValue( + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][out] */ + _Out_writes_bytes_(*pValueSize) void *pValue, + _Inout_ UINT *pValueSize) = 0; - DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) - HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( - ID3D12Device8 * This, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + virtual HRESULT STDMETHODCALLTYPE StoreValue( + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][in] */ + _In_reads_bytes_(ValueSize) const void *pValue, + UINT ValueSize) = 0; - DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) -#if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device8 * This, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + virtual void STDMETHODCALLTYPE SetDeleteOnDestroy( void) = 0; +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_SHADER_CACHE_SESSION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; #else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device8 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - + virtual D3D12_SHADER_CACHE_SESSION_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_SHADER_CACHE_SESSION_DESC * RetVal) = 0; #endif - DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) - HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( - ID3D12Device8 * This, - _In_ ID3D12LifetimeOwner *pOwner, - REFIID riid, - _COM_Outptr_ void **ppvTracker); - - DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) - void ( STDMETHODCALLTYPE *RemoveDevice )( - ID3D12Device8 * This); - - DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) - HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( - ID3D12Device8 * This, - _Inout_ UINT *pNumMetaCommands, - _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); - - DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) - HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( - ID3D12Device8 * This, - _In_ REFGUID CommandId, - _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, - _Out_opt_ UINT *pTotalStructureSizeInBytes, - _Inout_ UINT *pParameterCount, - _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + }; + + +#else /* C style interface */ + + typedef struct ID3D12ShaderCacheSessionVtbl + { + BEGIN_INTERFACE - DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) - HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( - ID3D12Device8 * This, - _In_ REFGUID CommandId, - _In_ UINT NodeMask, - _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, - _In_ SIZE_T CreationParametersDataSizeInBytes, + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ShaderCacheSession * This, REFIID riid, - _COM_Outptr_ void **ppMetaCommand); + _COM_Outptr_ void **ppvObject); - DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) - HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( - ID3D12Device8 * This, - const D3D12_STATE_OBJECT_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppStateObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ShaderCacheSession * This); - DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) - void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( - ID3D12Device8 * This, - _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, - _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ShaderCacheSession * This); - DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) - D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( - ID3D12Device8 * This, - _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, - _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ShaderCacheSession * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); - DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) - HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( - ID3D12Device8 * This, - D3D12_BACKGROUND_PROCESSING_MODE Mode, - D3D12_MEASUREMENTS_ACTION MeasurementsAction, - _In_opt_ HANDLE hEventToSignalUponCompletion, - _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ShaderCacheSession * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); - DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) - HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( - ID3D12Device8 * This, - const D3D12_STATE_OBJECT_DESC *pAddition, - ID3D12StateObject *pStateObjectToGrowFrom, - REFIID riid, - _COM_Outptr_ void **ppNewStateObject); + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ShaderCacheSession * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); - DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) - HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( - ID3D12Device8 * This, - _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, - _In_ REFIID riid, - _COM_Outptr_ void **ppSession); + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ShaderCacheSession * This, + _In_z_ LPCWSTR Name); - DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) -#if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( - ID3D12Device8 * This, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ShaderCacheSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); -#else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( - ID3D12Device8 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, FindValue) + HRESULT ( STDMETHODCALLTYPE *FindValue )( + ID3D12ShaderCacheSession * This, + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][out] */ + _Out_writes_bytes_(*pValueSize) void *pValue, + _Inout_ UINT *pValueSize); -#endif + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, StoreValue) + HRESULT ( STDMETHODCALLTYPE *StoreValue )( + ID3D12ShaderCacheSession * This, + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][in] */ + _In_reads_bytes_(ValueSize) const void *pValue, + UINT ValueSize); - DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( - ID3D12Device8 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, SetDeleteOnDestroy) + void ( STDMETHODCALLTYPE *SetDeleteOnDestroy )( + ID3D12ShaderCacheSession * This); - DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) - HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( - ID3D12Device8 * This, - _In_ ID3D12Heap *pHeap, - UINT64 HeapOffset, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, GetDesc) +#if !defined(_WIN32) + D3D12_SHADER_CACHE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12ShaderCacheSession * This); - DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) - void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( - ID3D12Device8 * This, - _In_opt_ ID3D12Resource *pTargetedResource, - _In_opt_ ID3D12Resource *pFeedbackResource, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); +#else + D3D12_SHADER_CACHE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12ShaderCacheSession * This, + D3D12_SHADER_CACHE_SESSION_DESC * RetVal); - DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) - void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( - ID3D12Device8 * This, - _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, - _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, - _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, - UINT64 BaseOffset, - _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, - _Out_writes_opt_(NumSubresources) UINT *pNumRows, - _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, - _Out_opt_ UINT64 *pTotalBytes); +#endif END_INTERFACE - } ID3D12Device8Vtbl; + } ID3D12ShaderCacheSessionVtbl; - interface ID3D12Device8 + interface ID3D12ShaderCacheSession { - CONST_VTBL struct ID3D12Device8Vtbl *lpVtbl; + CONST_VTBL struct ID3D12ShaderCacheSessionVtbl *lpVtbl; }; @@ -18233,409 +22232,758 @@ EXTERN_C const IID IID_ID3D12Device8; #ifdef COBJMACROS -#define ID3D12Device8_QueryInterface(This,riid,ppvObject) \ +#define ID3D12ShaderCacheSession_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device8_AddRef(This) \ +#define ID3D12ShaderCacheSession_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Device8_Release(This) \ +#define ID3D12ShaderCacheSession_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Device8_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12ShaderCacheSession_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12Device8_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12ShaderCacheSession_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12Device8_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12ShaderCacheSession_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12Device8_SetName(This,Name) \ +#define ID3D12ShaderCacheSession_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12Device8_GetNodeCount(This) \ - ( (This)->lpVtbl -> GetNodeCount(This) ) - -#define ID3D12Device8_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ - ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) - -#define ID3D12Device8_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ - ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) - -#define ID3D12Device8_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) - -#define ID3D12Device8_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) - -#define ID3D12Device8_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ - ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) - -#define ID3D12Device8_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ - ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) - -#define ID3D12Device8_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) - -#define ID3D12Device8_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ - ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) - -#define ID3D12Device8_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ - ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) - -#define ID3D12Device8_CreateConstantBufferView(This,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) - -#define ID3D12Device8_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) - -#define ID3D12Device8_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) - -#define ID3D12Device8_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) - -#define ID3D12Device8_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) - -#define ID3D12Device8_CreateSampler(This,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) - -#define ID3D12Device8_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ - ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) - -#define ID3D12Device8_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ - ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) -#if !defined(_WIN32) - -#define ID3D12Device8_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) -#else -#define ID3D12Device8_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) -#endif -#if !defined(_WIN32) - -#define ID3D12Device8_GetCustomHeapProperties(This,nodeMask,heapType) \ - ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) -#else -#define ID3D12Device8_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ - ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) -#endif - -#define ID3D12Device8_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) - -#define ID3D12Device8_CreateHeap(This,pDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) - -#define ID3D12Device8_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) - -#define ID3D12Device8_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) - -#define ID3D12Device8_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ - ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) - -#define ID3D12Device8_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ - ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) - -#define ID3D12Device8_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ - ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) - -#define ID3D12Device8_MakeResident(This,NumObjects,ppObjects) \ - ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) - -#define ID3D12Device8_Evict(This,NumObjects,ppObjects) \ - ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) - -#define ID3D12Device8_CreateFence(This,InitialValue,Flags,riid,ppFence) \ - ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) - -#define ID3D12Device8_GetDeviceRemovedReason(This) \ - ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) - -#define ID3D12Device8_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ - ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) +#define ID3D12ShaderCacheSession_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12Device8_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12Device8_SetStablePowerState(This,Enable) \ - ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) +#define ID3D12ShaderCacheSession_FindValue(This,pKey,KeySize,pValue,pValueSize) \ + ( (This)->lpVtbl -> FindValue(This,pKey,KeySize,pValue,pValueSize) ) -#define ID3D12Device8_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ - ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) +#define ID3D12ShaderCacheSession_StoreValue(This,pKey,KeySize,pValue,ValueSize) \ + ( (This)->lpVtbl -> StoreValue(This,pKey,KeySize,pValue,ValueSize) ) -#define ID3D12Device8_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ - ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#define ID3D12ShaderCacheSession_SetDeleteOnDestroy(This) \ + ( (This)->lpVtbl -> SetDeleteOnDestroy(This) ) #if !defined(_WIN32) -#define ID3D12Device8_GetAdapterLuid(This) \ - ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#define ID3D12ShaderCacheSession_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) #else -#define ID3D12Device8_GetAdapterLuid(This,RetVal) \ - ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#define ID3D12ShaderCacheSession_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) #endif +#endif /* COBJMACROS */ -#define ID3D12Device8_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ - ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) - -#define ID3D12Device8_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ - ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) - -#define ID3D12Device8_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ - ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) - - -#define ID3D12Device8_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) - - -#define ID3D12Device8_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ - ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) - -#define ID3D12Device8_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ - ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) - -#define ID3D12Device8_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ - ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) - - -#define ID3D12Device8_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ - ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) - -#define ID3D12Device8_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ - ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) - -#define ID3D12Device8_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -#define ID3D12Device8_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) +#endif /* C style interface */ -#define ID3D12Device8_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ - ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) -#if !defined(_WIN32) -#define ID3D12Device8_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) -#else -#define ID3D12Device8_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) -#endif -#define ID3D12Device8_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ - ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) +#endif /* __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ */ -#define ID3D12Device8_RemoveDevice(This) \ - ( (This)->lpVtbl -> RemoveDevice(This) ) -#define ID3D12Device8_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ - ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) +/* interface __MIDL_itf_d3d12_0000_0054 */ +/* [local] */ -#define ID3D12Device8_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ - ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) +typedef +enum D3D12_SHADER_CACHE_KIND_FLAGS + { + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CACHE_FOR_DRIVER = 0x1, + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CONVERSIONS = 0x2, + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_DRIVER_MANAGED = 0x4, + D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED = 0x8 + } D3D12_SHADER_CACHE_KIND_FLAGS; -#define ID3D12Device8_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ - ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_KIND_FLAGS ) +typedef +enum D3D12_SHADER_CACHE_CONTROL_FLAGS + { + D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE = 0x1, + D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE = 0x2, + D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR = 0x4 + } D3D12_SHADER_CACHE_CONTROL_FLAGS; -#define ID3D12Device8_CreateStateObject(This,pDesc,riid,ppStateObject) \ - ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_CONTROL_FLAGS ) -#define ID3D12Device8_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ - ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) -#define ID3D12Device8_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ - ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0054_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0054_v0_0_s_ifspec; +#ifndef __ID3D12Device9_INTERFACE_DEFINED__ +#define __ID3D12Device9_INTERFACE_DEFINED__ -#define ID3D12Device8_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ - ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) +/* interface ID3D12Device9 */ +/* [unique][local][object][uuid] */ -#define ID3D12Device8_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ - ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) +EXTERN_C const IID IID_ID3D12Device9; -#define ID3D12Device8_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ - ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4c80e962-f032-4f60-bc9e-ebc2cfa1d83c") + ID3D12Device9 : public ID3D12Device8 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateShaderCacheSession( + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession) = 0; + + virtual HRESULT STDMETHODCALLTYPE ShaderCacheControl( + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandQueue1( + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue) = 0; + + }; + + +#else /* C style interface */ + typedef struct ID3D12Device9Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device9 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device9 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device9 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device9 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device9 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device9 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device9 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device9 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device9 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device9 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device9 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device9 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device9 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device9 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device9 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device9 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device9 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device9 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) #if !defined(_WIN32) - -#define ID3D12Device8_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + #else -#define ID3D12Device8_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device9 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + #endif - -#define ID3D12Device8_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) - -#define ID3D12Device8_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) - -#define ID3D12Device8_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ - ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) - -#define ID3D12Device8_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ - ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D12Device8_INTERFACE_DEFINED__ */ - - -#ifndef __ID3D12Resource1_INTERFACE_DEFINED__ -#define __ID3D12Resource1_INTERFACE_DEFINED__ - -/* interface ID3D12Resource1 */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D12Resource1; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9D5E227A-4430-4161-88B3-3ECA6BB16E19") - ID3D12Resource1 : public ID3D12Resource - { - public: - virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device9 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device9 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device9 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device9 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device9 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device9 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device9 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device9 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device9 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device9 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device9 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device9 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device9 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device9 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device9 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device9 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device9 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device9 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device9 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device9 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, REFIID riid, - _COM_Outptr_opt_ void **ppProtectedSession) = 0; + _COM_Outptr_ void **ppCommandList); - }; - - -#else /* C style interface */ - - typedef struct ID3D12Resource1Vtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device9 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Resource1 * This, + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, REFIID riid, - _COM_Outptr_ void **ppvObject); + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Resource1 * This); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Resource1 * This); + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device9 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Resource1 * This, - _In_ REFGUID guid, - _Inout_ UINT *pDataSize, - _Out_writes_bytes_opt_( *pDataSize ) void *pData); +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device9 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Resource1 * This, - _In_ REFGUID guid, - _In_ UINT DataSize, - _In_reads_bytes_opt_( DataSize ) const void *pData); +#endif - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Resource1 * This, - _In_ REFGUID guid, - _In_opt_ const IUnknown *pData); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device9 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); - DECLSPEC_XFGVIRT(ID3D12Object, SetName) - HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Resource1 * This, - _In_z_ LPCWSTR Name); + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device9 * This); - DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) - HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12Resource1 * This, + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device9 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device9 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device9 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, REFIID riid, - _COM_Outptr_opt_ void **ppvDevice); + _COM_Outptr_ void **ppMetaCommand); - DECLSPEC_XFGVIRT(ID3D12Resource, Map) - HRESULT ( STDMETHODCALLTYPE *Map )( - ID3D12Resource1 * This, - UINT Subresource, - _In_opt_ const D3D12_RANGE *pReadRange, - _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device9 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); - DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) - void ( STDMETHODCALLTYPE *Unmap )( - ID3D12Resource1 * This, - UINT Subresource, - _In_opt_ const D3D12_RANGE *pWrittenRange); + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device9 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); - DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device9 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device9 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device9 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device9 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) #if !defined(_WIN32) - D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( - ID3D12Resource1 * This); + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device9 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); #else - D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( - ID3D12Resource1 * This, - D3D12_RESOURCE_DESC * RetVal); + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device9 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); #endif - DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) - D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( - ID3D12Resource1 * This); + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) - HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( - ID3D12Resource1 * This, - UINT DstSubresource, - _In_opt_ const D3D12_BOX *pDstBox, - _In_ const void *pSrcData, - UINT SrcRowPitch, - UINT SrcDepthPitch); + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device9 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) - HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( - ID3D12Resource1 * This, - _Out_ void *pDstData, - UINT DstRowPitch, - UINT DstDepthPitch, - UINT SrcSubresource, - _In_opt_ const D3D12_BOX *pSrcBox); + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); - DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) - HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( - ID3D12Resource1 * This, - _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, - _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device9 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession); - DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession) - HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( - ID3D12Resource1 * This, + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device9 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device9 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, REFIID riid, - _COM_Outptr_opt_ void **ppProtectedSession); + _COM_Outptr_ void **ppCommandQueue); END_INTERFACE - } ID3D12Resource1Vtbl; + } ID3D12Device9Vtbl; - interface ID3D12Resource1 + interface ID3D12Device9 { - CONST_VTBL struct ID3D12Resource1Vtbl *lpVtbl; + CONST_VTBL struct ID3D12Device9Vtbl *lpVtbl; }; @@ -18643,456 +22991,269 @@ EXTERN_C const IID IID_ID3D12Resource1; #ifdef COBJMACROS -#define ID3D12Resource1_QueryInterface(This,riid,ppvObject) \ +#define ID3D12Device9_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Resource1_AddRef(This) \ +#define ID3D12Device9_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Resource1_Release(This) \ +#define ID3D12Device9_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Resource1_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12Device9_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12Resource1_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12Device9_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12Resource1_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12Device9_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12Resource1_SetName(This,Name) \ +#define ID3D12Device9_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12Resource1_GetDevice(This,riid,ppvDevice) \ - ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) - - - -#define ID3D12Resource1_Map(This,Subresource,pReadRange,ppData) \ - ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) - -#define ID3D12Resource1_Unmap(This,Subresource,pWrittenRange) \ - ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) -#if !defined(_WIN32) - -#define ID3D12Resource1_GetDesc(This) \ - ( (This)->lpVtbl -> GetDesc(This) ) -#else -#define ID3D12Resource1_GetDesc(This,RetVal) \ - ( (This)->lpVtbl -> GetDesc(This,RetVal) ) -#endif - -#define ID3D12Resource1_GetGPUVirtualAddress(This) \ - ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) - -#define ID3D12Resource1_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ - ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) - -#define ID3D12Resource1_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ - ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) - -#define ID3D12Resource1_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ - ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) - - -#define ID3D12Resource1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ - ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - +#define ID3D12Device9_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) +#define ID3D12Device9_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) -#endif /* __ID3D12Resource1_INTERFACE_DEFINED__ */ +#define ID3D12Device9_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) +#define ID3D12Device9_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) -#ifndef __ID3D12Resource2_INTERFACE_DEFINED__ -#define __ID3D12Resource2_INTERFACE_DEFINED__ +#define ID3D12Device9_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) -/* interface ID3D12Resource2 */ -/* [unique][local][object][uuid] */ +#define ID3D12Device9_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) +#define ID3D12Device9_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) -EXTERN_C const IID IID_ID3D12Resource2; +#define ID3D12Device9_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("BE36EC3B-EA85-4AEB-A45A-E9D76404A495") - ID3D12Resource2 : public ID3D12Resource1 - { - public: -#if defined(_MSC_VER) || !defined(_WIN32) - virtual D3D12_RESOURCE_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0; -#else - virtual D3D12_RESOURCE_DESC1 *STDMETHODCALLTYPE GetDesc1( - D3D12_RESOURCE_DESC1 * RetVal) = 0; -#endif - - }; - - -#else /* C style interface */ +#define ID3D12Device9_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) - typedef struct ID3D12Resource2Vtbl - { - BEGIN_INTERFACE - - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Resource2 * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Resource2 * This); - - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Resource2 * This); - - DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Resource2 * This, - _In_ REFGUID guid, - _Inout_ UINT *pDataSize, - _Out_writes_bytes_opt_( *pDataSize ) void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Resource2 * This, - _In_ REFGUID guid, - _In_ UINT DataSize, - _In_reads_bytes_opt_( DataSize ) const void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Resource2 * This, - _In_ REFGUID guid, - _In_opt_ const IUnknown *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetName) - HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Resource2 * This, - _In_z_ LPCWSTR Name); - - DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) - HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12Resource2 * This, - REFIID riid, - _COM_Outptr_opt_ void **ppvDevice); - - DECLSPEC_XFGVIRT(ID3D12Resource, Map) - HRESULT ( STDMETHODCALLTYPE *Map )( - ID3D12Resource2 * This, - UINT Subresource, - _In_opt_ const D3D12_RANGE *pReadRange, - _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); - - DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) - void ( STDMETHODCALLTYPE *Unmap )( - ID3D12Resource2 * This, - UINT Subresource, - _In_opt_ const D3D12_RANGE *pWrittenRange); - - DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) -#if !defined(_WIN32) - D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( - ID3D12Resource2 * This); - -#else - D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( - ID3D12Resource2 * This, - D3D12_RESOURCE_DESC * RetVal); - -#endif - - DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) - D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( - ID3D12Resource2 * This); - - DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) - HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( - ID3D12Resource2 * This, - UINT DstSubresource, - _In_opt_ const D3D12_BOX *pDstBox, - _In_ const void *pSrcData, - UINT SrcRowPitch, - UINT SrcDepthPitch); - - DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) - HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( - ID3D12Resource2 * This, - _Out_ void *pDstData, - UINT DstRowPitch, - UINT DstDepthPitch, - UINT SrcSubresource, - _In_opt_ const D3D12_BOX *pSrcBox); - - DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) - HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( - ID3D12Resource2 * This, - _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, - _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); - - DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession) - HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( - ID3D12Resource2 * This, - REFIID riid, - _COM_Outptr_opt_ void **ppProtectedSession); - - DECLSPEC_XFGVIRT(ID3D12Resource2, GetDesc1) -#if !defined(_WIN32) - D3D12_RESOURCE_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )( - ID3D12Resource2 * This); - -#else - D3D12_RESOURCE_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )( - ID3D12Resource2 * This, - D3D12_RESOURCE_DESC1 * RetVal); - -#endif - - END_INTERFACE - } ID3D12Resource2Vtbl; +#define ID3D12Device9_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) - interface ID3D12Resource2 - { - CONST_VTBL struct ID3D12Resource2Vtbl *lpVtbl; - }; +#define ID3D12Device9_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) - +#define ID3D12Device9_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) -#ifdef COBJMACROS +#define ID3D12Device9_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) +#define ID3D12Device9_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Resource2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) +#define ID3D12Device9_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Resource2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) +#define ID3D12Device9_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) -#define ID3D12Resource2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) +#define ID3D12Device9_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) +#define ID3D12Device9_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) -#define ID3D12Resource2_GetPrivateData(This,guid,pDataSize,pData) \ - ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) +#define ID3D12Device9_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device9_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) -#define ID3D12Resource2_SetPrivateData(This,guid,DataSize,pData) \ - ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) +#define ID3D12Device9_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device9_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif -#define ID3D12Resource2_SetPrivateDataInterface(This,guid,pData) \ - ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) +#define ID3D12Device9_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) -#define ID3D12Resource2_SetName(This,Name) \ - ( (This)->lpVtbl -> SetName(This,Name) ) +#define ID3D12Device9_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) +#define ID3D12Device9_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Resource2_GetDevice(This,riid,ppvDevice) \ - ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) +#define ID3D12Device9_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) +#define ID3D12Device9_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) +#define ID3D12Device9_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) -#define ID3D12Resource2_Map(This,Subresource,pReadRange,ppData) \ - ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) +#define ID3D12Device9_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) -#define ID3D12Resource2_Unmap(This,Subresource,pWrittenRange) \ - ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) -#if !defined(_WIN32) +#define ID3D12Device9_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) -#define ID3D12Resource2_GetDesc(This) \ - ( (This)->lpVtbl -> GetDesc(This) ) -#else -#define ID3D12Resource2_GetDesc(This,RetVal) \ - ( (This)->lpVtbl -> GetDesc(This,RetVal) ) -#endif +#define ID3D12Device9_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) -#define ID3D12Resource2_GetGPUVirtualAddress(This) \ - ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) +#define ID3D12Device9_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) -#define ID3D12Resource2_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ - ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) +#define ID3D12Device9_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) -#define ID3D12Resource2_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ - ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) +#define ID3D12Device9_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) -#define ID3D12Resource2_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ - ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) +#define ID3D12Device9_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) +#define ID3D12Device9_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) -#define ID3D12Resource2_GetProtectedResourceSession(This,riid,ppProtectedSession) \ - ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) +#define ID3D12Device9_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) +#define ID3D12Device9_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) #if !defined(_WIN32) -#define ID3D12Resource2_GetDesc1(This) \ - ( (This)->lpVtbl -> GetDesc1(This) ) +#define ID3D12Device9_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) #else -#define ID3D12Resource2_GetDesc1(This,RetVal) \ - ( (This)->lpVtbl -> GetDesc1(This,RetVal) ) +#define ID3D12Device9_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) #endif -#endif /* COBJMACROS */ +#define ID3D12Device9_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) -#endif /* C style interface */ +#define ID3D12Device9_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) +#define ID3D12Device9_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) +#define ID3D12Device9_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) -#endif /* __ID3D12Resource2_INTERFACE_DEFINED__ */ +#define ID3D12Device9_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) -#ifndef __ID3D12Heap1_INTERFACE_DEFINED__ -#define __ID3D12Heap1_INTERFACE_DEFINED__ +#define ID3D12Device9_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) -/* interface ID3D12Heap1 */ -/* [unique][local][object][uuid] */ +#define ID3D12Device9_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) -EXTERN_C const IID IID_ID3D12Heap1; +#define ID3D12Device9_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("572F7389-2168-49E3-9693-D6DF5871BF6D") - ID3D12Heap1 : public ID3D12Heap - { - public: - virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( - REFIID riid, - _COM_Outptr_opt_ void **ppProtectedSession) = 0; - - }; - - -#else /* C style interface */ +#define ID3D12Device9_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) - typedef struct ID3D12Heap1Vtbl - { - BEGIN_INTERFACE - - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Heap1 * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Heap1 * This); - - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Heap1 * This); - - DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Heap1 * This, - _In_ REFGUID guid, - _Inout_ UINT *pDataSize, - _Out_writes_bytes_opt_( *pDataSize ) void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Heap1 * This, - _In_ REFGUID guid, - _In_ UINT DataSize, - _In_reads_bytes_opt_( DataSize ) const void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Heap1 * This, - _In_ REFGUID guid, - _In_opt_ const IUnknown *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetName) - HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Heap1 * This, - _In_z_ LPCWSTR Name); - - DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) - HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12Heap1 * This, - REFIID riid, - _COM_Outptr_opt_ void **ppvDevice); - - DECLSPEC_XFGVIRT(ID3D12Heap, GetDesc) +#define ID3D12Device9_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device9_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device9_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) #if !defined(_WIN32) - D3D12_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( - ID3D12Heap1 * This); - + +#define ID3D12Device9_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else - D3D12_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( - ID3D12Heap1 * This, - D3D12_HEAP_DESC * RetVal); - +#define ID3D12Device9_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif - - DECLSPEC_XFGVIRT(ID3D12Heap1, GetProtectedResourceSession) - HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( - ID3D12Heap1 * This, - REFIID riid, - _COM_Outptr_opt_ void **ppProtectedSession); - - END_INTERFACE - } ID3D12Heap1Vtbl; - - interface ID3D12Heap1 - { - CONST_VTBL struct ID3D12Heap1Vtbl *lpVtbl; - }; - -#ifdef COBJMACROS +#define ID3D12Device9_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) +#define ID3D12Device9_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) -#define ID3D12Heap1_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) +#define ID3D12Device9_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) -#define ID3D12Heap1_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) +#define ID3D12Device9_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) -#define ID3D12Heap1_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) +#define ID3D12Device9_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) +#define ID3D12Device9_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) -#define ID3D12Heap1_GetPrivateData(This,guid,pDataSize,pData) \ - ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) +#define ID3D12Device9_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) -#define ID3D12Heap1_SetPrivateData(This,guid,DataSize,pData) \ - ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) +#define ID3D12Device9_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) -#define ID3D12Heap1_SetPrivateDataInterface(This,guid,pData) \ - ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12Heap1_SetName(This,Name) \ - ( (This)->lpVtbl -> SetName(This,Name) ) +#define ID3D12Device9_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) -#define ID3D12Heap1_GetDevice(This,riid,ppvDevice) \ - ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) +#define ID3D12Device9_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) +#define ID3D12Device9_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) #if !defined(_WIN32) -#define ID3D12Heap1_GetDesc(This) \ - ( (This)->lpVtbl -> GetDesc(This) ) +#define ID3D12Device9_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else -#define ID3D12Heap1_GetDesc(This,RetVal) \ - ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#define ID3D12Device9_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif +#define ID3D12Device9_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device9_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Heap1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ - ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) +#define ID3D12Device9_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device9_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + + +#define ID3D12Device9_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) + +#define ID3D12Device9_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) + +#define ID3D12Device9_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) #endif /* COBJMACROS */ @@ -19102,506 +23263,736 @@ EXTERN_C const IID IID_ID3D12Heap1; -#endif /* __ID3D12Heap1_INTERFACE_DEFINED__ */ +#endif /* __ID3D12Device9_INTERFACE_DEFINED__ */ -#ifndef __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ -#define __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ +#ifndef __ID3D12Device10_INTERFACE_DEFINED__ +#define __ID3D12Device10_INTERFACE_DEFINED__ -/* interface ID3D12GraphicsCommandList3 */ +/* interface ID3D12Device10 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12GraphicsCommandList3; +EXTERN_C const IID IID_ID3D12Device10; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("6FDA83A7-B84C-4E38-9AC8-C7BD22016B3D") - ID3D12GraphicsCommandList3 : public ID3D12GraphicsCommandList2 + MIDL_INTERFACE("517f8718-aa66-49f9-b02b-a7ab89c06031") + ID3D12Device10 : public ID3D12Device9 { public: - virtual void STDMETHODCALLTYPE SetProtectedResourceSession( - _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource3( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource2( + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateReservedResource2( + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; }; #else /* C style interface */ - typedef struct ID3D12GraphicsCommandList3Vtbl + typedef struct ID3D12Device10Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12GraphicsCommandList3 * This, + ID3D12Device10 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12GraphicsCommandList3 * This); + ID3D12Device10 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12GraphicsCommandList3 * This); + ID3D12Device10 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12GraphicsCommandList3 * This, + ID3D12Device10 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12GraphicsCommandList3 * This, + ID3D12Device10 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12GraphicsCommandList3 * This, + ID3D12Device10 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12GraphicsCommandList3 * This, + ID3D12Device10 * This, _In_z_ LPCWSTR Name); - DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) - HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12GraphicsCommandList3 * This, - REFIID riid, - _COM_Outptr_opt_ void **ppvDevice); + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device10 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device10 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device10 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device10 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device10 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device10 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device10 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device10 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device10 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device10 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device10 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device10 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device10 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif - DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) - D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( - ID3D12GraphicsCommandList3 * This); + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) - HRESULT ( STDMETHODCALLTYPE *Close )( - ID3D12GraphicsCommandList3 * This); +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device10 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) - HRESULT ( STDMETHODCALLTYPE *Reset )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12CommandAllocator *pAllocator, - _In_opt_ ID3D12PipelineState *pInitialState); +#endif - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) - void ( STDMETHODCALLTYPE *ClearState )( - ID3D12GraphicsCommandList3 * This, - _In_opt_ ID3D12PipelineState *pPipelineState); + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) - void ( STDMETHODCALLTYPE *DrawInstanced )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT VertexCountPerInstance, - _In_ UINT InstanceCount, - _In_ UINT StartVertexLocation, - _In_ UINT StartInstanceLocation); + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) - void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT IndexCountPerInstance, - _In_ UINT InstanceCount, - _In_ UINT StartIndexLocation, - _In_ INT BaseVertexLocation, - _In_ UINT StartInstanceLocation); + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device10 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) - void ( STDMETHODCALLTYPE *Dispatch )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT ThreadGroupCountX, - _In_ UINT ThreadGroupCountY, - _In_ UINT ThreadGroupCountZ); + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) - void ( STDMETHODCALLTYPE *CopyBufferRegion )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12Resource *pDstBuffer, - UINT64 DstOffset, - _In_ ID3D12Resource *pSrcBuffer, - UINT64 SrcOffset, - UINT64 NumBytes); + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device10 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) - void ( STDMETHODCALLTYPE *CopyTextureRegion )( - ID3D12GraphicsCommandList3 * This, - _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, - UINT DstX, - UINT DstY, - UINT DstZ, - _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, - _In_opt_ const D3D12_BOX *pSrcBox); + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device10 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) - void ( STDMETHODCALLTYPE *CopyResource )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12Resource *pDstResource, - _In_ ID3D12Resource *pSrcResource); + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device10 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) - void ( STDMETHODCALLTYPE *CopyTiles )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12Resource *pTiledResource, - _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, - _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, - _In_ ID3D12Resource *pBuffer, - UINT64 BufferStartOffsetInBytes, - D3D12_TILE_COPY_FLAGS Flags); + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device10 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) - void ( STDMETHODCALLTYPE *ResolveSubresource )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12Resource *pDstResource, - _In_ UINT DstSubresource, - _In_ ID3D12Resource *pSrcResource, - _In_ UINT SrcSubresource, - _In_ DXGI_FORMAT Format); + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device10 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) - void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( - ID3D12GraphicsCommandList3 * This, - _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device10 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) - void ( STDMETHODCALLTYPE *RSSetViewports )( - ID3D12GraphicsCommandList3 * This, - _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, - _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device10 * This); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) - void ( STDMETHODCALLTYPE *RSSetScissorRects )( - ID3D12GraphicsCommandList3 * This, - _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, - _In_reads_( NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) - void ( STDMETHODCALLTYPE *OMSetBlendFactor )( - ID3D12GraphicsCommandList3 * This, - _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device10 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) - void ( STDMETHODCALLTYPE *OMSetStencilRef )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT StencilRef); + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device10 * This, + BOOL Enable); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) - void ( STDMETHODCALLTYPE *SetPipelineState )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12PipelineState *pPipelineState); + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device10 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) - void ( STDMETHODCALLTYPE *ResourceBarrier )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT NumBarriers, - _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device10 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) - void ( STDMETHODCALLTYPE *ExecuteBundle )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12GraphicsCommandList *pCommandList); + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device10 * This); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) - void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT NumDescriptorHeaps, - _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device10 * This, + LUID * RetVal); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) - void ( STDMETHODCALLTYPE *SetComputeRootSignature )( - ID3D12GraphicsCommandList3 * This, - _In_opt_ ID3D12RootSignature *pRootSignature); +#endif - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) - void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( - ID3D12GraphicsCommandList3 * This, - _In_opt_ ID3D12RootSignature *pRootSignature); + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device10 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) - void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device10 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) - void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device10 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) - void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ UINT SrcData, - _In_ UINT DestOffsetIn32BitValues); + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device10 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) - void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ UINT SrcData, - _In_ UINT DestOffsetIn32BitValues); + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device10 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) - void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ UINT Num32BitValuesToSet, - _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, - _In_ UINT DestOffsetIn32BitValues); + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device10 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) - void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ UINT Num32BitValuesToSet, - _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, - _In_ UINT DestOffsetIn32BitValues); + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device10 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) - void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) - void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device10 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) - void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) - void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) - void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) - void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device10 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) - void ( STDMETHODCALLTYPE *IASetIndexBuffer )( - ID3D12GraphicsCommandList3 * This, - _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device10 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) - void ( STDMETHODCALLTYPE *IASetVertexBuffers )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT StartSlot, - _In_ UINT NumViews, - _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); +#endif - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) - void ( STDMETHODCALLTYPE *SOSetTargets )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT StartSlot, - _In_ UINT NumViews, - _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device10 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) - void ( STDMETHODCALLTYPE *OMSetRenderTargets )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT NumRenderTargetDescriptors, - _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, - _In_ BOOL RTsSingleHandleToDescriptorRange, - _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device10 * This); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) - void ( STDMETHODCALLTYPE *ClearDepthStencilView )( - ID3D12GraphicsCommandList3 * This, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, - _In_ D3D12_CLEAR_FLAGS ClearFlags, - _In_ FLOAT Depth, - _In_ UINT8 Stencil, - _In_ UINT NumRects, - _In_reads_(NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device10 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) - void ( STDMETHODCALLTYPE *ClearRenderTargetView )( - ID3D12GraphicsCommandList3 * This, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, - _In_ const FLOAT ColorRGBA[ 4 ], - _In_ UINT NumRects, - _In_reads_(NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device10 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) - void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( - ID3D12GraphicsCommandList3 * This, - _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, - _In_ ID3D12Resource *pResource, - _In_ const UINT Values[ 4 ], - _In_ UINT NumRects, - _In_reads_(NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device10 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) - void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( - ID3D12GraphicsCommandList3 * This, - _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, - _In_ ID3D12Resource *pResource, - _In_ const FLOAT Values[ 4 ], - _In_ UINT NumRects, - _In_reads_(NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device10 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) - void ( STDMETHODCALLTYPE *DiscardResource )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12Resource *pResource, - _In_opt_ const D3D12_DISCARD_REGION *pRegion); + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device10 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) - void ( STDMETHODCALLTYPE *BeginQuery )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12QueryHeap *pQueryHeap, - _In_ D3D12_QUERY_TYPE Type, - _In_ UINT Index); + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device10 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) - void ( STDMETHODCALLTYPE *EndQuery )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12QueryHeap *pQueryHeap, - _In_ D3D12_QUERY_TYPE Type, - _In_ UINT Index); + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device10 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) - void ( STDMETHODCALLTYPE *ResolveQueryData )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12QueryHeap *pQueryHeap, - _In_ D3D12_QUERY_TYPE Type, - _In_ UINT StartIndex, - _In_ UINT NumQueries, - _In_ ID3D12Resource *pDestinationBuffer, - _In_ UINT64 AlignedDestinationBufferOffset); + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device10 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) - void ( STDMETHODCALLTYPE *SetPredication )( - ID3D12GraphicsCommandList3 * This, - _In_opt_ ID3D12Resource *pBuffer, - _In_ UINT64 AlignedBufferOffset, - _In_ D3D12_PREDICATION_OP Operation); + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device10 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) - void ( STDMETHODCALLTYPE *SetMarker )( - ID3D12GraphicsCommandList3 * This, - UINT Metadata, - _In_reads_bytes_opt_(Size) const void *pData, - UINT Size); + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device10 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) - void ( STDMETHODCALLTYPE *BeginEvent )( - ID3D12GraphicsCommandList3 * This, - UINT Metadata, - _In_reads_bytes_opt_(Size) const void *pData, - UINT Size); +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device10 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) - void ( STDMETHODCALLTYPE *EndEvent )( - ID3D12GraphicsCommandList3 * This); +#endif - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) - void ( STDMETHODCALLTYPE *ExecuteIndirect )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12CommandSignature *pCommandSignature, - _In_ UINT MaxCommandCount, - _In_ ID3D12Resource *pArgumentBuffer, - _In_ UINT64 ArgumentBufferOffset, - _In_opt_ ID3D12Resource *pCountBuffer, - _In_ UINT64 CountBufferOffset); + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) - void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12Resource *pDstBuffer, - UINT64 DstOffset, - _In_ ID3D12Resource *pSrcBuffer, - UINT64 SrcOffset, - UINT Dependencies, - _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, - _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device10 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) - void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12Resource *pDstBuffer, - UINT64 DstOffset, - _In_ ID3D12Resource *pSrcBuffer, - UINT64 SrcOffset, - UINT Dependencies, - _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, - _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) - void ( STDMETHODCALLTYPE *OMSetDepthBounds )( - ID3D12GraphicsCommandList3 * This, - _In_ FLOAT Min, - _In_ FLOAT Max); + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) - void ( STDMETHODCALLTYPE *SetSamplePositions )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT NumSamplesPerPixel, - _In_ UINT NumPixels, - _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device10 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) - void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( - ID3D12GraphicsCommandList3 * This, - _In_ ID3D12Resource *pDstResource, - _In_ UINT DstSubresource, - _In_ UINT DstX, - _In_ UINT DstY, - _In_ ID3D12Resource *pSrcResource, - _In_ UINT SrcSubresource, - _In_opt_ D3D12_RECT *pSrcRect, - _In_ DXGI_FORMAT Format, - _In_ D3D12_RESOLVE_MODE ResolveMode); + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device10 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) - void ( STDMETHODCALLTYPE *SetViewInstanceMask )( - ID3D12GraphicsCommandList3 * This, - _In_ UINT Mask); + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device10 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) - void ( STDMETHODCALLTYPE *WriteBufferImmediate )( - ID3D12GraphicsCommandList3 * This, - UINT Count, - _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, - _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( + ID3D12Device10 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) - void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( - ID3D12GraphicsCommandList3 * This, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); END_INTERFACE - } ID3D12GraphicsCommandList3Vtbl; + } ID3D12Device10Vtbl; - interface ID3D12GraphicsCommandList3 + interface ID3D12Device10 { - CONST_VTBL struct ID3D12GraphicsCommandList3Vtbl *lpVtbl; + CONST_VTBL struct ID3D12Device10Vtbl *lpVtbl; }; @@ -19609,1066 +24000,995 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3; #ifdef COBJMACROS -#define ID3D12GraphicsCommandList3_QueryInterface(This,riid,ppvObject) \ +#define ID3D12Device10_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12GraphicsCommandList3_AddRef(This) \ +#define ID3D12Device10_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12GraphicsCommandList3_Release(This) \ +#define ID3D12Device10_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12GraphicsCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12Device10_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12GraphicsCommandList3_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12Device10_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12GraphicsCommandList3_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12Device10_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12GraphicsCommandList3_SetName(This,Name) \ +#define ID3D12Device10_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12GraphicsCommandList3_GetDevice(This,riid,ppvDevice) \ - ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) - - -#define ID3D12GraphicsCommandList3_GetType(This) \ - ( (This)->lpVtbl -> GetType(This) ) - - -#define ID3D12GraphicsCommandList3_Close(This) \ - ( (This)->lpVtbl -> Close(This) ) - -#define ID3D12GraphicsCommandList3_Reset(This,pAllocator,pInitialState) \ - ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) - -#define ID3D12GraphicsCommandList3_ClearState(This,pPipelineState) \ - ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) - -#define ID3D12GraphicsCommandList3_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ - ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) - -#define ID3D12GraphicsCommandList3_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ - ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) - -#define ID3D12GraphicsCommandList3_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ - ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) - -#define ID3D12GraphicsCommandList3_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ - ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) - -#define ID3D12GraphicsCommandList3_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ - ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) - -#define ID3D12GraphicsCommandList3_CopyResource(This,pDstResource,pSrcResource) \ - ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) - -#define ID3D12GraphicsCommandList3_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ - ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) - -#define ID3D12GraphicsCommandList3_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ - ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) - -#define ID3D12GraphicsCommandList3_IASetPrimitiveTopology(This,PrimitiveTopology) \ - ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) - -#define ID3D12GraphicsCommandList3_RSSetViewports(This,NumViewports,pViewports) \ - ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) - -#define ID3D12GraphicsCommandList3_RSSetScissorRects(This,NumRects,pRects) \ - ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) - -#define ID3D12GraphicsCommandList3_OMSetBlendFactor(This,BlendFactor) \ - ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) - -#define ID3D12GraphicsCommandList3_OMSetStencilRef(This,StencilRef) \ - ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) - -#define ID3D12GraphicsCommandList3_SetPipelineState(This,pPipelineState) \ - ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) - -#define ID3D12GraphicsCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ - ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) - -#define ID3D12GraphicsCommandList3_ExecuteBundle(This,pCommandList) \ - ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) - -#define ID3D12GraphicsCommandList3_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ - ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) - -#define ID3D12GraphicsCommandList3_SetComputeRootSignature(This,pRootSignature) \ - ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) - -#define ID3D12GraphicsCommandList3_SetGraphicsRootSignature(This,pRootSignature) \ - ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) - -#define ID3D12GraphicsCommandList3_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ - ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) - -#define ID3D12GraphicsCommandList3_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ - ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) - -#define ID3D12GraphicsCommandList3_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ - ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) - -#define ID3D12GraphicsCommandList3_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ - ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) - -#define ID3D12GraphicsCommandList3_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ - ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) - -#define ID3D12GraphicsCommandList3_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ - ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) - -#define ID3D12GraphicsCommandList3_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) - -#define ID3D12GraphicsCommandList3_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) - -#define ID3D12GraphicsCommandList3_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) +#define ID3D12Device10_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) -#define ID3D12GraphicsCommandList3_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) +#define ID3D12Device10_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) -#define ID3D12GraphicsCommandList3_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) +#define ID3D12Device10_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) -#define ID3D12GraphicsCommandList3_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) +#define ID3D12Device10_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12GraphicsCommandList3_IASetIndexBuffer(This,pView) \ - ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) +#define ID3D12Device10_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12GraphicsCommandList3_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ - ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) +#define ID3D12Device10_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) -#define ID3D12GraphicsCommandList3_SOSetTargets(This,StartSlot,NumViews,pViews) \ - ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) +#define ID3D12Device10_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) -#define ID3D12GraphicsCommandList3_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ - ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) +#define ID3D12Device10_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) -#define ID3D12GraphicsCommandList3_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ - ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) +#define ID3D12Device10_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) -#define ID3D12GraphicsCommandList3_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ - ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) +#define ID3D12Device10_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) -#define ID3D12GraphicsCommandList3_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ - ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) +#define ID3D12Device10_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList3_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ - ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) +#define ID3D12Device10_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList3_DiscardResource(This,pResource,pRegion) \ - ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) +#define ID3D12Device10_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ - ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) +#define ID3D12Device10_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ - ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) +#define ID3D12Device10_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ - ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) +#define ID3D12Device10_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ - ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) +#define ID3D12Device10_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) -#define ID3D12GraphicsCommandList3_SetMarker(This,Metadata,pData,Size) \ - ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) +#define ID3D12Device10_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) -#define ID3D12GraphicsCommandList3_BeginEvent(This,Metadata,pData,Size) \ - ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) +#define ID3D12Device10_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device10_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) -#define ID3D12GraphicsCommandList3_EndEvent(This) \ - ( (This)->lpVtbl -> EndEvent(This) ) +#define ID3D12Device10_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device10_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif -#define ID3D12GraphicsCommandList3_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ - ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) +#define ID3D12Device10_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) +#define ID3D12Device10_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12GraphicsCommandList3_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ - ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) +#define ID3D12Device10_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12GraphicsCommandList3_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ - ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) +#define ID3D12Device10_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12GraphicsCommandList3_OMSetDepthBounds(This,Min,Max) \ - ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) +#define ID3D12Device10_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) -#define ID3D12GraphicsCommandList3_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ - ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) +#define ID3D12Device10_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) -#define ID3D12GraphicsCommandList3_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ - ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) +#define ID3D12Device10_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) -#define ID3D12GraphicsCommandList3_SetViewInstanceMask(This,Mask) \ - ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) +#define ID3D12Device10_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) +#define ID3D12Device10_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) -#define ID3D12GraphicsCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ - ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) +#define ID3D12Device10_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) +#define ID3D12Device10_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) -#define ID3D12GraphicsCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ - ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) +#define ID3D12Device10_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) -#endif /* COBJMACROS */ +#define ID3D12Device10_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) +#define ID3D12Device10_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) -#endif /* C style interface */ +#define ID3D12Device10_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) +#define ID3D12Device10_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) +#define ID3D12Device10_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device10_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif -#endif /* __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ */ +#define ID3D12Device10_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) +#define ID3D12Device10_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) -/* interface __MIDL_itf_d3d12_0000_0049 */ -/* [local] */ +#define ID3D12Device10_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) -typedef -enum D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE - { - D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD = 0, - D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD + 1 ) , - D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE + 1 ) , - D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR + 1 ) - } D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE; -typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS - { - D3D12_CLEAR_VALUE ClearValue; - } D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS; +#define ID3D12Device10_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) -typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS - { - D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE Type; - union - { - D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS Clear; - } ; - } D3D12_RENDER_PASS_BEGINNING_ACCESS; -typedef -enum D3D12_RENDER_PASS_ENDING_ACCESS_TYPE - { - D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD = 0, - D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD + 1 ) , - D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE + 1 ) , - D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE + 1 ) - } D3D12_RENDER_PASS_ENDING_ACCESS_TYPE; +#define ID3D12Device10_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) -typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS - { - UINT SrcSubresource; - UINT DstSubresource; - UINT DstX; - UINT DstY; - D3D12_RECT SrcRect; - } D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS; +#define ID3D12Device10_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) -typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS - { - ID3D12Resource *pSrcResource; - ID3D12Resource *pDstResource; - UINT SubresourceCount; - _Field_size_full_(SubresourceCount) const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS *pSubresourceParameters; - DXGI_FORMAT Format; - D3D12_RESOLVE_MODE ResolveMode; - BOOL PreserveResolveSource; - } D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS; +#define ID3D12Device10_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) -typedef struct D3D12_RENDER_PASS_ENDING_ACCESS - { - D3D12_RENDER_PASS_ENDING_ACCESS_TYPE Type; - union - { - D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS Resolve; - } ; - } D3D12_RENDER_PASS_ENDING_ACCESS; -typedef struct D3D12_RENDER_PASS_RENDER_TARGET_DESC - { - D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; - D3D12_RENDER_PASS_BEGINNING_ACCESS BeginningAccess; - D3D12_RENDER_PASS_ENDING_ACCESS EndingAccess; - } D3D12_RENDER_PASS_RENDER_TARGET_DESC; +#define ID3D12Device10_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) -typedef struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC - { - D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; - D3D12_RENDER_PASS_BEGINNING_ACCESS DepthBeginningAccess; - D3D12_RENDER_PASS_BEGINNING_ACCESS StencilBeginningAccess; - D3D12_RENDER_PASS_ENDING_ACCESS DepthEndingAccess; - D3D12_RENDER_PASS_ENDING_ACCESS StencilEndingAccess; - } D3D12_RENDER_PASS_DEPTH_STENCIL_DESC; +#define ID3D12Device10_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) -typedef -enum D3D12_RENDER_PASS_FLAGS - { - D3D12_RENDER_PASS_FLAG_NONE = 0, - D3D12_RENDER_PASS_FLAG_ALLOW_UAV_WRITES = 0x1, - D3D12_RENDER_PASS_FLAG_SUSPENDING_PASS = 0x2, - D3D12_RENDER_PASS_FLAG_RESUMING_PASS = 0x4 - } D3D12_RENDER_PASS_FLAGS; +#define ID3D12Device10_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -DEFINE_ENUM_FLAG_OPERATORS( D3D12_RENDER_PASS_FLAGS ); +#define ID3D12Device10_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) +#define ID3D12Device10_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0049_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0049_v0_0_s_ifspec; +#define ID3D12Device10_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device10_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif -#ifndef __ID3D12MetaCommand_INTERFACE_DEFINED__ -#define __ID3D12MetaCommand_INTERFACE_DEFINED__ -/* interface ID3D12MetaCommand */ -/* [unique][local][object][uuid] */ +#define ID3D12Device10_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) +#define ID3D12Device10_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) -EXTERN_C const IID IID_ID3D12MetaCommand; +#define ID3D12Device10_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("DBB84C27-36CE-4FC9-B801-F048C46AC570") - ID3D12MetaCommand : public ID3D12Pageable - { - public: - virtual UINT64 STDMETHODCALLTYPE GetRequiredParameterResourceSize( - _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, - _In_ UINT ParameterIndex) = 0; - - }; - - -#else /* C style interface */ +#define ID3D12Device10_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) - typedef struct ID3D12MetaCommandVtbl - { - BEGIN_INTERFACE - - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12MetaCommand * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12MetaCommand * This); - - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12MetaCommand * This); - - DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12MetaCommand * This, - _In_ REFGUID guid, - _Inout_ UINT *pDataSize, - _Out_writes_bytes_opt_( *pDataSize ) void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12MetaCommand * This, - _In_ REFGUID guid, - _In_ UINT DataSize, - _In_reads_bytes_opt_( DataSize ) const void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12MetaCommand * This, - _In_ REFGUID guid, - _In_opt_ const IUnknown *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetName) - HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12MetaCommand * This, - _In_z_ LPCWSTR Name); - - DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) - HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12MetaCommand * This, - REFIID riid, - _COM_Outptr_opt_ void **ppvDevice); - - DECLSPEC_XFGVIRT(ID3D12MetaCommand, GetRequiredParameterResourceSize) - UINT64 ( STDMETHODCALLTYPE *GetRequiredParameterResourceSize )( - ID3D12MetaCommand * This, - _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, - _In_ UINT ParameterIndex); - - END_INTERFACE - } ID3D12MetaCommandVtbl; +#define ID3D12Device10_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) - interface ID3D12MetaCommand - { - CONST_VTBL struct ID3D12MetaCommandVtbl *lpVtbl; - }; +#define ID3D12Device10_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) - +#define ID3D12Device10_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) -#ifdef COBJMACROS +#define ID3D12Device10_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) -#define ID3D12MetaCommand_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) +#define ID3D12Device10_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) -#define ID3D12MetaCommand_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12MetaCommand_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) +#define ID3D12Device10_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) +#define ID3D12Device10_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) -#define ID3D12MetaCommand_GetPrivateData(This,guid,pDataSize,pData) \ - ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) +#if !defined(_WIN32) -#define ID3D12MetaCommand_SetPrivateData(This,guid,DataSize,pData) \ - ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) +#define ID3D12Device10_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device10_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif -#define ID3D12MetaCommand_SetPrivateDataInterface(This,guid,pData) \ - ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) +#define ID3D12Device10_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -#define ID3D12MetaCommand_SetName(This,Name) \ - ( (This)->lpVtbl -> SetName(This,Name) ) +#define ID3D12Device10_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) +#define ID3D12Device10_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) -#define ID3D12MetaCommand_GetDevice(This,riid,ppvDevice) \ - ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) +#define ID3D12Device10_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) +#define ID3D12Device10_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) -#define ID3D12MetaCommand_GetRequiredParameterResourceSize(This,Stage,ParameterIndex) \ - ( (This)->lpVtbl -> GetRequiredParameterResourceSize(This,Stage,ParameterIndex) ) +#define ID3D12Device10_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) -#endif /* COBJMACROS */ +#define ID3D12Device10_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) -#endif /* C style interface */ +#define ID3D12Device10_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) +#define ID3D12Device10_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) +#define ID3D12Device10_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) +#endif /* COBJMACROS */ -#endif /* __ID3D12MetaCommand_INTERFACE_DEFINED__ */ +#endif /* C style interface */ -/* interface __MIDL_itf_d3d12_0000_0050 */ -/* [local] */ -typedef struct D3D12_DISPATCH_RAYS_DESC - { - D3D12_GPU_VIRTUAL_ADDRESS_RANGE RayGenerationShaderRecord; - D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE MissShaderTable; - D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE HitGroupTable; - D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE CallableShaderTable; - UINT Width; - UINT Height; - UINT Depth; - } D3D12_DISPATCH_RAYS_DESC; +#endif /* __ID3D12Device10_INTERFACE_DEFINED__ */ -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0050_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0050_v0_0_s_ifspec; -#ifndef __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ -#define __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ +#ifndef __ID3D12Device11_INTERFACE_DEFINED__ +#define __ID3D12Device11_INTERFACE_DEFINED__ -/* interface ID3D12GraphicsCommandList4 */ +/* interface ID3D12Device11 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12GraphicsCommandList4; +EXTERN_C const IID IID_ID3D12Device11; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("8754318e-d3a9-4541-98cf-645b50dc4874") - ID3D12GraphicsCommandList4 : public ID3D12GraphicsCommandList3 + MIDL_INTERFACE("5405c344-d457-444e-b4dd-2366e45aee39") + ID3D12Device11 : public ID3D12Device10 { public: - virtual void STDMETHODCALLTYPE BeginRenderPass( - _In_ UINT NumRenderTargets, - _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, - _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, - D3D12_RENDER_PASS_FLAGS Flags) = 0; - - virtual void STDMETHODCALLTYPE EndRenderPass( void) = 0; - - virtual void STDMETHODCALLTYPE InitializeMetaCommand( - _In_ ID3D12MetaCommand *pMetaCommand, - _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, - _In_ SIZE_T InitializationParametersDataSizeInBytes) = 0; - - virtual void STDMETHODCALLTYPE ExecuteMetaCommand( - _In_ ID3D12MetaCommand *pMetaCommand, - _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, - _In_ SIZE_T ExecutionParametersDataSizeInBytes) = 0; - - virtual void STDMETHODCALLTYPE BuildRaytracingAccelerationStructure( - _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, - _In_ UINT NumPostbuildInfoDescs, - _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs) = 0; - - virtual void STDMETHODCALLTYPE EmitRaytracingAccelerationStructurePostbuildInfo( - _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, - _In_ UINT NumSourceAccelerationStructures, - _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData) = 0; - - virtual void STDMETHODCALLTYPE CopyRaytracingAccelerationStructure( - _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, - _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, - _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode) = 0; - - virtual void STDMETHODCALLTYPE SetPipelineState1( - _In_ ID3D12StateObject *pStateObject) = 0; - - virtual void STDMETHODCALLTYPE DispatchRays( - _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc) = 0; + virtual void STDMETHODCALLTYPE CreateSampler2( + _In_ const D3D12_SAMPLER_DESC2 *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; }; #else /* C style interface */ - typedef struct ID3D12GraphicsCommandList4Vtbl + typedef struct ID3D12Device11Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12GraphicsCommandList4 * This, + ID3D12Device11 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12GraphicsCommandList4 * This); + ID3D12Device11 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12GraphicsCommandList4 * This); + ID3D12Device11 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12GraphicsCommandList4 * This, + ID3D12Device11 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12GraphicsCommandList4 * This, + ID3D12Device11 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12GraphicsCommandList4 * This, + ID3D12Device11 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12GraphicsCommandList4 * This, + ID3D12Device11 * This, _In_z_ LPCWSTR Name); - DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) - HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12GraphicsCommandList4 * This, + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device11 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, REFIID riid, - _COM_Outptr_opt_ void **ppvDevice); + _COM_Outptr_ void **ppCommandQueue); - DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) - D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( - ID3D12GraphicsCommandList4 * This); + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device11 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) - HRESULT ( STDMETHODCALLTYPE *Close )( - ID3D12GraphicsCommandList4 * This); + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device11 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) - HRESULT ( STDMETHODCALLTYPE *Reset )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12CommandAllocator *pAllocator, - _In_opt_ ID3D12PipelineState *pInitialState); + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device11 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) - void ( STDMETHODCALLTYPE *ClearState )( - ID3D12GraphicsCommandList4 * This, - _In_opt_ ID3D12PipelineState *pPipelineState); + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) - void ( STDMETHODCALLTYPE *DrawInstanced )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT VertexCountPerInstance, - _In_ UINT InstanceCount, - _In_ UINT StartVertexLocation, - _In_ UINT StartInstanceLocation); + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device11 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) - void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT IndexCountPerInstance, - _In_ UINT InstanceCount, - _In_ UINT StartIndexLocation, - _In_ INT BaseVertexLocation, - _In_ UINT StartInstanceLocation); + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device11 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device11 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device11 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device11 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device11 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) - void ( STDMETHODCALLTYPE *Dispatch )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT ThreadGroupCountX, - _In_ UINT ThreadGroupCountY, - _In_ UINT ThreadGroupCountZ); + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device11 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) - void ( STDMETHODCALLTYPE *CopyBufferRegion )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12Resource *pDstBuffer, - UINT64 DstOffset, - _In_ ID3D12Resource *pSrcBuffer, - UINT64 SrcOffset, - UINT64 NumBytes); + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device11 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) - void ( STDMETHODCALLTYPE *CopyTextureRegion )( - ID3D12GraphicsCommandList4 * This, - _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, - UINT DstX, - UINT DstY, - UINT DstZ, - _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, - _In_opt_ const D3D12_BOX *pSrcBox); +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device11 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) - void ( STDMETHODCALLTYPE *CopyResource )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12Resource *pDstResource, - _In_ ID3D12Resource *pSrcResource); +#endif - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) - void ( STDMETHODCALLTYPE *CopyTiles )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12Resource *pTiledResource, - _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, - _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, - _In_ ID3D12Resource *pBuffer, - UINT64 BufferStartOffsetInBytes, - D3D12_TILE_COPY_FLAGS Flags); + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) - void ( STDMETHODCALLTYPE *ResolveSubresource )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12Resource *pDstResource, - _In_ UINT DstSubresource, - _In_ ID3D12Resource *pSrcResource, - _In_ UINT SrcSubresource, - _In_ DXGI_FORMAT Format); +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device11 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) - void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( - ID3D12GraphicsCommandList4 * This, - _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); +#endif - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) - void ( STDMETHODCALLTYPE *RSSetViewports )( - ID3D12GraphicsCommandList4 * This, - _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, - _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) - void ( STDMETHODCALLTYPE *RSSetScissorRects )( - ID3D12GraphicsCommandList4 * This, - _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, - _In_reads_( NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) - void ( STDMETHODCALLTYPE *OMSetBlendFactor )( - ID3D12GraphicsCommandList4 * This, - _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device11 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) - void ( STDMETHODCALLTYPE *OMSetStencilRef )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT StencilRef); + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) - void ( STDMETHODCALLTYPE *SetPipelineState )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12PipelineState *pPipelineState); + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device11 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) - void ( STDMETHODCALLTYPE *ResourceBarrier )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT NumBarriers, - _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device11 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) - void ( STDMETHODCALLTYPE *ExecuteBundle )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12GraphicsCommandList *pCommandList); + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device11 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) - void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT NumDescriptorHeaps, - _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device11 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) - void ( STDMETHODCALLTYPE *SetComputeRootSignature )( - ID3D12GraphicsCommandList4 * This, - _In_opt_ ID3D12RootSignature *pRootSignature); + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device11 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) - void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( - ID3D12GraphicsCommandList4 * This, - _In_opt_ ID3D12RootSignature *pRootSignature); + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device11 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) - void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device11 * This); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) - void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) - void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ UINT SrcData, - _In_ UINT DestOffsetIn32BitValues); + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device11 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) - void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ UINT SrcData, - _In_ UINT DestOffsetIn32BitValues); + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device11 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device11 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) - void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ UINT Num32BitValuesToSet, - _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, - _In_ UINT DestOffsetIn32BitValues); + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device11 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) - void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ UINT Num32BitValuesToSet, - _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, - _In_ UINT DestOffsetIn32BitValues); + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device11 * This); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) - void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device11 * This, + LUID * RetVal); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) - void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); +#endif - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) - void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device11 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) - void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device11 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) - void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device11 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) - void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT RootParameterIndex, - _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device11 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) - void ( STDMETHODCALLTYPE *IASetIndexBuffer )( - ID3D12GraphicsCommandList4 * This, - _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device11 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) - void ( STDMETHODCALLTYPE *IASetVertexBuffers )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT StartSlot, - _In_ UINT NumViews, - _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device11 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) - void ( STDMETHODCALLTYPE *SOSetTargets )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT StartSlot, - _In_ UINT NumViews, - _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device11 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) - void ( STDMETHODCALLTYPE *OMSetRenderTargets )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT NumRenderTargetDescriptors, - _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, - _In_ BOOL RTsSingleHandleToDescriptorRange, - _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) - void ( STDMETHODCALLTYPE *ClearDepthStencilView )( - ID3D12GraphicsCommandList4 * This, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, - _In_ D3D12_CLEAR_FLAGS ClearFlags, - _In_ FLOAT Depth, - _In_ UINT8 Stencil, - _In_ UINT NumRects, - _In_reads_(NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device11 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) - void ( STDMETHODCALLTYPE *ClearRenderTargetView )( - ID3D12GraphicsCommandList4 * This, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, - _In_ const FLOAT ColorRGBA[ 4 ], - _In_ UINT NumRects, - _In_reads_(NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) - void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( - ID3D12GraphicsCommandList4 * This, - _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, - _In_ ID3D12Resource *pResource, - _In_ const UINT Values[ 4 ], - _In_ UINT NumRects, - _In_reads_(NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) - void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( - ID3D12GraphicsCommandList4 * This, - _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, - _In_ ID3D12Resource *pResource, - _In_ const FLOAT Values[ 4 ], - _In_ UINT NumRects, - _In_reads_(NumRects) const D3D12_RECT *pRects); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) - void ( STDMETHODCALLTYPE *DiscardResource )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12Resource *pResource, - _In_opt_ const D3D12_DISCARD_REGION *pRegion); + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device11 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) - void ( STDMETHODCALLTYPE *BeginQuery )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12QueryHeap *pQueryHeap, - _In_ D3D12_QUERY_TYPE Type, - _In_ UINT Index); +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device11 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) - void ( STDMETHODCALLTYPE *EndQuery )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12QueryHeap *pQueryHeap, - _In_ D3D12_QUERY_TYPE Type, - _In_ UINT Index); +#endif - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) - void ( STDMETHODCALLTYPE *ResolveQueryData )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12QueryHeap *pQueryHeap, - _In_ D3D12_QUERY_TYPE Type, - _In_ UINT StartIndex, - _In_ UINT NumQueries, - _In_ ID3D12Resource *pDestinationBuffer, - _In_ UINT64 AlignedDestinationBufferOffset); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device11 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) - void ( STDMETHODCALLTYPE *SetPredication )( - ID3D12GraphicsCommandList4 * This, - _In_opt_ ID3D12Resource *pBuffer, - _In_ UINT64 AlignedBufferOffset, - _In_ D3D12_PREDICATION_OP Operation); + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device11 * This); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) - void ( STDMETHODCALLTYPE *SetMarker )( - ID3D12GraphicsCommandList4 * This, - UINT Metadata, - _In_reads_bytes_opt_(Size) const void *pData, - UINT Size); + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device11 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) - void ( STDMETHODCALLTYPE *BeginEvent )( - ID3D12GraphicsCommandList4 * This, - UINT Metadata, - _In_reads_bytes_opt_(Size) const void *pData, - UINT Size); + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device11 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) - void ( STDMETHODCALLTYPE *EndEvent )( - ID3D12GraphicsCommandList4 * This); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device11 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) - void ( STDMETHODCALLTYPE *ExecuteIndirect )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12CommandSignature *pCommandSignature, - _In_ UINT MaxCommandCount, - _In_ ID3D12Resource *pArgumentBuffer, - _In_ UINT64 ArgumentBufferOffset, - _In_opt_ ID3D12Resource *pCountBuffer, - _In_ UINT64 CountBufferOffset); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device11 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) - void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12Resource *pDstBuffer, - UINT64 DstOffset, - _In_ ID3D12Resource *pSrcBuffer, - UINT64 SrcOffset, - UINT Dependencies, - _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, - _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device11 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) - void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12Resource *pDstBuffer, - UINT64 DstOffset, - _In_ ID3D12Resource *pSrcBuffer, - UINT64 SrcOffset, - UINT Dependencies, - _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, - _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device11 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) - void ( STDMETHODCALLTYPE *OMSetDepthBounds )( - ID3D12GraphicsCommandList4 * This, - _In_ FLOAT Min, - _In_ FLOAT Max); + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device11 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) - void ( STDMETHODCALLTYPE *SetSamplePositions )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT NumSamplesPerPixel, - _In_ UINT NumPixels, - _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device11 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) - void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12Resource *pDstResource, - _In_ UINT DstSubresource, - _In_ UINT DstX, - _In_ UINT DstY, - _In_ ID3D12Resource *pSrcResource, - _In_ UINT SrcSubresource, - _In_opt_ D3D12_RECT *pSrcRect, - _In_ DXGI_FORMAT Format, - _In_ D3D12_RESOLVE_MODE ResolveMode); + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device11 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) - void ( STDMETHODCALLTYPE *SetViewInstanceMask )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT Mask); + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device11 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) - void ( STDMETHODCALLTYPE *WriteBufferImmediate )( - ID3D12GraphicsCommandList4 * This, - UINT Count, - _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, - _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device11 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) - void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( - ID3D12GraphicsCommandList4 * This, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); +#endif - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) - void ( STDMETHODCALLTYPE *BeginRenderPass )( - ID3D12GraphicsCommandList4 * This, - _In_ UINT NumRenderTargets, - _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, - _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, - D3D12_RENDER_PASS_FLAGS Flags); + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) - void ( STDMETHODCALLTYPE *EndRenderPass )( - ID3D12GraphicsCommandList4 * This); + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device11 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) - void ( STDMETHODCALLTYPE *InitializeMetaCommand )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12MetaCommand *pMetaCommand, - _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, - _In_ SIZE_T InitializationParametersDataSizeInBytes); + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) - void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12MetaCommand *pMetaCommand, - _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, - _In_ SIZE_T ExecutionParametersDataSizeInBytes); + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) - void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList4 * This, - _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, - _In_ UINT NumPostbuildInfoDescs, - _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device11 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) - void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( - ID3D12GraphicsCommandList4 * This, - _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, - _In_ UINT NumSourceAccelerationStructures, - _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device11 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device11 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) - void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList4 * This, - _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, - _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, - _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) - void ( STDMETHODCALLTYPE *SetPipelineState1 )( - ID3D12GraphicsCommandList4 * This, - _In_ ID3D12StateObject *pStateObject); + DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( + ID3D12Device11 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) - void ( STDMETHODCALLTYPE *DispatchRays )( - ID3D12GraphicsCommandList4 * This, - _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2) + void ( STDMETHODCALLTYPE *CreateSampler2 )( + ID3D12Device11 * This, + _In_ const D3D12_SAMPLER_DESC2 *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); END_INTERFACE - } ID3D12GraphicsCommandList4Vtbl; + } ID3D12Device11Vtbl; - interface ID3D12GraphicsCommandList4 + interface ID3D12Device11 { - CONST_VTBL struct ID3D12GraphicsCommandList4Vtbl *lpVtbl; + CONST_VTBL struct ID3D12Device11Vtbl *lpVtbl; }; @@ -20676,799 +24996,412 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4; #ifdef COBJMACROS -#define ID3D12GraphicsCommandList4_QueryInterface(This,riid,ppvObject) \ +#define ID3D12Device11_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12GraphicsCommandList4_AddRef(This) \ +#define ID3D12Device11_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12GraphicsCommandList4_Release(This) \ +#define ID3D12Device11_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12GraphicsCommandList4_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12Device11_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12GraphicsCommandList4_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12Device11_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12GraphicsCommandList4_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12Device11_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12GraphicsCommandList4_SetName(This,Name) \ +#define ID3D12Device11_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12GraphicsCommandList4_GetDevice(This,riid,ppvDevice) \ - ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) - - -#define ID3D12GraphicsCommandList4_GetType(This) \ - ( (This)->lpVtbl -> GetType(This) ) - - -#define ID3D12GraphicsCommandList4_Close(This) \ - ( (This)->lpVtbl -> Close(This) ) - -#define ID3D12GraphicsCommandList4_Reset(This,pAllocator,pInitialState) \ - ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) - -#define ID3D12GraphicsCommandList4_ClearState(This,pPipelineState) \ - ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) - -#define ID3D12GraphicsCommandList4_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ - ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) - -#define ID3D12GraphicsCommandList4_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ - ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) - -#define ID3D12GraphicsCommandList4_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ - ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) - -#define ID3D12GraphicsCommandList4_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ - ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) - -#define ID3D12GraphicsCommandList4_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ - ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) - -#define ID3D12GraphicsCommandList4_CopyResource(This,pDstResource,pSrcResource) \ - ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) - -#define ID3D12GraphicsCommandList4_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ - ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) - -#define ID3D12GraphicsCommandList4_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ - ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) - -#define ID3D12GraphicsCommandList4_IASetPrimitiveTopology(This,PrimitiveTopology) \ - ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) - -#define ID3D12GraphicsCommandList4_RSSetViewports(This,NumViewports,pViewports) \ - ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) - -#define ID3D12GraphicsCommandList4_RSSetScissorRects(This,NumRects,pRects) \ - ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) - -#define ID3D12GraphicsCommandList4_OMSetBlendFactor(This,BlendFactor) \ - ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) - -#define ID3D12GraphicsCommandList4_OMSetStencilRef(This,StencilRef) \ - ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) - -#define ID3D12GraphicsCommandList4_SetPipelineState(This,pPipelineState) \ - ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) - -#define ID3D12GraphicsCommandList4_ResourceBarrier(This,NumBarriers,pBarriers) \ - ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) - -#define ID3D12GraphicsCommandList4_ExecuteBundle(This,pCommandList) \ - ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) - -#define ID3D12GraphicsCommandList4_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ - ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) - -#define ID3D12GraphicsCommandList4_SetComputeRootSignature(This,pRootSignature) \ - ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) - -#define ID3D12GraphicsCommandList4_SetGraphicsRootSignature(This,pRootSignature) \ - ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) - -#define ID3D12GraphicsCommandList4_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ - ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) - -#define ID3D12GraphicsCommandList4_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ - ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) - -#define ID3D12GraphicsCommandList4_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ - ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) - -#define ID3D12GraphicsCommandList4_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ - ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) - -#define ID3D12GraphicsCommandList4_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ - ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) - -#define ID3D12GraphicsCommandList4_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ - ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) - -#define ID3D12GraphicsCommandList4_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) - -#define ID3D12GraphicsCommandList4_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) - -#define ID3D12GraphicsCommandList4_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) - -#define ID3D12GraphicsCommandList4_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) - -#define ID3D12GraphicsCommandList4_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) - -#define ID3D12GraphicsCommandList4_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ - ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) - -#define ID3D12GraphicsCommandList4_IASetIndexBuffer(This,pView) \ - ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) - -#define ID3D12GraphicsCommandList4_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ - ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) - -#define ID3D12GraphicsCommandList4_SOSetTargets(This,StartSlot,NumViews,pViews) \ - ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) - -#define ID3D12GraphicsCommandList4_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ - ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) - -#define ID3D12GraphicsCommandList4_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ - ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) - -#define ID3D12GraphicsCommandList4_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ - ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) - -#define ID3D12GraphicsCommandList4_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ - ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) - -#define ID3D12GraphicsCommandList4_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ - ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) - -#define ID3D12GraphicsCommandList4_DiscardResource(This,pResource,pRegion) \ - ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) - -#define ID3D12GraphicsCommandList4_BeginQuery(This,pQueryHeap,Type,Index) \ - ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) - -#define ID3D12GraphicsCommandList4_EndQuery(This,pQueryHeap,Type,Index) \ - ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) - -#define ID3D12GraphicsCommandList4_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ - ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) - -#define ID3D12GraphicsCommandList4_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ - ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) - -#define ID3D12GraphicsCommandList4_SetMarker(This,Metadata,pData,Size) \ - ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) - -#define ID3D12GraphicsCommandList4_BeginEvent(This,Metadata,pData,Size) \ - ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) - -#define ID3D12GraphicsCommandList4_EndEvent(This) \ - ( (This)->lpVtbl -> EndEvent(This) ) - -#define ID3D12GraphicsCommandList4_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ - ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) - +#define ID3D12Device11_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) -#define ID3D12GraphicsCommandList4_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ - ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) +#define ID3D12Device11_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) -#define ID3D12GraphicsCommandList4_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ - ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) +#define ID3D12Device11_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) -#define ID3D12GraphicsCommandList4_OMSetDepthBounds(This,Min,Max) \ - ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) +#define ID3D12Device11_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12GraphicsCommandList4_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ - ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) +#define ID3D12Device11_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12GraphicsCommandList4_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ - ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) +#define ID3D12Device11_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) -#define ID3D12GraphicsCommandList4_SetViewInstanceMask(This,Mask) \ - ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) +#define ID3D12Device11_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) +#define ID3D12Device11_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) -#define ID3D12GraphicsCommandList4_WriteBufferImmediate(This,Count,pParams,pModes) \ - ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) +#define ID3D12Device11_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) +#define ID3D12Device11_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) -#define ID3D12GraphicsCommandList4_SetProtectedResourceSession(This,pProtectedResourceSession) \ - ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) +#define ID3D12Device11_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) +#define ID3D12Device11_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList4_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ - ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) +#define ID3D12Device11_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList4_EndRenderPass(This) \ - ( (This)->lpVtbl -> EndRenderPass(This) ) +#define ID3D12Device11_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList4_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ - ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) +#define ID3D12Device11_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList4_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ - ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) +#define ID3D12Device11_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) -#define ID3D12GraphicsCommandList4_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ - ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) +#define ID3D12Device11_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) -#define ID3D12GraphicsCommandList4_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ - ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) +#define ID3D12Device11_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) -#define ID3D12GraphicsCommandList4_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ - ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) +#define ID3D12Device11_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device11_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) -#define ID3D12GraphicsCommandList4_SetPipelineState1(This,pStateObject) \ - ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) +#define ID3D12Device11_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device11_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif -#define ID3D12GraphicsCommandList4_DispatchRays(This,pDesc) \ - ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) +#define ID3D12Device11_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) -#endif /* COBJMACROS */ +#define ID3D12Device11_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) +#define ID3D12Device11_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#endif /* C style interface */ +#define ID3D12Device11_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) +#define ID3D12Device11_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) +#define ID3D12Device11_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) +#define ID3D12Device11_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) -#endif /* __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ */ +#define ID3D12Device11_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) +#define ID3D12Device11_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) -/* interface __MIDL_itf_d3d12_0000_0051 */ -/* [local] */ +#define ID3D12Device11_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) -typedef -enum D3D12_SHADER_CACHE_MODE - { - D3D12_SHADER_CACHE_MODE_MEMORY = 0, - D3D12_SHADER_CACHE_MODE_DISK = ( D3D12_SHADER_CACHE_MODE_MEMORY + 1 ) - } D3D12_SHADER_CACHE_MODE; +#define ID3D12Device11_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) -typedef -enum D3D12_SHADER_CACHE_FLAGS - { - D3D12_SHADER_CACHE_FLAG_NONE = 0, - D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED = 0x1, - D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR = 0x2 - } D3D12_SHADER_CACHE_FLAGS; +#define ID3D12Device11_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) -DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_FLAGS ); -typedef struct D3D12_SHADER_CACHE_SESSION_DESC - { - GUID Identifier; - D3D12_SHADER_CACHE_MODE Mode; - D3D12_SHADER_CACHE_FLAGS Flags; - UINT MaximumInMemoryCacheSizeBytes; - UINT MaximumInMemoryCacheEntries; - UINT MaximumValueFileSizeBytes; - UINT64 Version; - } D3D12_SHADER_CACHE_SESSION_DESC; +#define ID3D12Device11_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) -typedef -enum D3D12_BARRIER_LAYOUT - { - D3D12_BARRIER_LAYOUT_UNDEFINED = 0xffffffff, - D3D12_BARRIER_LAYOUT_COMMON = 0, - D3D12_BARRIER_LAYOUT_PRESENT = 0, - D3D12_BARRIER_LAYOUT_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_PRESENT + 1 ) , - D3D12_BARRIER_LAYOUT_RENDER_TARGET = ( D3D12_BARRIER_LAYOUT_GENERIC_READ + 1 ) , - D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_RENDER_TARGET + 1 ) , - D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE = ( D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS + 1 ) , - D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE + 1 ) , - D3D12_BARRIER_LAYOUT_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ + 1 ) , - D3D12_BARRIER_LAYOUT_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_SHADER_RESOURCE + 1 ) , - D3D12_BARRIER_LAYOUT_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COPY_SOURCE + 1 ) , - D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE = ( D3D12_BARRIER_LAYOUT_COPY_DEST + 1 ) , - D3D12_BARRIER_LAYOUT_RESOLVE_DEST = ( D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE + 1 ) , - D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE = ( D3D12_BARRIER_LAYOUT_RESOLVE_DEST + 1 ) , - D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ = ( D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE + 1 ) , - D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ + 1 ) , - D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE + 1 ) , - D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ + 1 ) , - D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE + 1 ) , - D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ + 1 ) , - D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE + 1 ) , - D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON + 1 ) , - D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ + 1 ) , - D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS + 1 ) , - D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE + 1 ) , - D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE + 1 ) , - D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST + 1 ) , - D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON + 1 ) , - D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ + 1 ) , - D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS + 1 ) , - D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE + 1 ) , - D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE + 1 ) , - D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST + 1 ) - } D3D12_BARRIER_LAYOUT; +#define ID3D12Device11_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) -typedef -enum D3D12_BARRIER_SYNC - { - D3D12_BARRIER_SYNC_NONE = 0, - D3D12_BARRIER_SYNC_ALL = 0x1, - D3D12_BARRIER_SYNC_DRAW = 0x2, - D3D12_BARRIER_SYNC_INDEX_INPUT = 0x4, - D3D12_BARRIER_SYNC_VERTEX_SHADING = 0x8, - D3D12_BARRIER_SYNC_PIXEL_SHADING = 0x10, - D3D12_BARRIER_SYNC_DEPTH_STENCIL = 0x20, - D3D12_BARRIER_SYNC_RENDER_TARGET = 0x40, - D3D12_BARRIER_SYNC_COMPUTE_SHADING = 0x80, - D3D12_BARRIER_SYNC_RAYTRACING = 0x100, - D3D12_BARRIER_SYNC_COPY = 0x200, - D3D12_BARRIER_SYNC_RESOLVE = 0x400, - D3D12_BARRIER_SYNC_EXECUTE_INDIRECT = 0x800, - D3D12_BARRIER_SYNC_PREDICATION = 0x800, - D3D12_BARRIER_SYNC_ALL_SHADING = 0x1000, - D3D12_BARRIER_SYNC_NON_PIXEL_SHADING = 0x2000, - D3D12_BARRIER_SYNC_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO = 0x4000, - D3D12_BARRIER_SYNC_CLEAR_UNORDERED_ACCESS_VIEW = 0x8000, - D3D12_BARRIER_SYNC_VIDEO_DECODE = 0x100000, - D3D12_BARRIER_SYNC_VIDEO_PROCESS = 0x200000, - D3D12_BARRIER_SYNC_VIDEO_ENCODE = 0x400000, - D3D12_BARRIER_SYNC_BUILD_RAYTRACING_ACCELERATION_STRUCTURE = 0x800000, - D3D12_BARRIER_SYNC_COPY_RAYTRACING_ACCELERATION_STRUCTURE = 0x1000000, - D3D12_BARRIER_SYNC_SPLIT = 0x80000000 - } D3D12_BARRIER_SYNC; +#define ID3D12Device11_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) -DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_SYNC ); -typedef -enum D3D12_BARRIER_ACCESS - { - D3D12_BARRIER_ACCESS_COMMON = 0, - D3D12_BARRIER_ACCESS_VERTEX_BUFFER = 0x1, - D3D12_BARRIER_ACCESS_CONSTANT_BUFFER = 0x2, - D3D12_BARRIER_ACCESS_INDEX_BUFFER = 0x4, - D3D12_BARRIER_ACCESS_RENDER_TARGET = 0x8, - D3D12_BARRIER_ACCESS_UNORDERED_ACCESS = 0x10, - D3D12_BARRIER_ACCESS_DEPTH_STENCIL_WRITE = 0x20, - D3D12_BARRIER_ACCESS_DEPTH_STENCIL_READ = 0x40, - D3D12_BARRIER_ACCESS_SHADER_RESOURCE = 0x80, - D3D12_BARRIER_ACCESS_STREAM_OUTPUT = 0x100, - D3D12_BARRIER_ACCESS_INDIRECT_ARGUMENT = 0x200, - D3D12_BARRIER_ACCESS_PREDICATION = 0x200, - D3D12_BARRIER_ACCESS_COPY_DEST = 0x400, - D3D12_BARRIER_ACCESS_COPY_SOURCE = 0x800, - D3D12_BARRIER_ACCESS_RESOLVE_DEST = 0x1000, - D3D12_BARRIER_ACCESS_RESOLVE_SOURCE = 0x2000, - D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_READ = 0x4000, - D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_WRITE = 0x8000, - D3D12_BARRIER_ACCESS_SHADING_RATE_SOURCE = 0x10000, - D3D12_BARRIER_ACCESS_VIDEO_DECODE_READ = 0x20000, - D3D12_BARRIER_ACCESS_VIDEO_DECODE_WRITE = 0x40000, - D3D12_BARRIER_ACCESS_VIDEO_PROCESS_READ = 0x80000, - D3D12_BARRIER_ACCESS_VIDEO_PROCESS_WRITE = 0x100000, - D3D12_BARRIER_ACCESS_VIDEO_ENCODE_READ = 0x200000, - D3D12_BARRIER_ACCESS_VIDEO_ENCODE_WRITE = 0x400000, - D3D12_BARRIER_ACCESS_NO_ACCESS = 0x80000000 - } D3D12_BARRIER_ACCESS; +#define ID3D12Device11_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) -DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_ACCESS ); -typedef -enum D3D12_BARRIER_TYPE - { - D3D12_BARRIER_TYPE_GLOBAL = 0, - D3D12_BARRIER_TYPE_TEXTURE = ( D3D12_BARRIER_TYPE_GLOBAL + 1 ) , - D3D12_BARRIER_TYPE_BUFFER = ( D3D12_BARRIER_TYPE_TEXTURE + 1 ) - } D3D12_BARRIER_TYPE; +#define ID3D12Device11_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device11_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif -typedef -enum D3D12_TEXTURE_BARRIER_FLAGS - { - D3D12_TEXTURE_BARRIER_FLAG_NONE = 0, - D3D12_TEXTURE_BARRIER_FLAG_DISCARD = 0x1 - } D3D12_TEXTURE_BARRIER_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_TEXTURE_BARRIER_FLAGS ); -typedef struct D3D12_BARRIER_SUBRESOURCE_RANGE - { - UINT IndexOrFirstMipLevel; - UINT NumMipLevels; - UINT FirstArraySlice; - UINT NumArraySlices; - UINT FirstPlane; - UINT NumPlanes; - } D3D12_BARRIER_SUBRESOURCE_RANGE; +#define ID3D12Device11_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) -typedef struct D3D12_GLOBAL_BARRIER - { - D3D12_BARRIER_SYNC SyncBefore; - D3D12_BARRIER_SYNC SyncAfter; - D3D12_BARRIER_ACCESS AccessBefore; - D3D12_BARRIER_ACCESS AccessAfter; - } D3D12_GLOBAL_BARRIER; +#define ID3D12Device11_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) -typedef struct D3D12_TEXTURE_BARRIER - { - D3D12_BARRIER_SYNC SyncBefore; - D3D12_BARRIER_SYNC SyncAfter; - D3D12_BARRIER_ACCESS AccessBefore; - D3D12_BARRIER_ACCESS AccessAfter; - D3D12_BARRIER_LAYOUT LayoutBefore; - D3D12_BARRIER_LAYOUT LayoutAfter; - _In_ ID3D12Resource *pResource; - D3D12_BARRIER_SUBRESOURCE_RANGE Subresources; - D3D12_TEXTURE_BARRIER_FLAGS Flags; - } D3D12_TEXTURE_BARRIER; +#define ID3D12Device11_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) -typedef struct D3D12_BUFFER_BARRIER - { - D3D12_BARRIER_SYNC SyncBefore; - D3D12_BARRIER_SYNC SyncAfter; - D3D12_BARRIER_ACCESS AccessBefore; - D3D12_BARRIER_ACCESS AccessAfter; - _In_ ID3D12Resource *pResource; - UINT64 Offset; - UINT64 Size; - } D3D12_BUFFER_BARRIER; -typedef struct D3D12_BARRIER_GROUP - { - D3D12_BARRIER_TYPE Type; - UINT32 NumBarriers; - union - { - _In_reads_(NumBarriers) const D3D12_GLOBAL_BARRIER *pGlobalBarriers; - _In_reads_(NumBarriers) const D3D12_TEXTURE_BARRIER *pTextureBarriers; - _In_reads_(NumBarriers) const D3D12_BUFFER_BARRIER *pBufferBarriers; - } ; - } D3D12_BARRIER_GROUP; +#define ID3D12Device11_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) +#define ID3D12Device11_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_s_ifspec; +#define ID3D12Device11_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) -#ifndef __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ -#define __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ +#define ID3D12Device11_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) -/* interface ID3D12ShaderCacheSession */ -/* [unique][local][object][uuid] */ +#define ID3D12Device11_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) -EXTERN_C const IID IID_ID3D12ShaderCacheSession; +#define ID3D12Device11_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("28e2495d-0f64-4ae4-a6ec-129255dc49a8") - ID3D12ShaderCacheSession : public ID3D12DeviceChild - { - public: - virtual HRESULT STDMETHODCALLTYPE FindValue( - /* [annotation][in] */ - _In_reads_bytes_(KeySize) const void *pKey, - UINT KeySize, - /* [annotation][out] */ - _Out_writes_bytes_(*pValueSize) void *pValue, - _Inout_ UINT *pValueSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE StoreValue( - /* [annotation][in] */ - _In_reads_bytes_(KeySize) const void *pKey, - UINT KeySize, - /* [annotation][in] */ - _In_reads_bytes_(ValueSize) const void *pValue, - UINT ValueSize) = 0; - - virtual void STDMETHODCALLTYPE SetDeleteOnDestroy( void) = 0; - -#if defined(_MSC_VER) || !defined(_WIN32) - virtual D3D12_SHADER_CACHE_SESSION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; -#else - virtual D3D12_SHADER_CACHE_SESSION_DESC *STDMETHODCALLTYPE GetDesc( - D3D12_SHADER_CACHE_SESSION_DESC * RetVal) = 0; -#endif - - }; - - -#else /* C style interface */ +#define ID3D12Device11_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) - typedef struct ID3D12ShaderCacheSessionVtbl - { - BEGIN_INTERFACE - - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12ShaderCacheSession * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12ShaderCacheSession * This); - - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12ShaderCacheSession * This); - - DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12ShaderCacheSession * This, - _In_ REFGUID guid, - _Inout_ UINT *pDataSize, - _Out_writes_bytes_opt_( *pDataSize ) void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12ShaderCacheSession * This, - _In_ REFGUID guid, - _In_ UINT DataSize, - _In_reads_bytes_opt_( DataSize ) const void *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12ShaderCacheSession * This, - _In_ REFGUID guid, - _In_opt_ const IUnknown *pData); - - DECLSPEC_XFGVIRT(ID3D12Object, SetName) - HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12ShaderCacheSession * This, - _In_z_ LPCWSTR Name); - - DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) - HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12ShaderCacheSession * This, - REFIID riid, - _COM_Outptr_opt_ void **ppvDevice); - - DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, FindValue) - HRESULT ( STDMETHODCALLTYPE *FindValue )( - ID3D12ShaderCacheSession * This, - /* [annotation][in] */ - _In_reads_bytes_(KeySize) const void *pKey, - UINT KeySize, - /* [annotation][out] */ - _Out_writes_bytes_(*pValueSize) void *pValue, - _Inout_ UINT *pValueSize); - - DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, StoreValue) - HRESULT ( STDMETHODCALLTYPE *StoreValue )( - ID3D12ShaderCacheSession * This, - /* [annotation][in] */ - _In_reads_bytes_(KeySize) const void *pKey, - UINT KeySize, - /* [annotation][in] */ - _In_reads_bytes_(ValueSize) const void *pValue, - UINT ValueSize); - - DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, SetDeleteOnDestroy) - void ( STDMETHODCALLTYPE *SetDeleteOnDestroy )( - ID3D12ShaderCacheSession * This); - - DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, GetDesc) +#define ID3D12Device11_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device11_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) #if !defined(_WIN32) - D3D12_SHADER_CACHE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( - ID3D12ShaderCacheSession * This); - + +#define ID3D12Device11_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else - D3D12_SHADER_CACHE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( - ID3D12ShaderCacheSession * This, - D3D12_SHADER_CACHE_SESSION_DESC * RetVal); - +#define ID3D12Device11_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif - - END_INTERFACE - } ID3D12ShaderCacheSessionVtbl; - interface ID3D12ShaderCacheSession - { - CONST_VTBL struct ID3D12ShaderCacheSessionVtbl *lpVtbl; - }; - +#define ID3D12Device11_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) -#ifdef COBJMACROS +#define ID3D12Device11_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) +#define ID3D12Device11_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) -#define ID3D12ShaderCacheSession_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) +#define ID3D12Device11_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) -#define ID3D12ShaderCacheSession_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) +#define ID3D12Device11_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) -#define ID3D12ShaderCacheSession_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) +#define ID3D12Device11_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) +#define ID3D12Device11_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) -#define ID3D12ShaderCacheSession_GetPrivateData(This,guid,pDataSize,pData) \ - ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) +#define ID3D12Device11_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) -#define ID3D12ShaderCacheSession_SetPrivateData(This,guid,DataSize,pData) \ - ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12ShaderCacheSession_SetPrivateDataInterface(This,guid,pData) \ - ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) +#define ID3D12Device11_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) -#define ID3D12ShaderCacheSession_SetName(This,Name) \ - ( (This)->lpVtbl -> SetName(This,Name) ) +#define ID3D12Device11_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) -#define ID3D12ShaderCacheSession_GetDevice(This,riid,ppvDevice) \ - ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) +#define ID3D12Device11_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) +#if !defined(_WIN32) -#define ID3D12ShaderCacheSession_FindValue(This,pKey,KeySize,pValue,pValueSize) \ - ( (This)->lpVtbl -> FindValue(This,pKey,KeySize,pValue,pValueSize) ) +#define ID3D12Device11_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device11_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif -#define ID3D12ShaderCacheSession_StoreValue(This,pKey,KeySize,pValue,ValueSize) \ - ( (This)->lpVtbl -> StoreValue(This,pKey,KeySize,pValue,ValueSize) ) +#define ID3D12Device11_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device11_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device11_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device11_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + + +#define ID3D12Device11_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) -#define ID3D12ShaderCacheSession_SetDeleteOnDestroy(This) \ - ( (This)->lpVtbl -> SetDeleteOnDestroy(This) ) -#if !defined(_WIN32) +#define ID3D12Device11_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) -#define ID3D12ShaderCacheSession_GetDesc(This) \ - ( (This)->lpVtbl -> GetDesc(This) ) -#else -#define ID3D12ShaderCacheSession_GetDesc(This,RetVal) \ - ( (This)->lpVtbl -> GetDesc(This,RetVal) ) -#endif +#define ID3D12Device11_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) -#endif /* COBJMACROS */ +#define ID3D12Device11_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) -#endif /* C style interface */ +#define ID3D12Device11_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) +#define ID3D12Device11_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) +#define ID3D12Device11_CreateSampler2(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) ) -#endif /* __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ */ +#endif /* COBJMACROS */ -/* interface __MIDL_itf_d3d12_0000_0052 */ -/* [local] */ +#endif /* C style interface */ -typedef -enum D3D12_SHADER_CACHE_KIND_FLAGS - { - D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CACHE_FOR_DRIVER = 0x1, - D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CONVERSIONS = 0x2, - D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_DRIVER_MANAGED = 0x4, - D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED = 0x8 - } D3D12_SHADER_CACHE_KIND_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_KIND_FLAGS ); -typedef -enum D3D12_SHADER_CACHE_CONTROL_FLAGS - { - D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE = 0x1, - D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE = 0x2, - D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR = 0x4 - } D3D12_SHADER_CACHE_CONTROL_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_CONTROL_FLAGS ); +#endif /* __ID3D12Device11_INTERFACE_DEFINED__ */ -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_s_ifspec; -#ifndef __ID3D12Device9_INTERFACE_DEFINED__ -#define __ID3D12Device9_INTERFACE_DEFINED__ +#ifndef __ID3D12Device12_INTERFACE_DEFINED__ +#define __ID3D12Device12_INTERFACE_DEFINED__ -/* interface ID3D12Device9 */ +/* interface ID3D12Device12 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12Device9; +EXTERN_C const IID IID_ID3D12Device12; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("4c80e962-f032-4f60-bc9e-ebc2cfa1d83c") - ID3D12Device9 : public ID3D12Device8 + MIDL_INTERFACE("5af5c532-4c91-4cd0-b541-15a405395fc5") + ID3D12Device12 : public ID3D12Device11 { public: - virtual HRESULT STDMETHODCALLTYPE CreateShaderCacheSession( - _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, - REFIID riid, - _COM_Outptr_opt_ void **ppvSession) = 0; - - virtual HRESULT STDMETHODCALLTYPE ShaderCacheControl( - D3D12_SHADER_CACHE_KIND_FLAGS Kinds, - D3D12_SHADER_CACHE_CONTROL_FLAGS Control) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateCommandQueue1( - _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, - REFIID CreatorID, - REFIID riid, - _COM_Outptr_ void **ppCommandQueue) = 0; +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo3( + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats, + _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#else + virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo3( + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats, + _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#endif }; #else /* C style interface */ - typedef struct ID3D12Device9Vtbl + typedef struct ID3D12Device12Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Device9 * This, + ID3D12Device12 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Device9 * This); + ID3D12Device12 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Device9 * This); + ID3D12Device12 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_z_ LPCWSTR Name); DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) UINT ( STDMETHODCALLTYPE *GetNodeCount )( - ID3D12Device9 * This); + ID3D12Device12 * This); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppCommandQueue); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ D3D12_COMMAND_LIST_TYPE type, REFIID riid, _COM_Outptr_ void **ppCommandAllocator); DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ UINT nodeMask, _In_ D3D12_COMMAND_LIST_TYPE type, _In_ ID3D12CommandAllocator *pCommandAllocator, @@ -21478,26 +25411,26 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( - ID3D12Device9 * This, + ID3D12Device12 * This, D3D12_FEATURE Feature, _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, UINT FeatureSupportDataSize); DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, REFIID riid, _COM_Outptr_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ UINT nodeMask, _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, _In_ SIZE_T blobLengthInBytes, @@ -21506,20 +25439,20 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) void ( STDMETHODCALLTYPE *CreateConstantBufferView )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) void ( STDMETHODCALLTYPE *CreateShaderResourceView )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ ID3D12Resource *pCounterResource, _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, @@ -21527,27 +25460,27 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) void ( STDMETHODCALLTYPE *CreateRenderTargetView )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) void ( STDMETHODCALLTYPE *CreateDepthStencilView )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) void ( STDMETHODCALLTYPE *CreateSampler )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_SAMPLER_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) void ( STDMETHODCALLTYPE *CopyDescriptors )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ UINT NumDestDescriptorRanges, _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, @@ -21558,7 +25491,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ UINT NumDescriptors, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, @@ -21567,14 +25500,14 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) #if !defined(_WIN32) D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ UINT visibleMask, _In_ UINT numResourceDescs, _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); #else D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device9 * This, + ID3D12Device12 * This, D3D12_RESOURCE_ALLOCATION_INFO * RetVal, _In_ UINT visibleMask, _In_ UINT numResourceDescs, @@ -21585,13 +25518,13 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) #if !defined(_WIN32) D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ UINT nodeMask, D3D12_HEAP_TYPE heapType); #else D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device9 * This, + ID3D12Device12 * This, D3D12_HEAP_PROPERTIES * RetVal, _In_ UINT nodeMask, D3D12_HEAP_TYPE heapType); @@ -21600,7 +25533,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, _In_ const D3D12_RESOURCE_DESC *pDesc, @@ -21611,14 +25544,14 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) HRESULT ( STDMETHODCALLTYPE *CreateHeap )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_HEAP_DESC *pDesc, REFIID riid, _COM_Outptr_opt_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ ID3D12Heap *pHeap, UINT64 HeapOffset, _In_ const D3D12_RESOURCE_DESC *pDesc, @@ -21629,7 +25562,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_RESOURCE_DESC *pDesc, D3D12_RESOURCE_STATES InitialState, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, @@ -21638,7 +25571,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ ID3D12DeviceChild *pObject, _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, DWORD Access, @@ -21647,14 +25580,14 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ HANDLE NTHandle, REFIID riid, _COM_Outptr_opt_ void **ppvObj); DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ LPCWSTR Name, DWORD Access, /* [annotation][out] */ @@ -21662,19 +25595,19 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) HRESULT ( STDMETHODCALLTYPE *MakeResident )( - ID3D12Device9 * This, + ID3D12Device12 * This, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); DECLSPEC_XFGVIRT(ID3D12Device, Evict) HRESULT ( STDMETHODCALLTYPE *Evict )( - ID3D12Device9 * This, + ID3D12Device12 * This, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) HRESULT ( STDMETHODCALLTYPE *CreateFence )( - ID3D12Device9 * This, + ID3D12Device12 * This, UINT64 InitialValue, D3D12_FENCE_FLAGS Flags, REFIID riid, @@ -21682,11 +25615,11 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( - ID3D12Device9 * This); + ID3D12Device12 * This); DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) void ( STDMETHODCALLTYPE *GetCopyableFootprints )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_RESOURCE_DESC *pResourceDesc, _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, @@ -21698,19 +25631,19 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_QUERY_HEAP_DESC *pDesc, REFIID riid, _COM_Outptr_opt_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( - ID3D12Device9 * This, + ID3D12Device12 * This, BOOL Enable); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, _In_opt_ ID3D12RootSignature *pRootSignature, REFIID riid, @@ -21718,7 +25651,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) void ( STDMETHODCALLTYPE *GetResourceTiling )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ ID3D12Resource *pTiledResource, _Out_opt_ UINT *pNumTilesForEntireResource, _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, @@ -21730,18 +25663,18 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) #if !defined(_WIN32) LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device9 * This); + ID3D12Device12 * This); #else LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device9 * This, + ID3D12Device12 * This, LUID * RetVal); #endif DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_reads_(BlobLength) const void *pLibraryBlob, SIZE_T BlobLength, REFIID riid, @@ -21749,7 +25682,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_reads_(NumFences) ID3D12Fence *const *ppFences, _In_reads_(NumFences) const UINT64 *pFenceValues, UINT NumFences, @@ -21758,35 +25691,35 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( - ID3D12Device9 * This, + ID3D12Device12 * This, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( - ID3D12Device9 * This, + ID3D12Device12 * This, const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const void *pAddress, REFIID riid, _COM_Outptr_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ HANDLE hFileMapping, REFIID riid, _COM_Outptr_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( - ID3D12Device9 * This, + ID3D12Device12 * This, D3D12_RESIDENCY_FLAGS Flags, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, @@ -21795,7 +25728,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ UINT nodeMask, _In_ D3D12_COMMAND_LIST_TYPE type, _In_ D3D12_COMMAND_LIST_FLAGS flags, @@ -21804,14 +25737,14 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, _In_ REFIID riid, _COM_Outptr_ void **ppSession); DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, _In_ const D3D12_RESOURCE_DESC *pDesc, @@ -21823,7 +25756,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_HEAP_DESC *pDesc, _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, REFIID riid, @@ -21831,7 +25764,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_RESOURCE_DESC *pDesc, D3D12_RESOURCE_STATES InitialState, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, @@ -21842,7 +25775,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) #if !defined(_WIN32) D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, UINT visibleMask, UINT numResourceDescs, _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, @@ -21850,7 +25783,7 @@ EXTERN_C const IID IID_ID3D12Device9; #else D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, D3D12_RESOURCE_ALLOCATION_INFO * RetVal, UINT visibleMask, UINT numResourceDescs, @@ -21861,24 +25794,24 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ ID3D12LifetimeOwner *pOwner, REFIID riid, _COM_Outptr_ void **ppvTracker); DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) void ( STDMETHODCALLTYPE *RemoveDevice )( - ID3D12Device9 * This); + ID3D12Device12 * This); DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( - ID3D12Device9 * This, + ID3D12Device12 * This, _Inout_ UINT *pNumMetaCommands, _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ REFGUID CommandId, _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, _Out_opt_ UINT *pTotalStructureSizeInBytes, @@ -21887,7 +25820,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ REFGUID CommandId, _In_ UINT NodeMask, _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, @@ -21897,26 +25830,26 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( - ID3D12Device9 * This, + ID3D12Device12 * This, const D3D12_STATE_OBJECT_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppStateObject); DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( - ID3D12Device9 * This, + ID3D12Device12 * This, D3D12_BACKGROUND_PROCESSING_MODE Mode, D3D12_MEASUREMENTS_ACTION MeasurementsAction, _In_opt_ HANDLE hEventToSignalUponCompletion, @@ -21924,7 +25857,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( - ID3D12Device9 * This, + ID3D12Device12 * This, const D3D12_STATE_OBJECT_DESC *pAddition, ID3D12StateObject *pStateObjectToGrowFrom, REFIID riid, @@ -21932,7 +25865,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, _In_ REFIID riid, _COM_Outptr_ void **ppSession); @@ -21940,7 +25873,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) #if !defined(_WIN32) D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( - ID3D12Device9 * This, + ID3D12Device12 * This, UINT visibleMask, UINT numResourceDescs, _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, @@ -21948,7 +25881,7 @@ EXTERN_C const IID IID_ID3D12Device9; #else D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( - ID3D12Device9 * This, + ID3D12Device12 * This, D3D12_RESOURCE_ALLOCATION_INFO * RetVal, UINT visibleMask, UINT numResourceDescs, @@ -21959,7 +25892,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, _In_ const D3D12_RESOURCE_DESC1 *pDesc, @@ -21971,7 +25904,7 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ ID3D12Heap *pHeap, UINT64 HeapOffset, _In_ const D3D12_RESOURCE_DESC1 *pDesc, @@ -21982,14 +25915,14 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_opt_ ID3D12Resource *pTargetedResource, _In_opt_ ID3D12Resource *pFeedbackResource, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, @@ -22001,31 +25934,100 @@ EXTERN_C const IID IID_ID3D12Device9; DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, REFIID riid, _COM_Outptr_opt_ void **ppvSession); DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( - ID3D12Device9 * This, + ID3D12Device12 * This, D3D12_SHADER_CACHE_KIND_FLAGS Kinds, D3D12_SHADER_CACHE_CONTROL_FLAGS Control); DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( - ID3D12Device9 * This, + ID3D12Device12 * This, _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, REFIID CreatorID, REFIID riid, _COM_Outptr_ void **ppCommandQueue); + DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( + ID3D12Device12 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( + ID3D12Device12 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( + ID3D12Device12 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2) + void ( STDMETHODCALLTYPE *CreateSampler2 )( + ID3D12Device12 * This, + _In_ const D3D12_SAMPLER_DESC2 *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device12, GetResourceAllocationInfo3) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )( + ID3D12Device12 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats, + _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )( + ID3D12Device12 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats, + _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + END_INTERFACE - } ID3D12Device9Vtbl; + } ID3D12Device12Vtbl; - interface ID3D12Device9 + interface ID3D12Device12 { - CONST_VTBL struct ID3D12Device9Vtbl *lpVtbl; + CONST_VTBL struct ID3D12Device12Vtbl *lpVtbl; }; @@ -22033,270 +26035,293 @@ EXTERN_C const IID IID_ID3D12Device9; #ifdef COBJMACROS -#define ID3D12Device9_QueryInterface(This,riid,ppvObject) \ +#define ID3D12Device12_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device9_AddRef(This) \ +#define ID3D12Device12_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Device9_Release(This) \ +#define ID3D12Device12_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Device9_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12Device12_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12Device9_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12Device12_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12Device9_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12Device12_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12Device9_SetName(This,Name) \ +#define ID3D12Device12_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12Device9_GetNodeCount(This) \ +#define ID3D12Device12_GetNodeCount(This) \ ( (This)->lpVtbl -> GetNodeCount(This) ) -#define ID3D12Device9_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ +#define ID3D12Device12_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) -#define ID3D12Device9_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ +#define ID3D12Device12_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) -#define ID3D12Device9_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ +#define ID3D12Device12_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device9_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ +#define ID3D12Device12_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device9_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ +#define ID3D12Device12_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) -#define ID3D12Device9_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ +#define ID3D12Device12_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) -#define ID3D12Device9_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ +#define ID3D12Device12_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) -#define ID3D12Device9_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ +#define ID3D12Device12_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) -#define ID3D12Device9_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ +#define ID3D12Device12_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) -#define ID3D12Device9_CreateConstantBufferView(This,pDesc,DestDescriptor) \ +#define ID3D12Device12_CreateConstantBufferView(This,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) -#define ID3D12Device9_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ +#define ID3D12Device12_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device9_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ +#define ID3D12Device12_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) -#define ID3D12Device9_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ +#define ID3D12Device12_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device9_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ +#define ID3D12Device12_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device9_CreateSampler(This,pDesc,DestDescriptor) \ +#define ID3D12Device12_CreateSampler(This,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) -#define ID3D12Device9_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ +#define ID3D12Device12_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) -#define ID3D12Device9_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ +#define ID3D12Device12_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) #if !defined(_WIN32) -#define ID3D12Device9_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ +#define ID3D12Device12_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) #else -#define ID3D12Device9_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ +#define ID3D12Device12_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) #endif #if !defined(_WIN32) -#define ID3D12Device9_GetCustomHeapProperties(This,nodeMask,heapType) \ +#define ID3D12Device12_GetCustomHeapProperties(This,nodeMask,heapType) \ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) #else -#define ID3D12Device9_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ +#define ID3D12Device12_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) #endif -#define ID3D12Device9_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ +#define ID3D12Device12_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) -#define ID3D12Device9_CreateHeap(This,pDesc,riid,ppvHeap) \ +#define ID3D12Device12_CreateHeap(This,pDesc,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12Device9_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ +#define ID3D12Device12_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device9_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ +#define ID3D12Device12_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device9_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ +#define ID3D12Device12_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) -#define ID3D12Device9_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ +#define ID3D12Device12_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) -#define ID3D12Device9_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ +#define ID3D12Device12_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) -#define ID3D12Device9_MakeResident(This,NumObjects,ppObjects) \ +#define ID3D12Device12_MakeResident(This,NumObjects,ppObjects) \ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) -#define ID3D12Device9_Evict(This,NumObjects,ppObjects) \ +#define ID3D12Device12_Evict(This,NumObjects,ppObjects) \ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) -#define ID3D12Device9_CreateFence(This,InitialValue,Flags,riid,ppFence) \ +#define ID3D12Device12_CreateFence(This,InitialValue,Flags,riid,ppFence) \ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) -#define ID3D12Device9_GetDeviceRemovedReason(This) \ +#define ID3D12Device12_GetDeviceRemovedReason(This) \ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) -#define ID3D12Device9_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ +#define ID3D12Device12_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) -#define ID3D12Device9_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ +#define ID3D12Device12_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12Device9_SetStablePowerState(This,Enable) \ +#define ID3D12Device12_SetStablePowerState(This,Enable) \ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) -#define ID3D12Device9_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ +#define ID3D12Device12_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) -#define ID3D12Device9_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ +#define ID3D12Device12_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) #if !defined(_WIN32) -#define ID3D12Device9_GetAdapterLuid(This) \ +#define ID3D12Device12_GetAdapterLuid(This) \ ( (This)->lpVtbl -> GetAdapterLuid(This) ) #else -#define ID3D12Device9_GetAdapterLuid(This,RetVal) \ +#define ID3D12Device12_GetAdapterLuid(This,RetVal) \ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) #endif -#define ID3D12Device9_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ +#define ID3D12Device12_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) -#define ID3D12Device9_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ +#define ID3D12Device12_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) -#define ID3D12Device9_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ +#define ID3D12Device12_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) -#define ID3D12Device9_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ +#define ID3D12Device12_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device9_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ +#define ID3D12Device12_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) -#define ID3D12Device9_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ +#define ID3D12Device12_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) -#define ID3D12Device9_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ +#define ID3D12Device12_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) -#define ID3D12Device9_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ +#define ID3D12Device12_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) -#define ID3D12Device9_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ +#define ID3D12Device12_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) -#define ID3D12Device9_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ +#define ID3D12Device12_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -#define ID3D12Device9_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ +#define ID3D12Device12_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) -#define ID3D12Device9_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ +#define ID3D12Device12_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) #if !defined(_WIN32) -#define ID3D12Device9_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device12_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else -#define ID3D12Device9_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device12_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif -#define ID3D12Device9_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ +#define ID3D12Device12_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) -#define ID3D12Device9_RemoveDevice(This) \ +#define ID3D12Device12_RemoveDevice(This) \ ( (This)->lpVtbl -> RemoveDevice(This) ) -#define ID3D12Device9_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ +#define ID3D12Device12_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) -#define ID3D12Device9_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ +#define ID3D12Device12_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) -#define ID3D12Device9_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ +#define ID3D12Device12_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) -#define ID3D12Device9_CreateStateObject(This,pDesc,riid,ppStateObject) \ +#define ID3D12Device12_CreateStateObject(This,pDesc,riid,ppStateObject) \ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) -#define ID3D12Device9_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ +#define ID3D12Device12_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) -#define ID3D12Device9_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ +#define ID3D12Device12_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) -#define ID3D12Device9_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ +#define ID3D12Device12_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) -#define ID3D12Device9_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ +#define ID3D12Device12_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) -#define ID3D12Device9_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ +#define ID3D12Device12_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) #if !defined(_WIN32) -#define ID3D12Device9_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device12_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else -#define ID3D12Device9_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device12_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif -#define ID3D12Device9_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ +#define ID3D12Device12_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -#define ID3D12Device9_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ +#define ID3D12Device12_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device9_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ +#define ID3D12Device12_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) -#define ID3D12Device9_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ +#define ID3D12Device12_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) -#define ID3D12Device9_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ +#define ID3D12Device12_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) -#define ID3D12Device9_ShaderCacheControl(This,Kinds,Control) \ +#define ID3D12Device12_ShaderCacheControl(This,Kinds,Control) \ ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) -#define ID3D12Device9_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ +#define ID3D12Device12_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) + +#define ID3D12Device12_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) + +#define ID3D12Device12_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + +#define ID3D12Device12_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + + +#define ID3D12Device12_CreateSampler2(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) ) + +#if !defined(_WIN32) + +#define ID3D12Device12_GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) ) +#else +#define ID3D12Device12_GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) ) +#endif + #endif /* COBJMACROS */ @@ -22305,140 +26330,113 @@ EXTERN_C const IID IID_ID3D12Device9; -#endif /* __ID3D12Device9_INTERFACE_DEFINED__ */ +#endif /* __ID3D12Device12_INTERFACE_DEFINED__ */ -#ifndef __ID3D12Device10_INTERFACE_DEFINED__ -#define __ID3D12Device10_INTERFACE_DEFINED__ +#ifndef __ID3D12Device13_INTERFACE_DEFINED__ +#define __ID3D12Device13_INTERFACE_DEFINED__ -/* interface ID3D12Device10 */ +/* interface ID3D12Device13 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12Device10; +EXTERN_C const IID IID_ID3D12Device13; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("517f8718-aa66-49f9-b02b-a7ab89c06031") - ID3D12Device10 : public ID3D12Device9 + MIDL_INTERFACE("14eecffc-4df8-40f7-a118-5c816f45695e") + ID3D12Device13 : public ID3D12Device12 { public: - virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource3( - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_BARRIER_LAYOUT InitialLayout, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - UINT32 NumCastableFormats, - _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource2( - _In_ ID3D12Heap *pHeap, - UINT64 HeapOffset, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_BARRIER_LAYOUT InitialLayout, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - UINT32 NumCastableFormats, - _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateReservedResource2( - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_BARRIER_LAYOUT InitialLayout, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - UINT32 NumCastableFormats, - _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + virtual HRESULT STDMETHODCALLTYPE OpenExistingHeapFromAddress1( + _In_ const void *pAddress, + SIZE_T size, REFIID riid, - _COM_Outptr_opt_ void **ppvResource) = 0; + _COM_Outptr_ void **ppvHeap) = 0; }; #else /* C style interface */ - typedef struct ID3D12Device10Vtbl + typedef struct ID3D12Device13Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Device10 * This, + ID3D12Device13 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Device10 * This); + ID3D12Device13 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Device10 * This); + ID3D12Device13 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_z_ LPCWSTR Name); DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) UINT ( STDMETHODCALLTYPE *GetNodeCount )( - ID3D12Device10 * This); + ID3D12Device13 * This); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppCommandQueue); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ D3D12_COMMAND_LIST_TYPE type, REFIID riid, _COM_Outptr_ void **ppCommandAllocator); DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ UINT nodeMask, _In_ D3D12_COMMAND_LIST_TYPE type, _In_ ID3D12CommandAllocator *pCommandAllocator, @@ -22448,26 +26446,26 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( - ID3D12Device10 * This, + ID3D12Device13 * This, D3D12_FEATURE Feature, _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, UINT FeatureSupportDataSize); DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, REFIID riid, _COM_Outptr_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ UINT nodeMask, _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, _In_ SIZE_T blobLengthInBytes, @@ -22476,20 +26474,20 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) void ( STDMETHODCALLTYPE *CreateConstantBufferView )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) void ( STDMETHODCALLTYPE *CreateShaderResourceView )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ ID3D12Resource *pCounterResource, _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, @@ -22497,27 +26495,27 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) void ( STDMETHODCALLTYPE *CreateRenderTargetView )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) void ( STDMETHODCALLTYPE *CreateDepthStencilView )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_opt_ ID3D12Resource *pResource, _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) void ( STDMETHODCALLTYPE *CreateSampler )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_SAMPLER_DESC *pDesc, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) void ( STDMETHODCALLTYPE *CopyDescriptors )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ UINT NumDestDescriptorRanges, _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, @@ -22528,7 +26526,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ UINT NumDescriptors, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, @@ -22537,14 +26535,14 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) #if !defined(_WIN32) D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ UINT visibleMask, _In_ UINT numResourceDescs, _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); #else D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device10 * This, + ID3D12Device13 * This, D3D12_RESOURCE_ALLOCATION_INFO * RetVal, _In_ UINT visibleMask, _In_ UINT numResourceDescs, @@ -22555,13 +26553,13 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) #if !defined(_WIN32) D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ UINT nodeMask, D3D12_HEAP_TYPE heapType); #else D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device10 * This, + ID3D12Device13 * This, D3D12_HEAP_PROPERTIES * RetVal, _In_ UINT nodeMask, D3D12_HEAP_TYPE heapType); @@ -22570,7 +26568,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, _In_ const D3D12_RESOURCE_DESC *pDesc, @@ -22581,14 +26579,14 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) HRESULT ( STDMETHODCALLTYPE *CreateHeap )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_HEAP_DESC *pDesc, REFIID riid, _COM_Outptr_opt_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ ID3D12Heap *pHeap, UINT64 HeapOffset, _In_ const D3D12_RESOURCE_DESC *pDesc, @@ -22599,7 +26597,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_RESOURCE_DESC *pDesc, D3D12_RESOURCE_STATES InitialState, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, @@ -22608,7 +26606,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ ID3D12DeviceChild *pObject, _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, DWORD Access, @@ -22617,14 +26615,14 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ HANDLE NTHandle, REFIID riid, _COM_Outptr_opt_ void **ppvObj); DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ LPCWSTR Name, DWORD Access, /* [annotation][out] */ @@ -22632,19 +26630,19 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) HRESULT ( STDMETHODCALLTYPE *MakeResident )( - ID3D12Device10 * This, + ID3D12Device13 * This, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); DECLSPEC_XFGVIRT(ID3D12Device, Evict) HRESULT ( STDMETHODCALLTYPE *Evict )( - ID3D12Device10 * This, + ID3D12Device13 * This, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) HRESULT ( STDMETHODCALLTYPE *CreateFence )( - ID3D12Device10 * This, + ID3D12Device13 * This, UINT64 InitialValue, D3D12_FENCE_FLAGS Flags, REFIID riid, @@ -22652,11 +26650,11 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( - ID3D12Device10 * This); + ID3D12Device13 * This); DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) void ( STDMETHODCALLTYPE *GetCopyableFootprints )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_RESOURCE_DESC *pResourceDesc, _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, @@ -22668,19 +26666,19 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_QUERY_HEAP_DESC *pDesc, REFIID riid, _COM_Outptr_opt_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( - ID3D12Device10 * This, + ID3D12Device13 * This, BOOL Enable); DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, _In_opt_ ID3D12RootSignature *pRootSignature, REFIID riid, @@ -22688,7 +26686,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) void ( STDMETHODCALLTYPE *GetResourceTiling )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ ID3D12Resource *pTiledResource, _Out_opt_ UINT *pNumTilesForEntireResource, _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, @@ -22700,18 +26698,18 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) #if !defined(_WIN32) LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device10 * This); + ID3D12Device13 * This); #else LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device10 * This, + ID3D12Device13 * This, LUID * RetVal); #endif DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_reads_(BlobLength) const void *pLibraryBlob, SIZE_T BlobLength, REFIID riid, @@ -22719,7 +26717,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_reads_(NumFences) ID3D12Fence *const *ppFences, _In_reads_(NumFences) const UINT64 *pFenceValues, UINT NumFences, @@ -22728,35 +26726,35 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( - ID3D12Device10 * This, + ID3D12Device13 * This, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( - ID3D12Device10 * This, + ID3D12Device13 * This, const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const void *pAddress, REFIID riid, _COM_Outptr_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ HANDLE hFileMapping, REFIID riid, _COM_Outptr_ void **ppvHeap); DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( - ID3D12Device10 * This, + ID3D12Device13 * This, D3D12_RESIDENCY_FLAGS Flags, UINT NumObjects, _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, @@ -22765,7 +26763,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ UINT nodeMask, _In_ D3D12_COMMAND_LIST_TYPE type, _In_ D3D12_COMMAND_LIST_FLAGS flags, @@ -22774,14 +26772,14 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, _In_ REFIID riid, _COM_Outptr_ void **ppSession); DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, _In_ const D3D12_RESOURCE_DESC *pDesc, @@ -22793,7 +26791,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_HEAP_DESC *pDesc, _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, REFIID riid, @@ -22801,7 +26799,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_RESOURCE_DESC *pDesc, D3D12_RESOURCE_STATES InitialState, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, @@ -22812,7 +26810,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) #if !defined(_WIN32) D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, UINT visibleMask, UINT numResourceDescs, _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, @@ -22820,7 +26818,7 @@ EXTERN_C const IID IID_ID3D12Device10; #else D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, D3D12_RESOURCE_ALLOCATION_INFO * RetVal, UINT visibleMask, UINT numResourceDescs, @@ -22831,24 +26829,24 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ ID3D12LifetimeOwner *pOwner, REFIID riid, _COM_Outptr_ void **ppvTracker); DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) void ( STDMETHODCALLTYPE *RemoveDevice )( - ID3D12Device10 * This); + ID3D12Device13 * This); DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( - ID3D12Device10 * This, + ID3D12Device13 * This, _Inout_ UINT *pNumMetaCommands, _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ REFGUID CommandId, _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, _Out_opt_ UINT *pTotalStructureSizeInBytes, @@ -22857,7 +26855,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ REFGUID CommandId, _In_ UINT NodeMask, _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, @@ -22867,26 +26865,26 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( - ID3D12Device10 * This, + ID3D12Device13 * This, const D3D12_STATE_OBJECT_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppStateObject); DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( - ID3D12Device10 * This, + ID3D12Device13 * This, D3D12_BACKGROUND_PROCESSING_MODE Mode, D3D12_MEASUREMENTS_ACTION MeasurementsAction, _In_opt_ HANDLE hEventToSignalUponCompletion, @@ -22894,7 +26892,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( - ID3D12Device10 * This, + ID3D12Device13 * This, const D3D12_STATE_OBJECT_DESC *pAddition, ID3D12StateObject *pStateObjectToGrowFrom, REFIID riid, @@ -22902,7 +26900,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, _In_ REFIID riid, _COM_Outptr_ void **ppSession); @@ -22910,7 +26908,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) #if !defined(_WIN32) D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( - ID3D12Device10 * This, + ID3D12Device13 * This, UINT visibleMask, UINT numResourceDescs, _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, @@ -22918,7 +26916,7 @@ EXTERN_C const IID IID_ID3D12Device10; #else D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( - ID3D12Device10 * This, + ID3D12Device13 * This, D3D12_RESOURCE_ALLOCATION_INFO * RetVal, UINT visibleMask, UINT numResourceDescs, @@ -22929,7 +26927,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, _In_ const D3D12_RESOURCE_DESC1 *pDesc, @@ -22941,7 +26939,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ ID3D12Heap *pHeap, UINT64 HeapOffset, _In_ const D3D12_RESOURCE_DESC1 *pDesc, @@ -22952,14 +26950,14 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_opt_ ID3D12Resource *pTargetedResource, _In_opt_ ID3D12Resource *pFeedbackResource, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, @@ -22971,20 +26969,20 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, REFIID riid, _COM_Outptr_opt_ void **ppvSession); DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( - ID3D12Device10 * This, + ID3D12Device13 * This, D3D12_SHADER_CACHE_KIND_FLAGS Kinds, D3D12_SHADER_CACHE_CONTROL_FLAGS Control); DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, REFIID CreatorID, REFIID riid, @@ -22992,7 +26990,7 @@ EXTERN_C const IID IID_ID3D12Device10; DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, _In_ const D3D12_RESOURCE_DESC1 *pDesc, @@ -23000,41 +26998,79 @@ EXTERN_C const IID IID_ID3D12Device10; _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, UINT32 NumCastableFormats, - _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, REFIID riidResource, _COM_Outptr_opt_ void **ppvResource); DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ ID3D12Heap *pHeap, UINT64 HeapOffset, _In_ const D3D12_RESOURCE_DESC1 *pDesc, D3D12_BARRIER_LAYOUT InitialLayout, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, UINT32 NumCastableFormats, - _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, REFIID riid, _COM_Outptr_opt_ void **ppvResource); DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( - ID3D12Device10 * This, + ID3D12Device13 * This, _In_ const D3D12_RESOURCE_DESC *pDesc, D3D12_BARRIER_LAYOUT InitialLayout, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, UINT32 NumCastableFormats, - _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, REFIID riid, _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2) + void ( STDMETHODCALLTYPE *CreateSampler2 )( + ID3D12Device13 * This, + _In_ const D3D12_SAMPLER_DESC2 *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device12, GetResourceAllocationInfo3) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )( + ID3D12Device13 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats, + _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )( + ID3D12Device13 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats, + _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device13, OpenExistingHeapFromAddress1) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress1 )( + ID3D12Device13 * This, + _In_ const void *pAddress, + SIZE_T size, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + END_INTERFACE - } ID3D12Device10Vtbl; + } ID3D12Device13Vtbl; - interface ID3D12Device10 + interface ID3D12Device13 { - CONST_VTBL struct ID3D12Device10Vtbl *lpVtbl; + CONST_VTBL struct ID3D12Device13Vtbl *lpVtbl; }; @@ -23042,280 +27078,297 @@ EXTERN_C const IID IID_ID3D12Device10; #ifdef COBJMACROS -#define ID3D12Device10_QueryInterface(This,riid,ppvObject) \ +#define ID3D12Device13_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device10_AddRef(This) \ +#define ID3D12Device13_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Device10_Release(This) \ +#define ID3D12Device13_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Device10_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12Device13_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12Device10_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12Device13_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12Device10_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12Device13_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12Device10_SetName(This,Name) \ +#define ID3D12Device13_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12Device10_GetNodeCount(This) \ +#define ID3D12Device13_GetNodeCount(This) \ ( (This)->lpVtbl -> GetNodeCount(This) ) -#define ID3D12Device10_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ +#define ID3D12Device13_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) -#define ID3D12Device10_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ +#define ID3D12Device13_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) -#define ID3D12Device10_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ +#define ID3D12Device13_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device10_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ +#define ID3D12Device13_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device10_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ +#define ID3D12Device13_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) -#define ID3D12Device10_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ +#define ID3D12Device13_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) -#define ID3D12Device10_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ +#define ID3D12Device13_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) -#define ID3D12Device10_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ +#define ID3D12Device13_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) -#define ID3D12Device10_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ +#define ID3D12Device13_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) -#define ID3D12Device10_CreateConstantBufferView(This,pDesc,DestDescriptor) \ +#define ID3D12Device13_CreateConstantBufferView(This,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) -#define ID3D12Device10_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ +#define ID3D12Device13_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device10_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ +#define ID3D12Device13_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) -#define ID3D12Device10_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ +#define ID3D12Device13_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device10_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ +#define ID3D12Device13_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device10_CreateSampler(This,pDesc,DestDescriptor) \ +#define ID3D12Device13_CreateSampler(This,pDesc,DestDescriptor) \ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) -#define ID3D12Device10_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ +#define ID3D12Device13_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) -#define ID3D12Device10_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ +#define ID3D12Device13_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) #if !defined(_WIN32) -#define ID3D12Device10_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ +#define ID3D12Device13_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) #else -#define ID3D12Device10_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ +#define ID3D12Device13_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) #endif #if !defined(_WIN32) -#define ID3D12Device10_GetCustomHeapProperties(This,nodeMask,heapType) \ +#define ID3D12Device13_GetCustomHeapProperties(This,nodeMask,heapType) \ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) #else -#define ID3D12Device10_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ +#define ID3D12Device13_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) #endif -#define ID3D12Device10_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ +#define ID3D12Device13_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) -#define ID3D12Device10_CreateHeap(This,pDesc,riid,ppvHeap) \ +#define ID3D12Device13_CreateHeap(This,pDesc,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12Device10_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ +#define ID3D12Device13_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device10_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ +#define ID3D12Device13_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device10_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ +#define ID3D12Device13_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) -#define ID3D12Device10_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ +#define ID3D12Device13_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) -#define ID3D12Device10_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ +#define ID3D12Device13_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) -#define ID3D12Device10_MakeResident(This,NumObjects,ppObjects) \ +#define ID3D12Device13_MakeResident(This,NumObjects,ppObjects) \ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) -#define ID3D12Device10_Evict(This,NumObjects,ppObjects) \ +#define ID3D12Device13_Evict(This,NumObjects,ppObjects) \ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) -#define ID3D12Device10_CreateFence(This,InitialValue,Flags,riid,ppFence) \ +#define ID3D12Device13_CreateFence(This,InitialValue,Flags,riid,ppFence) \ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) -#define ID3D12Device10_GetDeviceRemovedReason(This) \ +#define ID3D12Device13_GetDeviceRemovedReason(This) \ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) -#define ID3D12Device10_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ +#define ID3D12Device13_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) -#define ID3D12Device10_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ +#define ID3D12Device13_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12Device10_SetStablePowerState(This,Enable) \ +#define ID3D12Device13_SetStablePowerState(This,Enable) \ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) -#define ID3D12Device10_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ +#define ID3D12Device13_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) -#define ID3D12Device10_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ +#define ID3D12Device13_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) #if !defined(_WIN32) -#define ID3D12Device10_GetAdapterLuid(This) \ +#define ID3D12Device13_GetAdapterLuid(This) \ ( (This)->lpVtbl -> GetAdapterLuid(This) ) #else -#define ID3D12Device10_GetAdapterLuid(This,RetVal) \ +#define ID3D12Device13_GetAdapterLuid(This,RetVal) \ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) #endif -#define ID3D12Device10_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ +#define ID3D12Device13_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) -#define ID3D12Device10_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ +#define ID3D12Device13_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) -#define ID3D12Device10_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ +#define ID3D12Device13_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) -#define ID3D12Device10_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ +#define ID3D12Device13_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device10_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ +#define ID3D12Device13_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) -#define ID3D12Device10_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ +#define ID3D12Device13_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) -#define ID3D12Device10_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ +#define ID3D12Device13_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) -#define ID3D12Device10_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ +#define ID3D12Device13_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) -#define ID3D12Device10_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ +#define ID3D12Device13_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) -#define ID3D12Device10_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ +#define ID3D12Device13_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -#define ID3D12Device10_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ +#define ID3D12Device13_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) -#define ID3D12Device10_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ +#define ID3D12Device13_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) #if !defined(_WIN32) -#define ID3D12Device10_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device13_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else -#define ID3D12Device10_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device13_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif -#define ID3D12Device10_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ +#define ID3D12Device13_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) -#define ID3D12Device10_RemoveDevice(This) \ +#define ID3D12Device13_RemoveDevice(This) \ ( (This)->lpVtbl -> RemoveDevice(This) ) -#define ID3D12Device10_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ +#define ID3D12Device13_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) -#define ID3D12Device10_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ +#define ID3D12Device13_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) -#define ID3D12Device10_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ +#define ID3D12Device13_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) -#define ID3D12Device10_CreateStateObject(This,pDesc,riid,ppStateObject) \ +#define ID3D12Device13_CreateStateObject(This,pDesc,riid,ppStateObject) \ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) -#define ID3D12Device10_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ +#define ID3D12Device13_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) -#define ID3D12Device10_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ +#define ID3D12Device13_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) -#define ID3D12Device10_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ +#define ID3D12Device13_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) -#define ID3D12Device10_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ +#define ID3D12Device13_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) -#define ID3D12Device10_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ +#define ID3D12Device13_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) #if !defined(_WIN32) -#define ID3D12Device10_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device13_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else -#define ID3D12Device10_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ +#define ID3D12Device13_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif -#define ID3D12Device10_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ +#define ID3D12Device13_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -#define ID3D12Device10_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ +#define ID3D12Device13_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device10_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ +#define ID3D12Device13_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) -#define ID3D12Device10_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ +#define ID3D12Device13_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) -#define ID3D12Device10_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ +#define ID3D12Device13_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) -#define ID3D12Device10_ShaderCacheControl(This,Kinds,Control) \ +#define ID3D12Device13_ShaderCacheControl(This,Kinds,Control) \ ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) -#define ID3D12Device10_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ +#define ID3D12Device13_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) -#define ID3D12Device10_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ +#define ID3D12Device13_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) -#define ID3D12Device10_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ +#define ID3D12Device13_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) -#define ID3D12Device10_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ +#define ID3D12Device13_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + +#define ID3D12Device13_CreateSampler2(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) ) + +#if !defined(_WIN32) + +#define ID3D12Device13_GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) ) +#else +#define ID3D12Device13_GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device13_OpenExistingHeapFromAddress1(This,pAddress,size,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress1(This,pAddress,size,riid,ppvHeap) ) + #endif /* COBJMACROS */ @@ -23324,713 +27377,1557 @@ EXTERN_C const IID IID_ID3D12Device10; -#endif /* __ID3D12Device10_INTERFACE_DEFINED__ */ +#endif /* __ID3D12Device13_INTERFACE_DEFINED__ */ -#ifndef __ID3D12Device11_INTERFACE_DEFINED__ -#define __ID3D12Device11_INTERFACE_DEFINED__ +#ifndef __ID3D12Device14_INTERFACE_DEFINED__ +#define __ID3D12Device14_INTERFACE_DEFINED__ -/* interface ID3D12Device11 */ +/* interface ID3D12Device14 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12Device11; +EXTERN_C const IID IID_ID3D12Device14; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("5405c344-d457-444e-b4dd-2366e45aee39") - ID3D12Device11 : public ID3D12Device10 + MIDL_INTERFACE("5f6e592d-d895-44c2-8e4a-88ad4926d323") + ID3D12Device14 : public ID3D12Device13 { public: - virtual void STDMETHODCALLTYPE CreateSampler2( - _In_ const D3D12_SAMPLER_DESC2 *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + virtual HRESULT STDMETHODCALLTYPE CreateRootSignatureFromSubobjectInLibrary( + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pLibraryBlob, + _In_ SIZE_T blobLengthInBytes, + _In_opt_ LPCWSTR subobjectName, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device14Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device14 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device14 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device14 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device14 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device14 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device14 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device14 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device14 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device14 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device14 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device14 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device14 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device14 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device14 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device14 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device14 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device14 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device14 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device14 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device14 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device14 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device14 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device14 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device14 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device14 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device14 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device14 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device14 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device14 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device14 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device14 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); - }; - - -#else /* C style interface */ - - typedef struct ID3D12Device11Vtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device14 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Device11 * This, + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device14 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riid, - _COM_Outptr_ void **ppvObject); + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Device11 * This); + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device14 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Device11 * This); + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device14 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); - DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) - HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12Device11 * This, - _In_ REFGUID guid, - _Inout_ UINT *pDataSize, - _Out_writes_bytes_opt_( *pDataSize ) void *pData); + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device14 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) - HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12Device11 * This, - _In_ REFGUID guid, - _In_ UINT DataSize, - _In_reads_bytes_opt_( DataSize ) const void *pData); + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device14 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); - DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) - HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12Device11 * This, - _In_ REFGUID guid, - _In_opt_ const IUnknown *pData); + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device14 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); - DECLSPEC_XFGVIRT(ID3D12Object, SetName) - HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12Device11 * This, - _In_z_ LPCWSTR Name); + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device14 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); - DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) - UINT ( STDMETHODCALLTYPE *GetNodeCount )( - ID3D12Device11 * This); + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device14 * This); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) - HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( - ID3D12Device11 * This, - _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device14 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device14 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, REFIID riid, - _COM_Outptr_ void **ppCommandQueue); + _COM_Outptr_opt_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) - HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( - ID3D12Device11 * This, - _In_ D3D12_COMMAND_LIST_TYPE type, + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device14 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device14 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, REFIID riid, - _COM_Outptr_ void **ppCommandAllocator); + _COM_Outptr_opt_ void **ppvCommandSignature); - DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) - HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( - ID3D12Device11 * This, - _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device14 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device14 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device14 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device14 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, REFIID riid, - _COM_Outptr_ void **ppPipelineState); + _COM_Outptr_ void **ppPipelineLibrary); - DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) - HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( - ID3D12Device11 * This, - _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device14 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device14 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device14 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, REFIID riid, _COM_Outptr_ void **ppPipelineState); - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) - HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( - ID3D12Device11 * This, + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device14 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device14 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device14 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device14 * This, _In_ UINT nodeMask, _In_ D3D12_COMMAND_LIST_TYPE type, - _In_ ID3D12CommandAllocator *pCommandAllocator, - _In_opt_ ID3D12PipelineState *pInitialState, + _In_ D3D12_COMMAND_LIST_FLAGS flags, REFIID riid, _COM_Outptr_ void **ppCommandList); - DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) - HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( - ID3D12Device11 * This, - D3D12_FEATURE Feature, - _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, - UINT FeatureSupportDataSize); + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device14 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); - DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) - HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( - ID3D12Device11 * This, - _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device14 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device14 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, REFIID riid, - _COM_Outptr_ void **ppvHeap); + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device14 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device14 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device14 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) - UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( - ID3D12Device11 * This, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); +#endif - DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) - HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( - ID3D12Device11 * This, - _In_ UINT nodeMask, - _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, - _In_ SIZE_T blobLengthInBytes, + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device14 * This, + _In_ ID3D12LifetimeOwner *pOwner, REFIID riid, - _COM_Outptr_ void **ppvRootSignature); - - DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) - void ( STDMETHODCALLTYPE *CreateConstantBufferView )( - ID3D12Device11 * This, - _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + _COM_Outptr_ void **ppvTracker); - DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) - void ( STDMETHODCALLTYPE *CreateShaderResourceView )( - ID3D12Device11 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device14 * This); - DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) - void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( - ID3D12Device11 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ ID3D12Resource *pCounterResource, - _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device14 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); - DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) - void ( STDMETHODCALLTYPE *CreateRenderTargetView )( - ID3D12Device11 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device14 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); - DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) - void ( STDMETHODCALLTYPE *CreateDepthStencilView )( - ID3D12Device11 * This, - _In_opt_ ID3D12Resource *pResource, - _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device14 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); - DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) - void ( STDMETHODCALLTYPE *CreateSampler )( - ID3D12Device11 * This, - _In_ const D3D12_SAMPLER_DESC *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device14 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); - DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) - void ( STDMETHODCALLTYPE *CopyDescriptors )( - ID3D12Device11 * This, - _In_ UINT NumDestDescriptorRanges, - _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, - _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, - _In_ UINT NumSrcDescriptorRanges, - _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, - _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device14 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); - DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) - void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( - ID3D12Device11 * This, - _In_ UINT NumDescriptors, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, - _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device14 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); - DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) -#if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device11 * This, - _In_ UINT visibleMask, - _In_ UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device14 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); -#else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( - ID3D12Device11 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - _In_ UINT visibleMask, - _In_ UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device14 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); -#endif + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device14 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); - DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) #if !defined(_WIN32) - D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device11 * This, - _In_ UINT nodeMask, - D3D12_HEAP_TYPE heapType); + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device14 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); #else - D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( - ID3D12Device11 * This, - D3D12_HEAP_PROPERTIES * RetVal, - _In_ UINT nodeMask, - D3D12_HEAP_TYPE heapType); + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device14 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); #endif - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( - ID3D12Device11 * This, + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device14 * This, _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC *pDesc, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, D3D12_RESOURCE_STATES InitialResourceState, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, REFIID riidResource, _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) - HRESULT ( STDMETHODCALLTYPE *CreateHeap )( - ID3D12Device11 * This, - _In_ const D3D12_HEAP_DESC *pDesc, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); - - DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) - HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( - ID3D12Device11 * This, + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device14 * This, _In_ ID3D12Heap *pHeap, UINT64 HeapOffset, - _In_ const D3D12_RESOURCE_DESC *pDesc, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, D3D12_RESOURCE_STATES InitialState, _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riid, _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) - HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( - ID3D12Device11 * This, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device14 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) - HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( - ID3D12Device11 * This, - _In_ ID3D12DeviceChild *pObject, - _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, - DWORD Access, - _In_opt_ LPCWSTR Name, - _Out_ HANDLE *pHandle); + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device14 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); - DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) - HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( - ID3D12Device11 * This, - _In_ HANDLE NTHandle, + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device14 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, REFIID riid, - _COM_Outptr_opt_ void **ppvObj); + _COM_Outptr_opt_ void **ppvSession); - DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) - HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( - ID3D12Device11 * This, - _In_ LPCWSTR Name, - DWORD Access, - /* [annotation][out] */ - _Out_ HANDLE *pNTHandle); + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device14 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); - DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) - HRESULT ( STDMETHODCALLTYPE *MakeResident )( - ID3D12Device11 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device14 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( + ID3D12Device14 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12Device, Evict) - HRESULT ( STDMETHODCALLTYPE *Evict )( - ID3D12Device11 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( + ID3D12Device14 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) - HRESULT ( STDMETHODCALLTYPE *CreateFence )( - ID3D12Device11 * This, - UINT64 InitialValue, - D3D12_FENCE_FLAGS Flags, + DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( + ID3D12Device14 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) const DXGI_FORMAT *pCastableFormats, REFIID riid, - _COM_Outptr_ void **ppFence); + _COM_Outptr_opt_ void **ppvResource); - DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) - HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( - ID3D12Device11 * This); + DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2) + void ( STDMETHODCALLTYPE *CreateSampler2 )( + ID3D12Device14 * This, + _In_ const D3D12_SAMPLER_DESC2 *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); - DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) - void ( STDMETHODCALLTYPE *GetCopyableFootprints )( - ID3D12Device11 * This, - _In_ const D3D12_RESOURCE_DESC *pResourceDesc, - _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, - _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, - UINT64 BaseOffset, - _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, - _Out_writes_opt_(NumSubresources) UINT *pNumRows, - _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, - _Out_opt_ UINT64 *pTotalBytes); + DECLSPEC_XFGVIRT(ID3D12Device12, GetResourceAllocationInfo3) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )( + ID3D12Device14 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats, + _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) - HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( - ID3D12Device11 * This, - _In_ const D3D12_QUERY_HEAP_DESC *pDesc, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo3 )( + ID3D12Device14 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _In_opt_count_(numResourceDescs) const UINT32 *pNumCastableFormats, + _In_opt_count_(numResourceDescs) const DXGI_FORMAT *const *ppCastableFormats, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); - DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) - HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( - ID3D12Device11 * This, - BOOL Enable); +#endif - DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) - HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( - ID3D12Device11 * This, - _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, - _In_opt_ ID3D12RootSignature *pRootSignature, + DECLSPEC_XFGVIRT(ID3D12Device13, OpenExistingHeapFromAddress1) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress1 )( + ID3D12Device14 * This, + _In_ const void *pAddress, + SIZE_T size, REFIID riid, - _COM_Outptr_opt_ void **ppvCommandSignature); + _COM_Outptr_ void **ppvHeap); - DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) - void ( STDMETHODCALLTYPE *GetResourceTiling )( - ID3D12Device11 * This, - _In_ ID3D12Resource *pTiledResource, - _Out_opt_ UINT *pNumTilesForEntireResource, - _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, - _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, - _Inout_opt_ UINT *pNumSubresourceTilings, - _In_ UINT FirstSubresourceTilingToGet, - _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + DECLSPEC_XFGVIRT(ID3D12Device14, CreateRootSignatureFromSubobjectInLibrary) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignatureFromSubobjectInLibrary )( + ID3D12Device14 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pLibraryBlob, + _In_ SIZE_T blobLengthInBytes, + _In_opt_ LPCWSTR subobjectName, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); - DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) + END_INTERFACE + } ID3D12Device14Vtbl; + + interface ID3D12Device14 + { + CONST_VTBL struct ID3D12Device14Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device14_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device14_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device14_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device14_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device14_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device14_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device14_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device14_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device14_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device14_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device14_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device14_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device14_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device14_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device14_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device14_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device14_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device14_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device14_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device14_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device14_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device14_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device14_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device14_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device14_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device14_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device14_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device14_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device14_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device14_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device14_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device14_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device14_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device14_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device14_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device14_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device14_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device14_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device14_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device14_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device14_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device14_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device14_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device14_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device14_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device14_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device14_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device14_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device14_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device14_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device14_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device14_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device14_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device14_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device14_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device14_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device14_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device14_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device14_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device14_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device14_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device14_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device14_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device14_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device14_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device14_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device14_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device14_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device14_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device14_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device14_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device14_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + #if !defined(_WIN32) - LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device11 * This); - + +#define ID3D12Device14_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #else - LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( - ID3D12Device11 * This, - LUID * RetVal); - +#define ID3D12Device14_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) #endif + +#define ID3D12Device14_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device14_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device14_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device14_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + + +#define ID3D12Device14_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) + +#define ID3D12Device14_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) + +#define ID3D12Device14_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) + + +#define ID3D12Device14_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) + +#define ID3D12Device14_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + +#define ID3D12Device14_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + + +#define ID3D12Device14_CreateSampler2(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) ) + +#if !defined(_WIN32) + +#define ID3D12Device14_GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) ) +#else +#define ID3D12Device14_GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo3(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pNumCastableFormats,ppCastableFormats,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device14_OpenExistingHeapFromAddress1(This,pAddress,size,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress1(This,pAddress,size,riid,ppvHeap) ) + + +#define ID3D12Device14_CreateRootSignatureFromSubobjectInLibrary(This,nodeMask,pLibraryBlob,blobLengthInBytes,subobjectName,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignatureFromSubobjectInLibrary(This,nodeMask,pLibraryBlob,blobLengthInBytes,subobjectName,riid,ppvRootSignature) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device14_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ +#define __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ + +/* interface ID3D12VirtualizationGuestDevice */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VirtualizationGuestDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("bc66d368-7373-4943-8757-fc87dc79e476") + ID3D12VirtualizationGuestDevice : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE ShareWithHost( + _In_ ID3D12DeviceChild *pObject, + _Out_ HANDLE *pHandle) = 0; - DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) - HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( - ID3D12Device11 * This, - _In_reads_(BlobLength) const void *pLibraryBlob, - SIZE_T BlobLength, - REFIID riid, - _COM_Outptr_ void **ppPipelineLibrary); - - DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) - HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( - ID3D12Device11 * This, - _In_reads_(NumFences) ID3D12Fence *const *ppFences, - _In_reads_(NumFences) const UINT64 *pFenceValues, - UINT NumFences, - D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, - HANDLE hEvent); - - DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) - HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( - ID3D12Device11 * This, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, - _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); - - DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) - HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( - ID3D12Device11 * This, - const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppPipelineState); - - DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) - HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( - ID3D12Device11 * This, - _In_ const void *pAddress, - REFIID riid, - _COM_Outptr_ void **ppvHeap); - - DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) - HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( - ID3D12Device11 * This, - _In_ HANDLE hFileMapping, - REFIID riid, - _COM_Outptr_ void **ppvHeap); + virtual HRESULT STDMETHODCALLTYPE CreateFenceFd( + _In_ ID3D12Fence *pFence, + UINT64 FenceValue, + _Out_ int *pFenceFd) = 0; - DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) - HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( - ID3D12Device11 * This, - D3D12_RESIDENCY_FLAGS Flags, - UINT NumObjects, - _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, - _In_ ID3D12Fence *pFenceToSignal, - UINT64 FenceValueToSignal); + }; + + +#else /* C style interface */ + + typedef struct ID3D12VirtualizationGuestDeviceVtbl + { + BEGIN_INTERFACE - DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) - HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( - ID3D12Device11 * This, - _In_ UINT nodeMask, - _In_ D3D12_COMMAND_LIST_TYPE type, - _In_ D3D12_COMMAND_LIST_FLAGS flags, + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VirtualizationGuestDevice * This, REFIID riid, - _COM_Outptr_ void **ppCommandList); + _COM_Outptr_ void **ppvObject); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) - HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( - ID3D12Device11 * This, - _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, - _In_ REFIID riid, - _COM_Outptr_ void **ppSession); + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VirtualizationGuestDevice * This); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( - ID3D12Device11 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VirtualizationGuestDevice * This); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) - HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( - ID3D12Device11 * This, - _In_ const D3D12_HEAP_DESC *pDesc, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riid, - _COM_Outptr_opt_ void **ppvHeap); + DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, ShareWithHost) + HRESULT ( STDMETHODCALLTYPE *ShareWithHost )( + ID3D12VirtualizationGuestDevice * This, + _In_ ID3D12DeviceChild *pObject, + _Out_ HANDLE *pHandle); - DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) - HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( - ID3D12Device11 * This, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, CreateFenceFd) + HRESULT ( STDMETHODCALLTYPE *CreateFenceFd )( + ID3D12VirtualizationGuestDevice * This, + _In_ ID3D12Fence *pFence, + UINT64 FenceValue, + _Out_ int *pFenceFd); - DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) -#if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device11 * This, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + END_INTERFACE + } ID3D12VirtualizationGuestDeviceVtbl; + + interface ID3D12VirtualizationGuestDevice + { + CONST_VTBL struct ID3D12VirtualizationGuestDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VirtualizationGuestDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VirtualizationGuestDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VirtualizationGuestDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VirtualizationGuestDevice_ShareWithHost(This,pObject,pHandle) \ + ( (This)->lpVtbl -> ShareWithHost(This,pObject,pHandle) ) + +#define ID3D12VirtualizationGuestDevice_CreateFenceFd(This,pFence,FenceValue,pFenceFd) \ + ( (This)->lpVtbl -> CreateFenceFd(This,pFence,FenceValue,pFenceFd) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Tools_INTERFACE_DEFINED__ +#define __ID3D12Tools_INTERFACE_DEFINED__ + +/* interface ID3D12Tools */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Tools; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7071e1f0-e84b-4b33-974f-12fa49de65c5") + ID3D12Tools : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE EnableShaderInstrumentation( + BOOL bEnable) = 0; -#else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( - ID3D12Device11 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + virtual BOOL STDMETHODCALLTYPE ShaderInstrumentationEnabled( void) = 0; -#endif + }; + + +#else /* C style interface */ + + typedef struct ID3D12ToolsVtbl + { + BEGIN_INTERFACE - DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) - HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( - ID3D12Device11 * This, - _In_ ID3D12LifetimeOwner *pOwner, + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Tools * This, REFIID riid, - _COM_Outptr_ void **ppvTracker); - - DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) - void ( STDMETHODCALLTYPE *RemoveDevice )( - ID3D12Device11 * This); - - DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) - HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( - ID3D12Device11 * This, - _Inout_ UINT *pNumMetaCommands, - _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + _COM_Outptr_ void **ppvObject); - DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) - HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( - ID3D12Device11 * This, - _In_ REFGUID CommandId, - _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, - _Out_opt_ UINT *pTotalStructureSizeInBytes, - _Inout_ UINT *pParameterCount, - _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Tools * This); - DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) - HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( - ID3D12Device11 * This, - _In_ REFGUID CommandId, - _In_ UINT NodeMask, - _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, - _In_ SIZE_T CreationParametersDataSizeInBytes, - REFIID riid, - _COM_Outptr_ void **ppMetaCommand); + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Tools * This); - DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) - HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( - ID3D12Device11 * This, - const D3D12_STATE_OBJECT_DESC *pDesc, - REFIID riid, - _COM_Outptr_ void **ppStateObject); + DECLSPEC_XFGVIRT(ID3D12Tools, EnableShaderInstrumentation) + void ( STDMETHODCALLTYPE *EnableShaderInstrumentation )( + ID3D12Tools * This, + BOOL bEnable); - DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) - void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( - ID3D12Device11 * This, - _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, - _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + DECLSPEC_XFGVIRT(ID3D12Tools, ShaderInstrumentationEnabled) + BOOL ( STDMETHODCALLTYPE *ShaderInstrumentationEnabled )( + ID3D12Tools * This); - DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) - D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( - ID3D12Device11 * This, - _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, - _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + END_INTERFACE + } ID3D12ToolsVtbl; + + interface ID3D12Tools + { + CONST_VTBL struct ID3D12ToolsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Tools_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Tools_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Tools_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Tools_EnableShaderInstrumentation(This,bEnable) \ + ( (This)->lpVtbl -> EnableShaderInstrumentation(This,bEnable) ) + +#define ID3D12Tools_ShaderInstrumentationEnabled(This) \ + ( (This)->lpVtbl -> ShaderInstrumentationEnabled(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Tools_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0062 */ +/* [local] */ + +typedef struct D3D12_SUBRESOURCE_DATA + { + const void *pData; + LONG_PTR RowPitch; + LONG_PTR SlicePitch; + } D3D12_SUBRESOURCE_DATA; + +typedef struct D3D12_MEMCPY_DEST + { + void *pData; + SIZE_T RowPitch; + SIZE_T SlicePitch; + } D3D12_MEMCPY_DEST; + +#if !defined( D3D12_IGNORE_SDK_LAYERS ) +#include "d3d12sdklayers.h" +#endif + +/////////////////////////////////////////////////////////////////////////// +// D3D12CreateDevice +// ------------------ +// +// pAdapter +// If NULL, D3D12CreateDevice will choose the primary adapter. +// If non-NULL, D3D12CreateDevice will use the provided adapter. +// MinimumFeatureLevel +// The minimum feature level required for successful device creation. +// riid +// The interface IID of the device to be returned. Expected: ID3D12Device. +// ppDevice +// Pointer to returned interface. May be NULL. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory1 +// IDXGIFactory::EnumAdapters +// D3D12CreateDevice +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D12_CREATE_DEVICE)( _In_opt_ IUnknown*, + D3D_FEATURE_LEVEL, + _In_ REFIID, _COM_Outptr_opt_ void** ); + +HRESULT WINAPI D3D12CreateDevice( + _In_opt_ IUnknown* pAdapter, + D3D_FEATURE_LEVEL MinimumFeatureLevel, + _In_ REFIID riid, // Expected: ID3D12Device + _COM_Outptr_opt_ void** ppDevice ); + + +typedef HRESULT (WINAPI* PFN_D3D12_GET_DEBUG_INTERFACE)( _In_ REFIID, _COM_Outptr_opt_ void** ); + +HRESULT WINAPI D3D12GetDebugInterface( _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug ); + +// -------------------------------------------------------------------------------------------------------------------------------- +// D3D12EnableExperimentalFeatures +// +// Pass in a list of feature GUIDs to be enabled together. +// +// If a particular feature requires some configuration information on enablement, it will have +// a configuration struct that can be passed alongside the GUID. +// +// Some features might use an interface IID as the GUID. For these, once the feature is enabled via +// D3D12EnableExperimentalFeatures, D3D12GetDebugInterface can then be called with the IID to retrieve the interface +// for manipulating the feature. This allows for control that might not cleanly be expressed by just +// the configuration struct that D3D12EnableExperimentalFeatures provides. +// +// If this method is called and a change to existing feature enablement is made, +// all current D3D12 devices are set to DEVICE_REMOVED state, since under the covers there is really only one +// singleton device for a process. Removing the devices when configuration changes prevents +// mismatched expectations of how a device is supposed to work after it has been created from the app's point of view. +// +// The call returns E_NOINTERFACE if an unrecognized feature is passed in or Windows Developer mode is not on. +// The call returns E_INVALIDARG if the configuration of a feature is incorrect, the set of features passed +// in are known to be incompatible with each other, or other errors. +// Returns S_OK otherwise. +// +// -------------------------------------------------------------------------------------------------------------------------------- +HRESULT WINAPI D3D12EnableExperimentalFeatures( + UINT NumFeatures, + _In_count_(NumFeatures) const IID* pIIDs, + _In_opt_count_(NumFeatures) void* pConfigurationStructs, + _In_opt_count_(NumFeatures) UINT* pConfigurationStructSizes); + +// -------------------------------------------------------------------------------------------------------------------------------- +// Experimental Feature: D3D12ExperimentalShaderModels +// +// Use with D3D12EnableExperimentalFeatures to enable experimental shader model support, +// meaning shader models that haven't been finalized for use in retail. +// +// Enabling D3D12ExperimentalShaderModels needs no configuration struct, pass NULL in the pConfigurationStructs array. +// +// -------------------------------------------------------------------------------------------------------------------------------- +static const UUID D3D12ExperimentalShaderModels = { /* 76f5573e-f13a-40f5-b297-81ce9e18933f */ + 0x76f5573e, + 0xf13a, + 0x40f5, + { 0xb2, 0x97, 0x81, 0xce, 0x9e, 0x18, 0x93, 0x3f } +}; +// -------------------------------------------------------------------------------------------------------------------------------- +// Experimental Feature: D3D12TiledResourceTier4 +// +// Use with D3D12EnableExperimentalFeatures to enable tiled resource tier 4 support, +// meaning texture tile data-inheritance is allowed. +// +// Enabling D3D12TiledResourceTier4 needs no configuration struct, pass NULL in the pConfigurationStructs array. +// +// -------------------------------------------------------------------------------------------------------------------------------- +static const UUID D3D12TiledResourceTier4 = { /* c9c4725f-a81a-4f56-8c5b-c51039d694fb */ + 0xc9c4725f, + 0xa81a, + 0x4f56, + { 0x8c, 0x5b, 0xc5, 0x10, 0x39, 0xd6, 0x94, 0xfb } +}; +// -------------------------------------------------------------------------------------------------------------------------------- +// D3D12GetInterface +// +// Retrieve Global D3D12 Interface. +// + +DEFINE_GUID(CLSID_D3D12Debug, 0xf2352aeb, 0xdd84, 0x49fe, 0xb9, 0x7b, 0xa9, 0xdc, 0xfd, 0xcc, 0x1b, 0x4f); +DEFINE_GUID(CLSID_D3D12Tools, 0xe38216b1, 0x3c8c, 0x4833, 0xaa, 0x09, 0x0a, 0x06, 0xb6, 0x5d, 0x96, 0xc8); +DEFINE_GUID(CLSID_D3D12DeviceRemovedExtendedData, 0x4a75bbc4, 0x9ff4, 0x4ad8, 0x9f, 0x18, 0xab, 0xae, 0x84, 0xdc, 0x5f, 0xf2); +DEFINE_GUID(CLSID_D3D12SDKConfiguration, 0x7cda6aca, 0xa03e, 0x49c8, 0x94, 0x58, 0x03, 0x34, 0xd2, 0x0e, 0x07, 0xce); +DEFINE_GUID(CLSID_D3D12DeviceFactory, 0x114863bf, 0xc386, 0x4aee, 0xb3, 0x9d, 0x8f, 0x0b, 0xbb, 0x06, 0x29, 0x55); + +typedef HRESULT (WINAPI* PFN_D3D12_GET_INTERFACE)( _In_ REFCLSID, _In_ REFIID, _COM_Outptr_opt_ void** ); + +HRESULT WINAPI D3D12GetInterface( _In_ REFCLSID rclsid, _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug ); + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_s_ifspec; + +#ifndef __ID3D12SDKConfiguration_INTERFACE_DEFINED__ +#define __ID3D12SDKConfiguration_INTERFACE_DEFINED__ + +/* interface ID3D12SDKConfiguration */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SDKConfiguration; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e9eb5314-33aa-42b2-a718-d77f58b1f1c7") + ID3D12SDKConfiguration : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetSDKVersion( + UINT SDKVersion, + _In_z_ LPCSTR SDKPath) = 0; - DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) - HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( - ID3D12Device11 * This, - D3D12_BACKGROUND_PROCESSING_MODE Mode, - D3D12_MEASUREMENTS_ACTION MeasurementsAction, - _In_opt_ HANDLE hEventToSignalUponCompletion, - _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + }; + + +#else /* C style interface */ + + typedef struct ID3D12SDKConfigurationVtbl + { + BEGIN_INTERFACE - DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) - HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( - ID3D12Device11 * This, - const D3D12_STATE_OBJECT_DESC *pAddition, - ID3D12StateObject *pStateObjectToGrowFrom, + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SDKConfiguration * This, REFIID riid, - _COM_Outptr_ void **ppNewStateObject); - - DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) - HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( - ID3D12Device11 * This, - _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, - _In_ REFIID riid, - _COM_Outptr_ void **ppSession); - - DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) -#if !defined(_WIN32) - D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( - ID3D12Device11 * This, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + _COM_Outptr_ void **ppvObject); -#else - D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( - ID3D12Device11 * This, - D3D12_RESOURCE_ALLOCATION_INFO * RetVal, - UINT visibleMask, - UINT numResourceDescs, - _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, - _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SDKConfiguration * This); -#endif + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SDKConfiguration * This); - DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( - ID3D12Device11 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_RESOURCE_STATES InitialResourceState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion) + HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )( + ID3D12SDKConfiguration * This, + UINT SDKVersion, + _In_z_ LPCSTR SDKPath); - DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) - HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( - ID3D12Device11 * This, - _In_ ID3D12Heap *pHeap, - UINT64 HeapOffset, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_RESOURCE_STATES InitialState, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + END_INTERFACE + } ID3D12SDKConfigurationVtbl; + + interface ID3D12SDKConfiguration + { + CONST_VTBL struct ID3D12SDKConfigurationVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12SDKConfiguration_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12SDKConfiguration_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12SDKConfiguration_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12SDKConfiguration_SetSDKVersion(This,SDKVersion,SDKPath) \ + ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12SDKConfiguration_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ +#define __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ + +/* interface ID3D12SDKConfiguration1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SDKConfiguration1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8aaf9303-ad25-48b9-9a57-d9c37e009d9f") + ID3D12SDKConfiguration1 : public ID3D12SDKConfiguration + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateDeviceFactory( + UINT SDKVersion, + _In_ LPCSTR SDKPath, REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + _COM_Outptr_ void **ppvFactory) = 0; - DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) - void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( - ID3D12Device11 * This, - _In_opt_ ID3D12Resource *pTargetedResource, - _In_opt_ ID3D12Resource *pFeedbackResource, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + virtual void STDMETHODCALLTYPE FreeUnusedSDKs( void) = 0; - DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) - void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( - ID3D12Device11 * This, - _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, - _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, - _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, - UINT64 BaseOffset, - _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, - _Out_writes_opt_(NumSubresources) UINT *pNumRows, - _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, - _Out_opt_ UINT64 *pTotalBytes); + }; + + +#else /* C style interface */ + + typedef struct ID3D12SDKConfiguration1Vtbl + { + BEGIN_INTERFACE - DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) - HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( - ID3D12Device11 * This, - _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SDKConfiguration1 * This, REFIID riid, - _COM_Outptr_opt_ void **ppvSession); - - DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) - HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( - ID3D12Device11 * This, - D3D12_SHADER_CACHE_KIND_FLAGS Kinds, - D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + _COM_Outptr_ void **ppvObject); - DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) - HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( - ID3D12Device11 * This, - _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, - REFIID CreatorID, - REFIID riid, - _COM_Outptr_ void **ppCommandQueue); + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SDKConfiguration1 * This); - DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) - HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( - ID3D12Device11 * This, - _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, - D3D12_HEAP_FLAGS HeapFlags, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_BARRIER_LAYOUT InitialLayout, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - UINT32 NumCastableFormats, - _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, - REFIID riidResource, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SDKConfiguration1 * This); - DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) - HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( - ID3D12Device11 * This, - _In_ ID3D12Heap *pHeap, - UINT64 HeapOffset, - _In_ const D3D12_RESOURCE_DESC1 *pDesc, - D3D12_BARRIER_LAYOUT InitialLayout, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - UINT32 NumCastableFormats, - _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, - REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion) + HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )( + ID3D12SDKConfiguration1 * This, + UINT SDKVersion, + _In_z_ LPCSTR SDKPath); - DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) - HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( - ID3D12Device11 * This, - _In_ const D3D12_RESOURCE_DESC *pDesc, - D3D12_BARRIER_LAYOUT InitialLayout, - _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, - _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, - UINT32 NumCastableFormats, - _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, CreateDeviceFactory) + HRESULT ( STDMETHODCALLTYPE *CreateDeviceFactory )( + ID3D12SDKConfiguration1 * This, + UINT SDKVersion, + _In_ LPCSTR SDKPath, REFIID riid, - _COM_Outptr_opt_ void **ppvResource); + _COM_Outptr_ void **ppvFactory); - DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2) - void ( STDMETHODCALLTYPE *CreateSampler2 )( - ID3D12Device11 * This, - _In_ const D3D12_SAMPLER_DESC2 *pDesc, - _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, FreeUnusedSDKs) + void ( STDMETHODCALLTYPE *FreeUnusedSDKs )( + ID3D12SDKConfiguration1 * This); END_INTERFACE - } ID3D12Device11Vtbl; + } ID3D12SDKConfiguration1Vtbl; - interface ID3D12Device11 + interface ID3D12SDKConfiguration1 { - CONST_VTBL struct ID3D12Device11Vtbl *lpVtbl; + CONST_VTBL struct ID3D12SDKConfiguration1Vtbl *lpVtbl; }; @@ -24038,780 +28935,1146 @@ EXTERN_C const IID IID_ID3D12Device11; #ifdef COBJMACROS -#define ID3D12Device11_QueryInterface(This,riid,ppvObject) \ +#define ID3D12SDKConfiguration1_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device11_AddRef(This) \ +#define ID3D12SDKConfiguration1_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Device11_Release(This) \ +#define ID3D12SDKConfiguration1_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Device11_GetPrivateData(This,guid,pDataSize,pData) \ - ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) +#define ID3D12SDKConfiguration1_SetSDKVersion(This,SDKVersion,SDKPath) \ + ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) ) -#define ID3D12Device11_SetPrivateData(This,guid,DataSize,pData) \ - ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12Device11_SetPrivateDataInterface(This,guid,pData) \ - ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) +#define ID3D12SDKConfiguration1_CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) \ + ( (This)->lpVtbl -> CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) ) -#define ID3D12Device11_SetName(This,Name) \ - ( (This)->lpVtbl -> SetName(This,Name) ) +#define ID3D12SDKConfiguration1_FreeUnusedSDKs(This) \ + ( (This)->lpVtbl -> FreeUnusedSDKs(This) ) +#endif /* COBJMACROS */ -#define ID3D12Device11_GetNodeCount(This) \ - ( (This)->lpVtbl -> GetNodeCount(This) ) -#define ID3D12Device11_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ - ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) +#endif /* C style interface */ -#define ID3D12Device11_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ - ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) -#define ID3D12Device11_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device11_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) -#define ID3D12Device11_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ - ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) +#endif /* __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ */ -#define ID3D12Device11_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ - ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) -#define ID3D12Device11_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) +/* interface __MIDL_itf_d3d12_0000_0064 */ +/* [local] */ -#define ID3D12Device11_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ - ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) +typedef +enum D3D12_DEVICE_FACTORY_FLAGS + { + D3D12_DEVICE_FACTORY_FLAG_NONE = 0, + D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_EXISTING_DEVICE = 0x1, + D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_INCOMPATIBLE_EXISTING_DEVICE = 0x2, + D3D12_DEVICE_FACTORY_FLAG_DISALLOW_STORING_NEW_DEVICE_AS_SINGLETON = 0x4 + } D3D12_DEVICE_FACTORY_FLAGS; -#define ID3D12Device11_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ - ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FACTORY_FLAGS ) -#define ID3D12Device11_CreateConstantBufferView(This,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) -#define ID3D12Device11_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0064_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0064_v0_0_s_ifspec; -#define ID3D12Device11_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) +#ifndef __ID3D12DeviceFactory_INTERFACE_DEFINED__ +#define __ID3D12DeviceFactory_INTERFACE_DEFINED__ -#define ID3D12Device11_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) +/* interface ID3D12DeviceFactory */ +/* [unique][local][object][uuid] */ -#define ID3D12Device11_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) -#define ID3D12Device11_CreateSampler(This,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) +EXTERN_C const IID IID_ID3D12DeviceFactory; -#define ID3D12Device11_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ - ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("61f307d3-d34e-4e7c-8374-3ba4de23cccb") + ID3D12DeviceFactory : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE InitializeFromGlobalState( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE ApplyToGlobalState( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetFlags( + D3D12_DEVICE_FACTORY_FLAGS flags) = 0; + + virtual D3D12_DEVICE_FACTORY_FLAGS STDMETHODCALLTYPE GetFlags( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetConfigurationInterface( + REFCLSID clsid, + REFIID iid, + _COM_Outptr_ void **ppv) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnableExperimentalFeatures( + UINT NumFeatures, + _In_reads_(NumFeatures) const IID *pIIDs, + _In_reads_opt_(NumFeatures) void *pConfigurationStructs, + _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDevice( + _In_opt_ IUnknown *adapter, + D3D_FEATURE_LEVEL FeatureLevel, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice) = 0; + + }; + + +#else /* C style interface */ -#define ID3D12Device11_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ - ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) -#if !defined(_WIN32) + typedef struct ID3D12DeviceFactoryVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceFactory * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, InitializeFromGlobalState) + HRESULT ( STDMETHODCALLTYPE *InitializeFromGlobalState )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, ApplyToGlobalState) + HRESULT ( STDMETHODCALLTYPE *ApplyToGlobalState )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, SetFlags) + HRESULT ( STDMETHODCALLTYPE *SetFlags )( + ID3D12DeviceFactory * This, + D3D12_DEVICE_FACTORY_FLAGS flags); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetFlags) + D3D12_DEVICE_FACTORY_FLAGS ( STDMETHODCALLTYPE *GetFlags )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetConfigurationInterface) + HRESULT ( STDMETHODCALLTYPE *GetConfigurationInterface )( + ID3D12DeviceFactory * This, + REFCLSID clsid, + REFIID iid, + _COM_Outptr_ void **ppv); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, EnableExperimentalFeatures) + HRESULT ( STDMETHODCALLTYPE *EnableExperimentalFeatures )( + ID3D12DeviceFactory * This, + UINT NumFeatures, + _In_reads_(NumFeatures) const IID *pIIDs, + _In_reads_opt_(NumFeatures) void *pConfigurationStructs, + _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, CreateDevice) + HRESULT ( STDMETHODCALLTYPE *CreateDevice )( + ID3D12DeviceFactory * This, + _In_opt_ IUnknown *adapter, + D3D_FEATURE_LEVEL FeatureLevel, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12DeviceFactoryVtbl; -#define ID3D12Device11_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) -#else -#define ID3D12Device11_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) -#endif -#if !defined(_WIN32) + interface ID3D12DeviceFactory + { + CONST_VTBL struct ID3D12DeviceFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceFactory_InitializeFromGlobalState(This) \ + ( (This)->lpVtbl -> InitializeFromGlobalState(This) ) + +#define ID3D12DeviceFactory_ApplyToGlobalState(This) \ + ( (This)->lpVtbl -> ApplyToGlobalState(This) ) + +#define ID3D12DeviceFactory_SetFlags(This,flags) \ + ( (This)->lpVtbl -> SetFlags(This,flags) ) + +#define ID3D12DeviceFactory_GetFlags(This) \ + ( (This)->lpVtbl -> GetFlags(This) ) + +#define ID3D12DeviceFactory_GetConfigurationInterface(This,clsid,iid,ppv) \ + ( (This)->lpVtbl -> GetConfigurationInterface(This,clsid,iid,ppv) ) + +#define ID3D12DeviceFactory_EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) \ + ( (This)->lpVtbl -> EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) ) + +#define ID3D12DeviceFactory_CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) \ + ( (This)->lpVtbl -> CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) ) + +#endif /* COBJMACROS */ -#define ID3D12Device11_GetCustomHeapProperties(This,nodeMask,heapType) \ - ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) -#else -#define ID3D12Device11_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ - ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) -#endif -#define ID3D12Device11_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) +#endif /* C style interface */ -#define ID3D12Device11_CreateHeap(This,pDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) -#define ID3D12Device11_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device11_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) -#define ID3D12Device11_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ - ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) +#endif /* __ID3D12DeviceFactory_INTERFACE_DEFINED__ */ -#define ID3D12Device11_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ - ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) -#define ID3D12Device11_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ - ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) +/* interface __MIDL_itf_d3d12_0000_0065 */ +/* [local] */ -#define ID3D12Device11_MakeResident(This,NumObjects,ppObjects) \ - ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) +typedef +enum D3D12_DEVICE_FLAGS + { + D3D12_DEVICE_FLAG_NONE = 0, + D3D12_DEVICE_FLAG_DEBUG_LAYER_ENABLED = 0x1, + D3D12_DEVICE_FLAG_GPU_BASED_VALIDATION_ENABLED = 0x2, + D3D12_DEVICE_FLAG_SYNCHRONIZED_COMMAND_QUEUE_VALIDATION_DISABLED = 0x4, + D3D12_DEVICE_FLAG_DRED_AUTO_BREADCRUMBS_ENABLED = 0x8, + D3D12_DEVICE_FLAG_DRED_PAGE_FAULT_REPORTING_ENABLED = 0x10, + D3D12_DEVICE_FLAG_DRED_WATSON_REPORTING_ENABLED = 0x20, + D3D12_DEVICE_FLAG_DRED_BREADCRUMB_CONTEXT_ENABLED = 0x40, + D3D12_DEVICE_FLAG_DRED_USE_MARKERS_ONLY_BREADCRUMBS = 0x80, + D3D12_DEVICE_FLAG_SHADER_INSTRUMENTATION_ENABLED = 0x100, + D3D12_DEVICE_FLAG_AUTO_DEBUG_NAME_ENABLED = 0x200, + D3D12_DEVICE_FLAG_FORCE_LEGACY_STATE_VALIDATION = 0x400 + } D3D12_DEVICE_FLAGS; -#define ID3D12Device11_Evict(This,NumObjects,ppObjects) \ - ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FLAGS ) +typedef struct D3D12_DEVICE_CONFIGURATION_DESC + { + D3D12_DEVICE_FLAGS Flags; + UINT GpuBasedValidationFlags; + UINT SDKVersion; + UINT NumEnabledExperimentalFeatures; + } D3D12_DEVICE_CONFIGURATION_DESC; -#define ID3D12Device11_CreateFence(This,InitialValue,Flags,riid,ppFence) \ - ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) -#define ID3D12Device11_GetDeviceRemovedReason(This) \ - ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) -#define ID3D12Device11_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ - ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_s_ifspec; -#define ID3D12Device11_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) +#ifndef __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ +#define __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ -#define ID3D12Device11_SetStablePowerState(This,Enable) \ - ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) +/* interface ID3D12DeviceConfiguration */ +/* [unique][local][object][uuid] */ -#define ID3D12Device11_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ - ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) -#define ID3D12Device11_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ - ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) -#if !defined(_WIN32) +EXTERN_C const IID IID_ID3D12DeviceConfiguration; -#define ID3D12Device11_GetAdapterLuid(This) \ - ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("78dbf87b-f766-422b-a61c-c8c446bdb9ad") + ID3D12DeviceConfiguration : public IUnknown + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_DEVICE_CONFIGURATION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; #else -#define ID3D12Device11_GetAdapterLuid(This,RetVal) \ - ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) + virtual D3D12_DEVICE_CONFIGURATION_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_DEVICE_CONFIGURATION_DESC * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetEnabledExperimentalFeatures( + _Out_writes_(NumGuids) GUID *pGuids, + UINT NumGuids) = 0; + + virtual HRESULT STDMETHODCALLTYPE SerializeVersionedRootSignature( + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, + _COM_Outptr_ ID3DBlob **ppResult, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVersionedRootSignatureDeserializer( + _In_reads_bytes_(Size) const void *pBlob, + SIZE_T Size, + REFIID riid, + _COM_Outptr_ void **ppvDeserializer) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceConfigurationVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceConfiguration * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceConfiguration * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceConfiguration * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetDesc) +#if !defined(_WIN32) + D3D12_DEVICE_CONFIGURATION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12DeviceConfiguration * This); + +#else + D3D12_DEVICE_CONFIGURATION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12DeviceConfiguration * This, + D3D12_DEVICE_CONFIGURATION_DESC * RetVal); + #endif + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetEnabledExperimentalFeatures) + HRESULT ( STDMETHODCALLTYPE *GetEnabledExperimentalFeatures )( + ID3D12DeviceConfiguration * This, + _Out_writes_(NumGuids) GUID *pGuids, + UINT NumGuids); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, SerializeVersionedRootSignature) + HRESULT ( STDMETHODCALLTYPE *SerializeVersionedRootSignature )( + ID3D12DeviceConfiguration * This, + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, + _COM_Outptr_ ID3DBlob **ppResult, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, CreateVersionedRootSignatureDeserializer) + HRESULT ( STDMETHODCALLTYPE *CreateVersionedRootSignatureDeserializer )( + ID3D12DeviceConfiguration * This, + _In_reads_bytes_(Size) const void *pBlob, + SIZE_T Size, + REFIID riid, + _COM_Outptr_ void **ppvDeserializer); + + END_INTERFACE + } ID3D12DeviceConfigurationVtbl; + interface ID3D12DeviceConfiguration + { + CONST_VTBL struct ID3D12DeviceConfigurationVtbl *lpVtbl; + }; -#define ID3D12Device11_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ - ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + -#define ID3D12Device11_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ - ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) +#ifdef COBJMACROS -#define ID3D12Device11_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ - ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) +#define ID3D12DeviceConfiguration_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device11_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ - ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) +#define ID3D12DeviceConfiguration_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) +#define ID3D12DeviceConfiguration_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) -#define ID3D12Device11_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ - ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) +#if !defined(_WIN32) -#define ID3D12Device11_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ - ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) +#define ID3D12DeviceConfiguration_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12DeviceConfiguration_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif -#define ID3D12Device11_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ - ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) +#define ID3D12DeviceConfiguration_GetEnabledExperimentalFeatures(This,pGuids,NumGuids) \ + ( (This)->lpVtbl -> GetEnabledExperimentalFeatures(This,pGuids,NumGuids) ) +#define ID3D12DeviceConfiguration_SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) \ + ( (This)->lpVtbl -> SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) ) -#define ID3D12Device11_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ - ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) +#define ID3D12DeviceConfiguration_CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) \ + ( (This)->lpVtbl -> CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) ) -#define ID3D12Device11_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ - ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) +#endif /* COBJMACROS */ -#define ID3D12Device11_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) -#define ID3D12Device11_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ - ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) +#endif /* C style interface */ -#define ID3D12Device11_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ - ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) -#if !defined(_WIN32) -#define ID3D12Device11_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) -#else -#define ID3D12Device11_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) -#endif -#define ID3D12Device11_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ - ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) +#endif /* __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ */ -#define ID3D12Device11_RemoveDevice(This) \ - ( (This)->lpVtbl -> RemoveDevice(This) ) -#define ID3D12Device11_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ - ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) +#ifndef __ID3D12DeviceConfiguration1_INTERFACE_DEFINED__ +#define __ID3D12DeviceConfiguration1_INTERFACE_DEFINED__ -#define ID3D12Device11_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ - ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) +/* interface ID3D12DeviceConfiguration1 */ +/* [unique][local][object][uuid] */ -#define ID3D12Device11_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ - ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) -#define ID3D12Device11_CreateStateObject(This,pDesc,riid,ppStateObject) \ - ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) +EXTERN_C const IID IID_ID3D12DeviceConfiguration1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ed342442-6343-4e16-bb82-a3a577874e56") + ID3D12DeviceConfiguration1 : public ID3D12DeviceConfiguration + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary( + _In_reads_bytes_(Size) const void *pLibraryBlob, + SIZE_T Size, + LPCWSTR RootSignatureSubobjectName, + REFIID riid, + _COM_Outptr_ void **ppvDeserializer) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceConfiguration1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceConfiguration1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceConfiguration1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceConfiguration1 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetDesc) +#if !defined(_WIN32) + D3D12_DEVICE_CONFIGURATION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12DeviceConfiguration1 * This); + +#else + D3D12_DEVICE_CONFIGURATION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12DeviceConfiguration1 * This, + D3D12_DEVICE_CONFIGURATION_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetEnabledExperimentalFeatures) + HRESULT ( STDMETHODCALLTYPE *GetEnabledExperimentalFeatures )( + ID3D12DeviceConfiguration1 * This, + _Out_writes_(NumGuids) GUID *pGuids, + UINT NumGuids); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, SerializeVersionedRootSignature) + HRESULT ( STDMETHODCALLTYPE *SerializeVersionedRootSignature )( + ID3D12DeviceConfiguration1 * This, + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, + _COM_Outptr_ ID3DBlob **ppResult, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, CreateVersionedRootSignatureDeserializer) + HRESULT ( STDMETHODCALLTYPE *CreateVersionedRootSignatureDeserializer )( + ID3D12DeviceConfiguration1 * This, + _In_reads_bytes_(Size) const void *pBlob, + SIZE_T Size, + REFIID riid, + _COM_Outptr_ void **ppvDeserializer); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration1, CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary) + HRESULT ( STDMETHODCALLTYPE *CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary )( + ID3D12DeviceConfiguration1 * This, + _In_reads_bytes_(Size) const void *pLibraryBlob, + SIZE_T Size, + LPCWSTR RootSignatureSubobjectName, + REFIID riid, + _COM_Outptr_ void **ppvDeserializer); + + END_INTERFACE + } ID3D12DeviceConfiguration1Vtbl; -#define ID3D12Device11_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ - ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + interface ID3D12DeviceConfiguration1 + { + CONST_VTBL struct ID3D12DeviceConfiguration1Vtbl *lpVtbl; + }; -#define ID3D12Device11_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ - ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + +#ifdef COBJMACROS -#define ID3D12Device11_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ - ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) +#define ID3D12DeviceConfiguration1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12Device11_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ - ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) +#define ID3D12DeviceConfiguration1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12Device11_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ - ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) +#define ID3D12DeviceConfiguration1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) #if !defined(_WIN32) -#define ID3D12Device11_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#define ID3D12DeviceConfiguration1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) #else -#define ID3D12Device11_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ - ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#define ID3D12DeviceConfiguration1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) #endif -#define ID3D12Device11_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) - -#define ID3D12Device11_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ - ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) - -#define ID3D12Device11_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ - ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) +#define ID3D12DeviceConfiguration1_GetEnabledExperimentalFeatures(This,pGuids,NumGuids) \ + ( (This)->lpVtbl -> GetEnabledExperimentalFeatures(This,pGuids,NumGuids) ) -#define ID3D12Device11_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ - ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) +#define ID3D12DeviceConfiguration1_SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) \ + ( (This)->lpVtbl -> SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) ) +#define ID3D12DeviceConfiguration1_CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) \ + ( (This)->lpVtbl -> CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) ) -#define ID3D12Device11_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ - ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) -#define ID3D12Device11_ShaderCacheControl(This,Kinds,Control) \ - ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) +#define ID3D12DeviceConfiguration1_CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary(This,pLibraryBlob,Size,RootSignatureSubobjectName,riid,ppvDeserializer) \ + ( (This)->lpVtbl -> CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary(This,pLibraryBlob,Size,RootSignatureSubobjectName,riid,ppvDeserializer) ) -#define ID3D12Device11_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ - ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) +#endif /* COBJMACROS */ -#define ID3D12Device11_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ - ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) +#endif /* C style interface */ -#define ID3D12Device11_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ - ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) -#define ID3D12Device11_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ - ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) -#define ID3D12Device11_CreateSampler2(This,pDesc,DestDescriptor) \ - ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) ) +#endif /* __ID3D12DeviceConfiguration1_INTERFACE_DEFINED__ */ -#endif /* COBJMACROS */ +/* interface __MIDL_itf_d3d12_0000_0067 */ +/* [local] */ -#endif /* C style interface */ +typedef +enum D3D12_AXIS_SHADING_RATE + { + D3D12_AXIS_SHADING_RATE_1X = 0, + D3D12_AXIS_SHADING_RATE_2X = 0x1, + D3D12_AXIS_SHADING_RATE_4X = 0x2 + } D3D12_AXIS_SHADING_RATE; +#define D3D12_SHADING_RATE_X_AXIS_SHIFT 2 +#define D3D12_SHADING_RATE_VALID_MASK 3 +#define D3D12_MAKE_COARSE_SHADING_RATE(x,y) ((x) << D3D12_SHADING_RATE_X_AXIS_SHIFT | (y)) +#define D3D12_GET_COARSE_SHADING_RATE_X_AXIS(x) (((x) >> D3D12_SHADING_RATE_X_AXIS_SHIFT) & D3D12_SHADING_RATE_VALID_MASK) +#define D3D12_GET_COARSE_SHADING_RATE_Y_AXIS(y) ((y) & D3D12_SHADING_RATE_VALID_MASK) +typedef +enum D3D12_SHADING_RATE + { + D3D12_SHADING_RATE_1X1 = 0, + D3D12_SHADING_RATE_1X2 = 0x1, + D3D12_SHADING_RATE_2X1 = 0x4, + D3D12_SHADING_RATE_2X2 = 0x5, + D3D12_SHADING_RATE_2X4 = 0x6, + D3D12_SHADING_RATE_4X2 = 0x9, + D3D12_SHADING_RATE_4X4 = 0xa + } D3D12_SHADING_RATE; +typedef +enum D3D12_SHADING_RATE_COMBINER + { + D3D12_SHADING_RATE_COMBINER_PASSTHROUGH = 0, + D3D12_SHADING_RATE_COMBINER_OVERRIDE = 1, + D3D12_SHADING_RATE_COMBINER_MIN = 2, + D3D12_SHADING_RATE_COMBINER_MAX = 3, + D3D12_SHADING_RATE_COMBINER_SUM = 4 + } D3D12_SHADING_RATE_COMBINER; -#endif /* __ID3D12Device11_INTERFACE_DEFINED__ */ +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0067_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0067_v0_0_s_ifspec; -#ifndef __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ -#define __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ +#ifndef __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ -/* interface ID3D12VirtualizationGuestDevice */ +/* interface ID3D12GraphicsCommandList5 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12VirtualizationGuestDevice; +EXTERN_C const IID IID_ID3D12GraphicsCommandList5; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("bc66d368-7373-4943-8757-fc87dc79e476") - ID3D12VirtualizationGuestDevice : public IUnknown + MIDL_INTERFACE("55050859-4024-474c-87f5-6472eaee44ea") + ID3D12GraphicsCommandList5 : public ID3D12GraphicsCommandList4 { public: - virtual HRESULT STDMETHODCALLTYPE ShareWithHost( - _In_ ID3D12DeviceChild *pObject, - _Out_ HANDLE *pHandle) = 0; + virtual void STDMETHODCALLTYPE RSSetShadingRate( + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners) = 0; + + virtual void STDMETHODCALLTYPE RSSetShadingRateImage( + _In_opt_ ID3D12Resource *shadingRateImage) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList5Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList5 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList5 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList5 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList5 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList5 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList5 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); - virtual HRESULT STDMETHODCALLTYPE CreateFenceFd( - _In_ ID3D12Fence *pFence, - UINT64 FenceValue, - _Out_ int *pFenceFd) = 0; + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); - }; - - -#else /* C style interface */ - - typedef struct ID3D12VirtualizationGuestDeviceVtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12VirtualizationGuestDevice * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12VirtualizationGuestDevice * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList5 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12VirtualizationGuestDevice * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList5 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, ShareWithHost) - HRESULT ( STDMETHODCALLTYPE *ShareWithHost )( - ID3D12VirtualizationGuestDevice * This, - _In_ ID3D12DeviceChild *pObject, - _Out_ HANDLE *pHandle); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList5 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); - DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, CreateFenceFd) - HRESULT ( STDMETHODCALLTYPE *CreateFenceFd )( - ID3D12VirtualizationGuestDevice * This, - _In_ ID3D12Fence *pFence, - UINT64 FenceValue, - _Out_ int *pFenceFd); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT StencilRef); - END_INTERFACE - } ID3D12VirtualizationGuestDeviceVtbl; - - interface ID3D12VirtualizationGuestDevice - { - CONST_VTBL struct ID3D12VirtualizationGuestDeviceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D12VirtualizationGuestDevice_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D12VirtualizationGuestDevice_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D12VirtualizationGuestDevice_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D12VirtualizationGuestDevice_ShareWithHost(This,pObject,pHandle) \ - ( (This)->lpVtbl -> ShareWithHost(This,pObject,pHandle) ) - -#define ID3D12VirtualizationGuestDevice_CreateFenceFd(This,pFence,FenceValue,pFenceFd) \ - ( (This)->lpVtbl -> CreateFenceFd(This,pFence,FenceValue,pFenceFd) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ */ - - -#ifndef __ID3D12Tools_INTERFACE_DEFINED__ -#define __ID3D12Tools_INTERFACE_DEFINED__ - -/* interface ID3D12Tools */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D12Tools; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("7071e1f0-e84b-4b33-974f-12fa49de65c5") - ID3D12Tools : public IUnknown - { - public: - virtual void STDMETHODCALLTYPE EnableShaderInstrumentation( - BOOL bEnable) = 0; + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12PipelineState *pPipelineState); - virtual BOOL STDMETHODCALLTYPE ShaderInstrumentationEnabled( void) = 0; + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); - }; - - -#else /* C style interface */ - - typedef struct ID3D12ToolsVtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12Tools * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12Tools * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12Tools * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Tools, EnableShaderInstrumentation) - void ( STDMETHODCALLTYPE *EnableShaderInstrumentation )( - ID3D12Tools * This, - BOOL bEnable); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - DECLSPEC_XFGVIRT(ID3D12Tools, ShaderInstrumentationEnabled) - BOOL ( STDMETHODCALLTYPE *ShaderInstrumentationEnabled )( - ID3D12Tools * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - END_INTERFACE - } ID3D12ToolsVtbl; - - interface ID3D12Tools - { - CONST_VTBL struct ID3D12ToolsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D12Tools_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D12Tools_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D12Tools_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D12Tools_EnableShaderInstrumentation(This,bEnable) \ - ( (This)->lpVtbl -> EnableShaderInstrumentation(This,bEnable) ) - -#define ID3D12Tools_ShaderInstrumentationEnabled(This) \ - ( (This)->lpVtbl -> ShaderInstrumentationEnabled(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D12Tools_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_d3d12_0000_0057 */ -/* [local] */ - -typedef struct D3D12_SUBRESOURCE_DATA - { - const void *pData; - LONG_PTR RowPitch; - LONG_PTR SlicePitch; - } D3D12_SUBRESOURCE_DATA; - -typedef struct D3D12_MEMCPY_DEST - { - void *pData; - SIZE_T RowPitch; - SIZE_T SlicePitch; - } D3D12_MEMCPY_DEST; - -#if !defined( D3D12_IGNORE_SDK_LAYERS ) -#include "d3d12sdklayers.h" -#endif - -/////////////////////////////////////////////////////////////////////////// -// D3D12CreateDevice -// ------------------ -// -// pAdapter -// If NULL, D3D12CreateDevice will choose the primary adapter. -// If non-NULL, D3D12CreateDevice will use the provided adapter. -// MinimumFeatureLevel -// The minimum feature level required for successful device creation. -// riid -// The interface IID of the device to be returned. Expected: ID3D12Device. -// ppDevice -// Pointer to returned interface. May be NULL. -// -// Return Values -// Any of those documented for -// CreateDXGIFactory1 -// IDXGIFactory::EnumAdapters -// D3D12CreateDevice -// -/////////////////////////////////////////////////////////////////////////// -typedef HRESULT (WINAPI* PFN_D3D12_CREATE_DEVICE)( _In_opt_ IUnknown*, - D3D_FEATURE_LEVEL, - _In_ REFIID, _COM_Outptr_opt_ void** ); - -HRESULT WINAPI D3D12CreateDevice( - _In_opt_ IUnknown* pAdapter, - D3D_FEATURE_LEVEL MinimumFeatureLevel, - _In_ REFIID riid, // Expected: ID3D12Device - _COM_Outptr_opt_ void** ppDevice ); - - -typedef HRESULT (WINAPI* PFN_D3D12_GET_DEBUG_INTERFACE)( _In_ REFIID, _COM_Outptr_opt_ void** ); - -HRESULT WINAPI D3D12GetDebugInterface( _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug ); - -// -------------------------------------------------------------------------------------------------------------------------------- -// D3D12EnableExperimentalFeatures -// -// Pass in a list of feature GUIDs to be enabled together. -// -// If a particular feature requires some configuration information on enablement, it will have -// a configuration struct that can be passed alongside the GUID. -// -// Some features might use an interface IID as the GUID. For these, once the feature is enabled via -// D3D12EnableExperimentalFeatures, D3D12GetDebugInterface can then be called with the IID to retrieve the interface -// for manipulating the feature. This allows for control that might not cleanly be expressed by just -// the configuration struct that D3D12EnableExperimentalFeatures provides. -// -// If this method is called and a change to existing feature enablement is made, -// all current D3D12 devices are set to DEVICE_REMOVED state, since under the covers there is really only one -// singleton device for a process. Removing the devices when configuration changes prevents -// mismatched expectations of how a device is supposed to work after it has been created from the app's point of view. -// -// The call returns E_NOINTERFACE if an unrecognized feature is passed in or Windows Developer mode is not on. -// The call returns E_INVALIDARG if the configuration of a feature is incorrect, the set of features passed -// in are known to be incompatible with each other, or other errors. -// Returns S_OK otherwise. -// -// -------------------------------------------------------------------------------------------------------------------------------- -HRESULT WINAPI D3D12EnableExperimentalFeatures( - UINT NumFeatures, - _In_count_(NumFeatures) const IID* pIIDs, - _In_opt_count_(NumFeatures) void* pConfigurationStructs, - _In_opt_count_(NumFeatures) UINT* pConfigurationStructSizes); - -// -------------------------------------------------------------------------------------------------------------------------------- -// Experimental Feature: D3D12ExperimentalShaderModels -// -// Use with D3D12EnableExperimentalFeatures to enable experimental shader model support, -// meaning shader models that haven't been finalized for use in retail. -// -// Enabling D3D12ExperimentalShaderModels needs no configuration struct, pass NULL in the pConfigurationStructs array. -// -// -------------------------------------------------------------------------------------------------------------------------------- -static const UUID D3D12ExperimentalShaderModels = { /* 76f5573e-f13a-40f5-b297-81ce9e18933f */ - 0x76f5573e, - 0xf13a, - 0x40f5, - { 0xb2, 0x97, 0x81, 0xce, 0x9e, 0x18, 0x93, 0x3f } -}; -// -------------------------------------------------------------------------------------------------------------------------------- -// Experimental Feature: D3D12TiledResourceTier4 -// -// Use with D3D12EnableExperimentalFeatures to enable tiled resource tier 4 support, -// meaning texture tile data-inheritance is allowed. -// -// Enabling D3D12TiledResourceTier4 needs no configuration struct, pass NULL in the pConfigurationStructs array. -// -// -------------------------------------------------------------------------------------------------------------------------------- -static const UUID D3D12TiledResourceTier4 = { /* c9c4725f-a81a-4f56-8c5b-c51039d694fb */ - 0xc9c4725f, - 0xa81a, - 0x4f56, - { 0x8c, 0x5b, 0xc5, 0x10, 0x39, 0xd6, 0x94, 0xfb } -}; -// -------------------------------------------------------------------------------------------------------------------------------- -// D3D12GetInterface -// -// Retrieve Global D3D12 Interface. -// - -DEFINE_GUID(CLSID_D3D12Debug, 0xf2352aeb, 0xdd84, 0x49fe, 0xb9, 0x7b, 0xa9, 0xdc, 0xfd, 0xcc, 0x1b, 0x4f); -DEFINE_GUID(CLSID_D3D12Tools, 0xe38216b1, 0x3c8c, 0x4833, 0xaa, 0x09, 0x0a, 0x06, 0xb6, 0x5d, 0x96, 0xc8); -DEFINE_GUID(CLSID_D3D12DeviceRemovedExtendedData, 0x4a75bbc4, 0x9ff4, 0x4ad8, 0x9f, 0x18, 0xab, 0xae, 0x84, 0xdc, 0x5f, 0xf2); -DEFINE_GUID(CLSID_D3D12SDKConfiguration, 0x7cda6aca, 0xa03e, 0x49c8, 0x94, 0x58, 0x03, 0x34, 0xd2, 0x0e, 0x07, 0xce); -DEFINE_GUID(CLSID_D3D12DeviceFactory, 0x114863bf, 0xc386, 0x4aee, 0xb3, 0x9d, 0x8f, 0x0b, 0xbb, 0x06, 0x29, 0x55); - -typedef HRESULT (WINAPI* PFN_D3D12_GET_INTERFACE)( _In_ REFCLSID, _In_ REFIID, _COM_Outptr_opt_ void** ); - -HRESULT WINAPI D3D12GetInterface( _In_ REFCLSID rclsid, _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug ); - - - -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_s_ifspec; - -#ifndef __ID3D12SDKConfiguration_INTERFACE_DEFINED__ -#define __ID3D12SDKConfiguration_INTERFACE_DEFINED__ - -/* interface ID3D12SDKConfiguration */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D12SDKConfiguration; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("e9eb5314-33aa-42b2-a718-d77f58b1f1c7") - ID3D12SDKConfiguration : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetSDKVersion( - UINT SDKVersion, - _In_z_ LPCSTR SDKPath) = 0; + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); - }; - - -#else /* C style interface */ - - typedef struct ID3D12SDKConfigurationVtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12SDKConfiguration * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12SDKConfiguration * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12SDKConfiguration * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); - DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion) - HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )( - ID3D12SDKConfiguration * This, - UINT SDKVersion, - _In_z_ LPCSTR SDKPath); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); - END_INTERFACE - } ID3D12SDKConfigurationVtbl; - - interface ID3D12SDKConfiguration - { - CONST_VTBL struct ID3D12SDKConfigurationVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ID3D12SDKConfiguration_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ID3D12SDKConfiguration_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ID3D12SDKConfiguration_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ID3D12SDKConfiguration_SetSDKVersion(This,SDKVersion,SDKPath) \ - ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ID3D12SDKConfiguration_INTERFACE_DEFINED__ */ - - -#ifndef __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ -#define __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ - -/* interface ID3D12SDKConfiguration1 */ -/* [unique][local][object][uuid] */ - - -EXTERN_C const IID IID_ID3D12SDKConfiguration1; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8aaf9303-ad25-48b9-9a57-d9c37e009d9f") - ID3D12SDKConfiguration1 : public ID3D12SDKConfiguration - { - public: - virtual HRESULT STDMETHODCALLTYPE CreateDeviceFactory( - UINT SDKVersion, - _In_ LPCSTR SDKPath, - REFIID riid, - _COM_Outptr_ void **ppvFactory) = 0; + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList5 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); - virtual void STDMETHODCALLTYPE FreeUnusedSDKs( void) = 0; + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList5 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); - }; - - -#else /* C style interface */ - - typedef struct ID3D12SDKConfiguration1Vtbl - { - BEGIN_INTERFACE + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList5 * This); - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12SDKConfiguration1 * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList5 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList5 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12SDKConfiguration1 * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12SDKConfiguration1 * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); - DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion) - HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )( - ID3D12SDKConfiguration1 * This, - UINT SDKVersion, - _In_z_ LPCSTR SDKPath); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12StateObject *pStateObject); - DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, CreateDeviceFactory) - HRESULT ( STDMETHODCALLTYPE *CreateDeviceFactory )( - ID3D12SDKConfiguration1 * This, - UINT SDKVersion, - _In_ LPCSTR SDKPath, - REFIID riid, - _COM_Outptr_ void **ppvFactory); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); - DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, FreeUnusedSDKs) - void ( STDMETHODCALLTYPE *FreeUnusedSDKs )( - ID3D12SDKConfiguration1 * This); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) + void ( STDMETHODCALLTYPE *RSSetShadingRate )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) + void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12Resource *shadingRateImage); END_INTERFACE - } ID3D12SDKConfiguration1Vtbl; + } ID3D12GraphicsCommandList5Vtbl; - interface ID3D12SDKConfiguration1 + interface ID3D12GraphicsCommandList5 { - CONST_VTBL struct ID3D12SDKConfiguration1Vtbl *lpVtbl; + CONST_VTBL struct ID3D12GraphicsCommandList5Vtbl *lpVtbl; }; @@ -24819,380 +30082,251 @@ EXTERN_C const IID IID_ID3D12SDKConfiguration1; #ifdef COBJMACROS -#define ID3D12SDKConfiguration1_QueryInterface(This,riid,ppvObject) \ +#define ID3D12GraphicsCommandList5_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12SDKConfiguration1_AddRef(This) \ +#define ID3D12GraphicsCommandList5_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12SDKConfiguration1_Release(This) \ +#define ID3D12GraphicsCommandList5_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12SDKConfiguration1_SetSDKVersion(This,SDKVersion,SDKPath) \ - ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) ) +#define ID3D12GraphicsCommandList5_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) +#define ID3D12GraphicsCommandList5_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12SDKConfiguration1_CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) \ - ( (This)->lpVtbl -> CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) ) +#define ID3D12GraphicsCommandList5_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12SDKConfiguration1_FreeUnusedSDKs(This) \ - ( (This)->lpVtbl -> FreeUnusedSDKs(This) ) +#define ID3D12GraphicsCommandList5_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) -#endif /* COBJMACROS */ +#define ID3D12GraphicsCommandList5_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#endif /* C style interface */ +#define ID3D12GraphicsCommandList5_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) +#define ID3D12GraphicsCommandList5_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) -#endif /* __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ */ +#define ID3D12GraphicsCommandList5_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) +#define ID3D12GraphicsCommandList5_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) -/* interface __MIDL_itf_d3d12_0000_0059 */ -/* [local] */ +#define ID3D12GraphicsCommandList5_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) -typedef -enum D3D12_DEVICE_FACTORY_FLAGS - { - D3D12_DEVICE_FACTORY_FLAG_NONE = 0, - D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_EXISTING_DEVICE = 0x1, - D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_INCOMPATIBLE_EXISTING_DEVICE = 0x2, - D3D12_DEVICE_FACTORY_FLAG_DISALLOW_STORING_NEW_DEVICE_AS_SINGLETON = 0x4 - } D3D12_DEVICE_FACTORY_FLAGS; +#define ID3D12GraphicsCommandList5_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) -DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FACTORY_FLAGS ); +#define ID3D12GraphicsCommandList5_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) +#define ID3D12GraphicsCommandList5_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_s_ifspec; +#define ID3D12GraphicsCommandList5_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) -#ifndef __ID3D12DeviceFactory_INTERFACE_DEFINED__ -#define __ID3D12DeviceFactory_INTERFACE_DEFINED__ +#define ID3D12GraphicsCommandList5_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) -/* interface ID3D12DeviceFactory */ -/* [unique][local][object][uuid] */ +#define ID3D12GraphicsCommandList5_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) +#define ID3D12GraphicsCommandList5_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) -EXTERN_C const IID IID_ID3D12DeviceFactory; +#define ID3D12GraphicsCommandList5_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("61f307d3-d34e-4e7c-8374-3ba4de23cccb") - ID3D12DeviceFactory : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE InitializeFromGlobalState( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE ApplyToGlobalState( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFlags( - D3D12_DEVICE_FACTORY_FLAGS flags) = 0; - - virtual D3D12_DEVICE_FACTORY_FLAGS STDMETHODCALLTYPE GetFlags( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetConfigurationInterface( - REFCLSID clsid, - REFIID iid, - _COM_Outptr_ void **ppv) = 0; - - virtual HRESULT STDMETHODCALLTYPE EnableExperimentalFeatures( - UINT NumFeatures, - _In_reads_(NumFeatures) const IID *pIIDs, - _In_reads_opt_(NumFeatures) void *pConfigurationStructs, - _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateDevice( - _In_opt_ IUnknown *adapter, - D3D_FEATURE_LEVEL FeatureLevel, - REFIID riid, - _COM_Outptr_opt_ void **ppvDevice) = 0; - - }; - - -#else /* C style interface */ +#define ID3D12GraphicsCommandList5_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) - typedef struct ID3D12DeviceFactoryVtbl - { - BEGIN_INTERFACE - - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12DeviceFactory * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12DeviceFactory * This); - - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12DeviceFactory * This); - - DECLSPEC_XFGVIRT(ID3D12DeviceFactory, InitializeFromGlobalState) - HRESULT ( STDMETHODCALLTYPE *InitializeFromGlobalState )( - ID3D12DeviceFactory * This); - - DECLSPEC_XFGVIRT(ID3D12DeviceFactory, ApplyToGlobalState) - HRESULT ( STDMETHODCALLTYPE *ApplyToGlobalState )( - ID3D12DeviceFactory * This); - - DECLSPEC_XFGVIRT(ID3D12DeviceFactory, SetFlags) - HRESULT ( STDMETHODCALLTYPE *SetFlags )( - ID3D12DeviceFactory * This, - D3D12_DEVICE_FACTORY_FLAGS flags); - - DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetFlags) - D3D12_DEVICE_FACTORY_FLAGS ( STDMETHODCALLTYPE *GetFlags )( - ID3D12DeviceFactory * This); - - DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetConfigurationInterface) - HRESULT ( STDMETHODCALLTYPE *GetConfigurationInterface )( - ID3D12DeviceFactory * This, - REFCLSID clsid, - REFIID iid, - _COM_Outptr_ void **ppv); - - DECLSPEC_XFGVIRT(ID3D12DeviceFactory, EnableExperimentalFeatures) - HRESULT ( STDMETHODCALLTYPE *EnableExperimentalFeatures )( - ID3D12DeviceFactory * This, - UINT NumFeatures, - _In_reads_(NumFeatures) const IID *pIIDs, - _In_reads_opt_(NumFeatures) void *pConfigurationStructs, - _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes); - - DECLSPEC_XFGVIRT(ID3D12DeviceFactory, CreateDevice) - HRESULT ( STDMETHODCALLTYPE *CreateDevice )( - ID3D12DeviceFactory * This, - _In_opt_ IUnknown *adapter, - D3D_FEATURE_LEVEL FeatureLevel, - REFIID riid, - _COM_Outptr_opt_ void **ppvDevice); - - END_INTERFACE - } ID3D12DeviceFactoryVtbl; +#define ID3D12GraphicsCommandList5_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList5_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList5_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList5_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList5_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList5_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList5_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) - interface ID3D12DeviceFactory - { - CONST_VTBL struct ID3D12DeviceFactoryVtbl *lpVtbl; - }; +#define ID3D12GraphicsCommandList5_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) - +#define ID3D12GraphicsCommandList5_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#ifdef COBJMACROS +#define ID3D12GraphicsCommandList5_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) +#define ID3D12GraphicsCommandList5_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12DeviceFactory_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) +#define ID3D12GraphicsCommandList5_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12DeviceFactory_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) +#define ID3D12GraphicsCommandList5_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12DeviceFactory_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) +#define ID3D12GraphicsCommandList5_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) +#define ID3D12GraphicsCommandList5_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12DeviceFactory_InitializeFromGlobalState(This) \ - ( (This)->lpVtbl -> InitializeFromGlobalState(This) ) +#define ID3D12GraphicsCommandList5_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12DeviceFactory_ApplyToGlobalState(This) \ - ( (This)->lpVtbl -> ApplyToGlobalState(This) ) +#define ID3D12GraphicsCommandList5_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) -#define ID3D12DeviceFactory_SetFlags(This,flags) \ - ( (This)->lpVtbl -> SetFlags(This,flags) ) +#define ID3D12GraphicsCommandList5_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) -#define ID3D12DeviceFactory_GetFlags(This) \ - ( (This)->lpVtbl -> GetFlags(This) ) +#define ID3D12GraphicsCommandList5_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) -#define ID3D12DeviceFactory_GetConfigurationInterface(This,clsid,iid,ppv) \ - ( (This)->lpVtbl -> GetConfigurationInterface(This,clsid,iid,ppv) ) +#define ID3D12GraphicsCommandList5_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) -#define ID3D12DeviceFactory_EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) \ - ( (This)->lpVtbl -> EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) ) +#define ID3D12GraphicsCommandList5_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) -#define ID3D12DeviceFactory_CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) \ - ( (This)->lpVtbl -> CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) ) +#define ID3D12GraphicsCommandList5_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) -#endif /* COBJMACROS */ +#define ID3D12GraphicsCommandList5_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) +#define ID3D12GraphicsCommandList5_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#endif /* C style interface */ +#define ID3D12GraphicsCommandList5_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) +#define ID3D12GraphicsCommandList5_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) +#define ID3D12GraphicsCommandList5_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) +#define ID3D12GraphicsCommandList5_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) -#endif /* __ID3D12DeviceFactory_INTERFACE_DEFINED__ */ +#define ID3D12GraphicsCommandList5_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) +#define ID3D12GraphicsCommandList5_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) -/* interface __MIDL_itf_d3d12_0000_0060 */ -/* [local] */ +#define ID3D12GraphicsCommandList5_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) -typedef -enum D3D12_DEVICE_FLAGS - { - D3D12_DEVICE_FLAG_NONE = 0, - D3D12_DEVICE_FLAG_DEBUG_LAYER_ENABLED = 0x1, - D3D12_DEVICE_FLAG_GPU_BASED_VALIDATION_ENABLED = 0x2, - D3D12_DEVICE_FLAG_SYNCHRONIZED_COMMAND_QUEUE_VALIDATION_DISABLED = 0x4, - D3D12_DEVICE_FLAG_DRED_AUTO_BREADCRUMBS_ENABLED = 0x8, - D3D12_DEVICE_FLAG_DRED_PAGE_FAULT_REPORTING_ENABLED = 0x10, - D3D12_DEVICE_FLAG_DRED_WATSON_REPORTING_ENABLED = 0x20, - D3D12_DEVICE_FLAG_DRED_BREADCRUMB_CONTEXT_ENABLED = 0x40, - D3D12_DEVICE_FLAG_DRED_USE_MARKERS_ONLY_BREADCRUMBS = 0x80, - D3D12_DEVICE_FLAG_SHADER_INSTRUMENTATION_ENABLED = 0x100, - D3D12_DEVICE_FLAG_AUTO_DEBUG_NAME_ENABLED = 0x200, - D3D12_DEVICE_FLAG_FORCE_LEGACY_STATE_VALIDATION = 0x400 - } D3D12_DEVICE_FLAGS; +#define ID3D12GraphicsCommandList5_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) -DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FLAGS ); -typedef struct D3D12_DEVICE_CONFIGURATION_DESC - { - D3D12_DEVICE_FLAGS Flags; - UINT GpuBasedValidationFlags; - UINT SDKVersion; - UINT NumEnabledExperimentalFeatures; - } D3D12_DEVICE_CONFIGURATION_DESC; +#define ID3D12GraphicsCommandList5_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) +#define ID3D12GraphicsCommandList5_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_s_ifspec; +#define ID3D12GraphicsCommandList5_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#ifndef __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ -#define __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ +#define ID3D12GraphicsCommandList5_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) -/* interface ID3D12DeviceConfiguration */ -/* [unique][local][object][uuid] */ +#define ID3D12GraphicsCommandList5_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) +#define ID3D12GraphicsCommandList5_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) -EXTERN_C const IID IID_ID3D12DeviceConfiguration; +#define ID3D12GraphicsCommandList5_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78dbf87b-f766-422b-a61c-c8c446bdb9ad") - ID3D12DeviceConfiguration : public IUnknown - { - public: -#if defined(_MSC_VER) || !defined(_WIN32) - virtual D3D12_DEVICE_CONFIGURATION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; -#else - virtual D3D12_DEVICE_CONFIGURATION_DESC *STDMETHODCALLTYPE GetDesc( - D3D12_DEVICE_CONFIGURATION_DESC * RetVal) = 0; -#endif - - virtual HRESULT STDMETHODCALLTYPE GetEnabledExperimentalFeatures( - _Out_writes_(NumGuids) GUID *pGuids, - UINT NumGuids) = 0; - - virtual HRESULT STDMETHODCALLTYPE SerializeVersionedRootSignature( - _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, - _COM_Outptr_ ID3DBlob **ppResult, - _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError) = 0; - - virtual HRESULT STDMETHODCALLTYPE CreateVersionedRootSignatureDeserializer( - _In_reads_bytes_(Size) const void *pBlob, - SIZE_T Size, - REFIID riid, - _COM_Outptr_ void **ppvDeserializer) = 0; - - }; - - -#else /* C style interface */ - typedef struct ID3D12DeviceConfigurationVtbl - { - BEGIN_INTERFACE - - DECLSPEC_XFGVIRT(IUnknown, QueryInterface) - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12DeviceConfiguration * This, - REFIID riid, - _COM_Outptr_ void **ppvObject); - - DECLSPEC_XFGVIRT(IUnknown, AddRef) - ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12DeviceConfiguration * This); - - DECLSPEC_XFGVIRT(IUnknown, Release) - ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12DeviceConfiguration * This); - - DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetDesc) -#if !defined(_WIN32) - D3D12_DEVICE_CONFIGURATION_DESC ( STDMETHODCALLTYPE *GetDesc )( - ID3D12DeviceConfiguration * This); - -#else - D3D12_DEVICE_CONFIGURATION_DESC *( STDMETHODCALLTYPE *GetDesc )( - ID3D12DeviceConfiguration * This, - D3D12_DEVICE_CONFIGURATION_DESC * RetVal); - -#endif - - DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetEnabledExperimentalFeatures) - HRESULT ( STDMETHODCALLTYPE *GetEnabledExperimentalFeatures )( - ID3D12DeviceConfiguration * This, - _Out_writes_(NumGuids) GUID *pGuids, - UINT NumGuids); - - DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, SerializeVersionedRootSignature) - HRESULT ( STDMETHODCALLTYPE *SerializeVersionedRootSignature )( - ID3D12DeviceConfiguration * This, - _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, - _COM_Outptr_ ID3DBlob **ppResult, - _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError); - - DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, CreateVersionedRootSignatureDeserializer) - HRESULT ( STDMETHODCALLTYPE *CreateVersionedRootSignatureDeserializer )( - ID3D12DeviceConfiguration * This, - _In_reads_bytes_(Size) const void *pBlob, - SIZE_T Size, - REFIID riid, - _COM_Outptr_ void **ppvDeserializer); - - END_INTERFACE - } ID3D12DeviceConfigurationVtbl; +#define ID3D12GraphicsCommandList5_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) - interface ID3D12DeviceConfiguration - { - CONST_VTBL struct ID3D12DeviceConfigurationVtbl *lpVtbl; - }; - +#define ID3D12GraphicsCommandList5_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) -#ifdef COBJMACROS +#define ID3D12GraphicsCommandList5_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) -#define ID3D12DeviceConfiguration_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) +#define ID3D12GraphicsCommandList5_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) -#define ID3D12DeviceConfiguration_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) +#define ID3D12GraphicsCommandList5_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) -#define ID3D12DeviceConfiguration_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) +#define ID3D12GraphicsCommandList5_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) -#if !defined(_WIN32) +#define ID3D12GraphicsCommandList5_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) -#define ID3D12DeviceConfiguration_GetDesc(This) \ - ( (This)->lpVtbl -> GetDesc(This) ) -#else -#define ID3D12DeviceConfiguration_GetDesc(This,RetVal) \ - ( (This)->lpVtbl -> GetDesc(This,RetVal) ) -#endif +#define ID3D12GraphicsCommandList5_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) -#define ID3D12DeviceConfiguration_GetEnabledExperimentalFeatures(This,pGuids,NumGuids) \ - ( (This)->lpVtbl -> GetEnabledExperimentalFeatures(This,pGuids,NumGuids) ) +#define ID3D12GraphicsCommandList5_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) -#define ID3D12DeviceConfiguration_SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) \ - ( (This)->lpVtbl -> SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) ) +#define ID3D12GraphicsCommandList5_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList5_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + + +#define ID3D12GraphicsCommandList5_RSSetShadingRate(This,baseShadingRate,combiners) \ + ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) -#define ID3D12DeviceConfiguration_CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) \ - ( (This)->lpVtbl -> CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) ) +#define ID3D12GraphicsCommandList5_RSSetShadingRateImage(This,shadingRateImage) \ + ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) #endif /* COBJMACROS */ @@ -25202,150 +30336,120 @@ EXTERN_C const IID IID_ID3D12DeviceConfiguration; -#endif /* __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ */ +#endif /* __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_d3d12_0000_0061 */ +/* interface __MIDL_itf_d3d12_0000_0068 */ /* [local] */ -typedef -enum D3D12_AXIS_SHADING_RATE - { - D3D12_AXIS_SHADING_RATE_1X = 0, - D3D12_AXIS_SHADING_RATE_2X = 0x1, - D3D12_AXIS_SHADING_RATE_4X = 0x2 - } D3D12_AXIS_SHADING_RATE; - -#define D3D12_SHADING_RATE_X_AXIS_SHIFT 2 -#define D3D12_SHADING_RATE_VALID_MASK 3 -#define D3D12_MAKE_COARSE_SHADING_RATE(x,y) ((x) << D3D12_SHADING_RATE_X_AXIS_SHIFT | (y)) -#define D3D12_GET_COARSE_SHADING_RATE_X_AXIS(x) (((x) >> D3D12_SHADING_RATE_X_AXIS_SHIFT) & D3D12_SHADING_RATE_VALID_MASK) -#define D3D12_GET_COARSE_SHADING_RATE_Y_AXIS(y) ((y) & D3D12_SHADING_RATE_VALID_MASK) -typedef -enum D3D12_SHADING_RATE - { - D3D12_SHADING_RATE_1X1 = 0, - D3D12_SHADING_RATE_1X2 = 0x1, - D3D12_SHADING_RATE_2X1 = 0x4, - D3D12_SHADING_RATE_2X2 = 0x5, - D3D12_SHADING_RATE_2X4 = 0x6, - D3D12_SHADING_RATE_4X2 = 0x9, - D3D12_SHADING_RATE_4X4 = 0xa - } D3D12_SHADING_RATE; - -typedef -enum D3D12_SHADING_RATE_COMBINER +typedef struct D3D12_DISPATCH_MESH_ARGUMENTS { - D3D12_SHADING_RATE_COMBINER_PASSTHROUGH = 0, - D3D12_SHADING_RATE_COMBINER_OVERRIDE = 1, - D3D12_SHADING_RATE_COMBINER_MIN = 2, - D3D12_SHADING_RATE_COMBINER_MAX = 3, - D3D12_SHADING_RATE_COMBINER_SUM = 4 - } D3D12_SHADING_RATE_COMBINER; + UINT ThreadGroupCountX; + UINT ThreadGroupCountY; + UINT ThreadGroupCountZ; + } D3D12_DISPATCH_MESH_ARGUMENTS; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0068_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0068_v0_0_s_ifspec; -#ifndef __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ -#define __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ +#ifndef __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ -/* interface ID3D12GraphicsCommandList5 */ +/* interface ID3D12GraphicsCommandList6 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12GraphicsCommandList5; +EXTERN_C const IID IID_ID3D12GraphicsCommandList6; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("55050859-4024-474c-87f5-6472eaee44ea") - ID3D12GraphicsCommandList5 : public ID3D12GraphicsCommandList4 + MIDL_INTERFACE("c3827890-e548-4cfa-96cf-5689a9370f80") + ID3D12GraphicsCommandList6 : public ID3D12GraphicsCommandList5 { public: - virtual void STDMETHODCALLTYPE RSSetShadingRate( - _In_ D3D12_SHADING_RATE baseShadingRate, - _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners) = 0; - - virtual void STDMETHODCALLTYPE RSSetShadingRateImage( - _In_opt_ ID3D12Resource *shadingRateImage) = 0; + virtual void STDMETHODCALLTYPE DispatchMesh( + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ) = 0; }; #else /* C style interface */ - typedef struct ID3D12GraphicsCommandList5Vtbl + typedef struct ID3D12GraphicsCommandList6Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12GraphicsCommandList5 * This); + ID3D12GraphicsCommandList6 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12GraphicsCommandList5 * This); + ID3D12GraphicsCommandList6 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_z_ LPCWSTR Name); DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, REFIID riid, _COM_Outptr_opt_ void **ppvDevice); DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( - ID3D12GraphicsCommandList5 * This); + ID3D12GraphicsCommandList6 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) HRESULT ( STDMETHODCALLTYPE *Close )( - ID3D12GraphicsCommandList5 * This); + ID3D12GraphicsCommandList6 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12CommandAllocator *pAllocator, _In_opt_ ID3D12PipelineState *pInitialState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) void ( STDMETHODCALLTYPE *ClearState )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_opt_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) void ( STDMETHODCALLTYPE *DrawInstanced )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT VertexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartVertexLocation, @@ -25353,7 +30457,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT IndexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartIndexLocation, @@ -25362,14 +30466,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) void ( STDMETHODCALLTYPE *Dispatch )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT ThreadGroupCountX, _In_ UINT ThreadGroupCountY, _In_ UINT ThreadGroupCountZ); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) void ( STDMETHODCALLTYPE *CopyBufferRegion )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -25378,7 +30482,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) void ( STDMETHODCALLTYPE *CopyTextureRegion )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, UINT DstX, UINT DstY, @@ -25388,13 +30492,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) void ( STDMETHODCALLTYPE *CopyResource )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12Resource *pDstResource, _In_ ID3D12Resource *pSrcResource); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) void ( STDMETHODCALLTYPE *CopyTiles )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12Resource *pTiledResource, _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, @@ -25404,7 +30508,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) void ( STDMETHODCALLTYPE *ResolveSubresource )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ ID3D12Resource *pSrcResource, @@ -25413,92 +30517,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) void ( STDMETHODCALLTYPE *RSSetViewports )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) void ( STDMETHODCALLTYPE *RSSetScissorRects )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, _In_reads_( NumRects) const D3D12_RECT *pRects); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) void ( STDMETHODCALLTYPE *OMSetBlendFactor )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) void ( STDMETHODCALLTYPE *OMSetStencilRef )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT StencilRef); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) void ( STDMETHODCALLTYPE *SetPipelineState )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) void ( STDMETHODCALLTYPE *ResourceBarrier )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT NumBarriers, _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) void ( STDMETHODCALLTYPE *ExecuteBundle )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12GraphicsCommandList *pCommandList); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT NumDescriptorHeaps, _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) void ( STDMETHODCALLTYPE *SetComputeRootSignature )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -25506,7 +30610,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -25514,62 +30618,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) void ( STDMETHODCALLTYPE *IASetIndexBuffer )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) void ( STDMETHODCALLTYPE *IASetVertexBuffers )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) void ( STDMETHODCALLTYPE *SOSetTargets )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) void ( STDMETHODCALLTYPE *OMSetRenderTargets )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT NumRenderTargetDescriptors, _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, _In_ BOOL RTsSingleHandleToDescriptorRange, @@ -25577,7 +30681,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) void ( STDMETHODCALLTYPE *ClearDepthStencilView )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, _In_ D3D12_CLEAR_FLAGS ClearFlags, _In_ FLOAT Depth, @@ -25587,7 +30691,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) void ( STDMETHODCALLTYPE *ClearRenderTargetView )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, _In_ const FLOAT ColorRGBA[ 4 ], _In_ UINT NumRects, @@ -25595,7 +30699,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -25605,7 +30709,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -25615,27 +30719,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) void ( STDMETHODCALLTYPE *DiscardResource )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12Resource *pResource, _In_opt_ const D3D12_DISCARD_REGION *pRegion); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) void ( STDMETHODCALLTYPE *BeginQuery )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) void ( STDMETHODCALLTYPE *EndQuery )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) void ( STDMETHODCALLTYPE *ResolveQueryData )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT StartIndex, @@ -25645,32 +30749,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) void ( STDMETHODCALLTYPE *SetPredication )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_opt_ ID3D12Resource *pBuffer, _In_ UINT64 AlignedBufferOffset, _In_ D3D12_PREDICATION_OP Operation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) void ( STDMETHODCALLTYPE *SetMarker )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) void ( STDMETHODCALLTYPE *BeginEvent )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) void ( STDMETHODCALLTYPE *EndEvent )( - ID3D12GraphicsCommandList5 * This); + ID3D12GraphicsCommandList6 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) void ( STDMETHODCALLTYPE *ExecuteIndirect )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12CommandSignature *pCommandSignature, _In_ UINT MaxCommandCount, _In_ ID3D12Resource *pArgumentBuffer, @@ -25680,7 +30784,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -25691,7 +30795,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -25702,20 +30806,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) void ( STDMETHODCALLTYPE *OMSetDepthBounds )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ FLOAT Min, _In_ FLOAT Max); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) void ( STDMETHODCALLTYPE *SetSamplePositions )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT NumSamplesPerPixel, _In_ UINT NumPixels, _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ UINT DstX, @@ -25728,24 +30832,24 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) void ( STDMETHODCALLTYPE *SetViewInstanceMask )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT Mask); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) void ( STDMETHODCALLTYPE *WriteBufferImmediate )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, UINT Count, _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) void ( STDMETHODCALLTYPE *BeginRenderPass )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ UINT NumRenderTargets, _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, @@ -25753,70 +30857,77 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) void ( STDMETHODCALLTYPE *EndRenderPass )( - ID3D12GraphicsCommandList5 * This); + ID3D12GraphicsCommandList6 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) void ( STDMETHODCALLTYPE *InitializeMetaCommand )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, _In_ SIZE_T InitializationParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, _In_ SIZE_T ExecutionParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, _In_ UINT NumPostbuildInfoDescs, _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, _In_ UINT NumSourceAccelerationStructures, _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) void ( STDMETHODCALLTYPE *SetPipelineState1 )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ ID3D12StateObject *pStateObject); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) void ( STDMETHODCALLTYPE *DispatchRays )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) void ( STDMETHODCALLTYPE *RSSetShadingRate )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_ D3D12_SHADING_RATE baseShadingRate, _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( - ID3D12GraphicsCommandList5 * This, + ID3D12GraphicsCommandList6 * This, _In_opt_ ID3D12Resource *shadingRateImage); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) + void ( STDMETHODCALLTYPE *DispatchMesh )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + END_INTERFACE - } ID3D12GraphicsCommandList5Vtbl; + } ID3D12GraphicsCommandList6Vtbl; - interface ID3D12GraphicsCommandList5 + interface ID3D12GraphicsCommandList6 { - CONST_VTBL struct ID3D12GraphicsCommandList5Vtbl *lpVtbl; + CONST_VTBL struct ID3D12GraphicsCommandList6Vtbl *lpVtbl; }; @@ -25824,374 +30935,362 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5; #ifdef COBJMACROS -#define ID3D12GraphicsCommandList5_QueryInterface(This,riid,ppvObject) \ +#define ID3D12GraphicsCommandList6_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12GraphicsCommandList5_AddRef(This) \ +#define ID3D12GraphicsCommandList6_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12GraphicsCommandList5_Release(This) \ +#define ID3D12GraphicsCommandList6_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12GraphicsCommandList5_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12GraphicsCommandList6_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12GraphicsCommandList5_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12GraphicsCommandList6_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12GraphicsCommandList5_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12GraphicsCommandList6_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12GraphicsCommandList5_SetName(This,Name) \ +#define ID3D12GraphicsCommandList6_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12GraphicsCommandList5_GetDevice(This,riid,ppvDevice) \ +#define ID3D12GraphicsCommandList6_GetDevice(This,riid,ppvDevice) \ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12GraphicsCommandList5_GetType(This) \ +#define ID3D12GraphicsCommandList6_GetType(This) \ ( (This)->lpVtbl -> GetType(This) ) -#define ID3D12GraphicsCommandList5_Close(This) \ +#define ID3D12GraphicsCommandList6_Close(This) \ ( (This)->lpVtbl -> Close(This) ) -#define ID3D12GraphicsCommandList5_Reset(This,pAllocator,pInitialState) \ +#define ID3D12GraphicsCommandList6_Reset(This,pAllocator,pInitialState) \ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) -#define ID3D12GraphicsCommandList5_ClearState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList6_ClearState(This,pPipelineState) \ ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList5_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList6_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList5_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList6_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList5_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ +#define ID3D12GraphicsCommandList6_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) -#define ID3D12GraphicsCommandList5_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ +#define ID3D12GraphicsCommandList6_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) -#define ID3D12GraphicsCommandList5_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ +#define ID3D12GraphicsCommandList6_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) -#define ID3D12GraphicsCommandList5_CopyResource(This,pDstResource,pSrcResource) \ +#define ID3D12GraphicsCommandList6_CopyResource(This,pDstResource,pSrcResource) \ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) -#define ID3D12GraphicsCommandList5_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ +#define ID3D12GraphicsCommandList6_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) -#define ID3D12GraphicsCommandList5_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ +#define ID3D12GraphicsCommandList6_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) -#define ID3D12GraphicsCommandList5_IASetPrimitiveTopology(This,PrimitiveTopology) \ +#define ID3D12GraphicsCommandList6_IASetPrimitiveTopology(This,PrimitiveTopology) \ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) -#define ID3D12GraphicsCommandList5_RSSetViewports(This,NumViewports,pViewports) \ +#define ID3D12GraphicsCommandList6_RSSetViewports(This,NumViewports,pViewports) \ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) -#define ID3D12GraphicsCommandList5_RSSetScissorRects(This,NumRects,pRects) \ +#define ID3D12GraphicsCommandList6_RSSetScissorRects(This,NumRects,pRects) \ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) -#define ID3D12GraphicsCommandList5_OMSetBlendFactor(This,BlendFactor) \ +#define ID3D12GraphicsCommandList6_OMSetBlendFactor(This,BlendFactor) \ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) -#define ID3D12GraphicsCommandList5_OMSetStencilRef(This,StencilRef) \ +#define ID3D12GraphicsCommandList6_OMSetStencilRef(This,StencilRef) \ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) -#define ID3D12GraphicsCommandList5_SetPipelineState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList6_SetPipelineState(This,pPipelineState) \ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList5_ResourceBarrier(This,NumBarriers,pBarriers) \ +#define ID3D12GraphicsCommandList6_ResourceBarrier(This,NumBarriers,pBarriers) \ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) -#define ID3D12GraphicsCommandList5_ExecuteBundle(This,pCommandList) \ +#define ID3D12GraphicsCommandList6_ExecuteBundle(This,pCommandList) \ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) -#define ID3D12GraphicsCommandList5_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ +#define ID3D12GraphicsCommandList6_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) -#define ID3D12GraphicsCommandList5_SetComputeRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList6_SetComputeRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList5_SetGraphicsRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList6_SetGraphicsRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList5_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList6_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList5_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList6_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList5_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList5_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList5_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList5_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList5_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList6_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList5_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList6_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList5_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList6_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList5_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList6_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList5_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList6_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList5_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList6_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList5_IASetIndexBuffer(This,pView) \ +#define ID3D12GraphicsCommandList6_IASetIndexBuffer(This,pView) \ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) -#define ID3D12GraphicsCommandList5_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList6_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList5_SOSetTargets(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList6_SOSetTargets(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList5_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ +#define ID3D12GraphicsCommandList6_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) -#define ID3D12GraphicsCommandList5_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ +#define ID3D12GraphicsCommandList6_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) -#define ID3D12GraphicsCommandList5_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ +#define ID3D12GraphicsCommandList6_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) -#define ID3D12GraphicsCommandList5_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList5_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList5_DiscardResource(This,pResource,pRegion) \ +#define ID3D12GraphicsCommandList6_DiscardResource(This,pResource,pRegion) \ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) -#define ID3D12GraphicsCommandList5_BeginQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList6_BeginQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList5_EndQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList6_EndQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList5_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ +#define ID3D12GraphicsCommandList6_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) -#define ID3D12GraphicsCommandList5_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ +#define ID3D12GraphicsCommandList6_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) -#define ID3D12GraphicsCommandList5_SetMarker(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList6_SetMarker(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList5_BeginEvent(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList6_BeginEvent(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList5_EndEvent(This) \ +#define ID3D12GraphicsCommandList6_EndEvent(This) \ ( (This)->lpVtbl -> EndEvent(This) ) -#define ID3D12GraphicsCommandList5_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ +#define ID3D12GraphicsCommandList6_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) -#define ID3D12GraphicsCommandList5_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList5_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList5_OMSetDepthBounds(This,Min,Max) \ +#define ID3D12GraphicsCommandList6_OMSetDepthBounds(This,Min,Max) \ ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) -#define ID3D12GraphicsCommandList5_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ +#define ID3D12GraphicsCommandList6_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) -#define ID3D12GraphicsCommandList5_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ +#define ID3D12GraphicsCommandList6_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) -#define ID3D12GraphicsCommandList5_SetViewInstanceMask(This,Mask) \ +#define ID3D12GraphicsCommandList6_SetViewInstanceMask(This,Mask) \ ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) -#define ID3D12GraphicsCommandList5_WriteBufferImmediate(This,Count,pParams,pModes) \ +#define ID3D12GraphicsCommandList6_WriteBufferImmediate(This,Count,pParams,pModes) \ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) -#define ID3D12GraphicsCommandList5_SetProtectedResourceSession(This,pProtectedResourceSession) \ +#define ID3D12GraphicsCommandList6_SetProtectedResourceSession(This,pProtectedResourceSession) \ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) -#define ID3D12GraphicsCommandList5_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ +#define ID3D12GraphicsCommandList6_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) -#define ID3D12GraphicsCommandList5_EndRenderPass(This) \ +#define ID3D12GraphicsCommandList6_EndRenderPass(This) \ ( (This)->lpVtbl -> EndRenderPass(This) ) -#define ID3D12GraphicsCommandList5_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList6_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList5_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList6_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList5_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ +#define ID3D12GraphicsCommandList6_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) -#define ID3D12GraphicsCommandList5_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ +#define ID3D12GraphicsCommandList6_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) -#define ID3D12GraphicsCommandList5_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ +#define ID3D12GraphicsCommandList6_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) -#define ID3D12GraphicsCommandList5_SetPipelineState1(This,pStateObject) \ +#define ID3D12GraphicsCommandList6_SetPipelineState1(This,pStateObject) \ ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) -#define ID3D12GraphicsCommandList5_DispatchRays(This,pDesc) \ +#define ID3D12GraphicsCommandList6_DispatchRays(This,pDesc) \ ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) -#define ID3D12GraphicsCommandList5_RSSetShadingRate(This,baseShadingRate,combiners) \ +#define ID3D12GraphicsCommandList6_RSSetShadingRate(This,baseShadingRate,combiners) \ ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) -#define ID3D12GraphicsCommandList5_RSSetShadingRateImage(This,shadingRateImage) \ +#define ID3D12GraphicsCommandList6_RSSetShadingRateImage(This,shadingRateImage) \ ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - +#define ID3D12GraphicsCommandList6_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) +#endif /* COBJMACROS */ -#endif /* __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ */ +#endif /* C style interface */ -/* interface __MIDL_itf_d3d12_0000_0062 */ -/* [local] */ -typedef struct D3D12_DISPATCH_MESH_ARGUMENTS - { - UINT ThreadGroupCountX; - UINT ThreadGroupCountY; - UINT ThreadGroupCountZ; - } D3D12_DISPATCH_MESH_ARGUMENTS; +#endif /* __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ */ -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_s_ifspec; -#ifndef __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ -#define __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ +#ifndef __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ -/* interface ID3D12GraphicsCommandList6 */ +/* interface ID3D12GraphicsCommandList7 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12GraphicsCommandList6; +EXTERN_C const IID IID_ID3D12GraphicsCommandList7; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("c3827890-e548-4cfa-96cf-5689a9370f80") - ID3D12GraphicsCommandList6 : public ID3D12GraphicsCommandList5 + MIDL_INTERFACE("dd171223-8b61-4769-90e3-160ccde4e2c1") + ID3D12GraphicsCommandList7 : public ID3D12GraphicsCommandList6 { public: - virtual void STDMETHODCALLTYPE DispatchMesh( - _In_ UINT ThreadGroupCountX, - _In_ UINT ThreadGroupCountY, - _In_ UINT ThreadGroupCountZ) = 0; + virtual void STDMETHODCALLTYPE Barrier( + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; }; #else /* C style interface */ - typedef struct ID3D12GraphicsCommandList6Vtbl + typedef struct ID3D12GraphicsCommandList7Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12GraphicsCommandList6 * This); + ID3D12GraphicsCommandList7 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12GraphicsCommandList6 * This); + ID3D12GraphicsCommandList7 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_z_ LPCWSTR Name); DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, REFIID riid, _COM_Outptr_opt_ void **ppvDevice); DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( - ID3D12GraphicsCommandList6 * This); + ID3D12GraphicsCommandList7 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) HRESULT ( STDMETHODCALLTYPE *Close )( - ID3D12GraphicsCommandList6 * This); + ID3D12GraphicsCommandList7 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12CommandAllocator *pAllocator, _In_opt_ ID3D12PipelineState *pInitialState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) void ( STDMETHODCALLTYPE *ClearState )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_opt_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) void ( STDMETHODCALLTYPE *DrawInstanced )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT VertexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartVertexLocation, @@ -26199,7 +31298,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT IndexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartIndexLocation, @@ -26208,14 +31307,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) void ( STDMETHODCALLTYPE *Dispatch )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT ThreadGroupCountX, _In_ UINT ThreadGroupCountY, _In_ UINT ThreadGroupCountZ); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) void ( STDMETHODCALLTYPE *CopyBufferRegion )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -26224,7 +31323,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) void ( STDMETHODCALLTYPE *CopyTextureRegion )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, UINT DstX, UINT DstY, @@ -26234,13 +31333,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) void ( STDMETHODCALLTYPE *CopyResource )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12Resource *pDstResource, _In_ ID3D12Resource *pSrcResource); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) void ( STDMETHODCALLTYPE *CopyTiles )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12Resource *pTiledResource, _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, @@ -26250,7 +31349,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) void ( STDMETHODCALLTYPE *ResolveSubresource )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ ID3D12Resource *pSrcResource, @@ -26259,92 +31358,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) void ( STDMETHODCALLTYPE *RSSetViewports )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) void ( STDMETHODCALLTYPE *RSSetScissorRects )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, _In_reads_( NumRects) const D3D12_RECT *pRects); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) void ( STDMETHODCALLTYPE *OMSetBlendFactor )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) void ( STDMETHODCALLTYPE *OMSetStencilRef )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT StencilRef); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) void ( STDMETHODCALLTYPE *SetPipelineState )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) void ( STDMETHODCALLTYPE *ResourceBarrier )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT NumBarriers, _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) void ( STDMETHODCALLTYPE *ExecuteBundle )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12GraphicsCommandList *pCommandList); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT NumDescriptorHeaps, _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) void ( STDMETHODCALLTYPE *SetComputeRootSignature )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -26352,7 +31451,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -26360,62 +31459,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) void ( STDMETHODCALLTYPE *IASetIndexBuffer )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) void ( STDMETHODCALLTYPE *IASetVertexBuffers )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) void ( STDMETHODCALLTYPE *SOSetTargets )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) void ( STDMETHODCALLTYPE *OMSetRenderTargets )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT NumRenderTargetDescriptors, _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, _In_ BOOL RTsSingleHandleToDescriptorRange, @@ -26423,7 +31522,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) void ( STDMETHODCALLTYPE *ClearDepthStencilView )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, _In_ D3D12_CLEAR_FLAGS ClearFlags, _In_ FLOAT Depth, @@ -26433,7 +31532,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) void ( STDMETHODCALLTYPE *ClearRenderTargetView )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, _In_ const FLOAT ColorRGBA[ 4 ], _In_ UINT NumRects, @@ -26441,7 +31540,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -26451,7 +31550,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -26461,27 +31560,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) void ( STDMETHODCALLTYPE *DiscardResource )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12Resource *pResource, _In_opt_ const D3D12_DISCARD_REGION *pRegion); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) void ( STDMETHODCALLTYPE *BeginQuery )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) void ( STDMETHODCALLTYPE *EndQuery )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) void ( STDMETHODCALLTYPE *ResolveQueryData )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT StartIndex, @@ -26491,32 +31590,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) void ( STDMETHODCALLTYPE *SetPredication )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_opt_ ID3D12Resource *pBuffer, _In_ UINT64 AlignedBufferOffset, _In_ D3D12_PREDICATION_OP Operation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) void ( STDMETHODCALLTYPE *SetMarker )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) void ( STDMETHODCALLTYPE *BeginEvent )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) void ( STDMETHODCALLTYPE *EndEvent )( - ID3D12GraphicsCommandList6 * This); + ID3D12GraphicsCommandList7 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) void ( STDMETHODCALLTYPE *ExecuteIndirect )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12CommandSignature *pCommandSignature, _In_ UINT MaxCommandCount, _In_ ID3D12Resource *pArgumentBuffer, @@ -26526,7 +31625,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -26537,7 +31636,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -26548,20 +31647,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) void ( STDMETHODCALLTYPE *OMSetDepthBounds )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ FLOAT Min, _In_ FLOAT Max); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) void ( STDMETHODCALLTYPE *SetSamplePositions )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT NumSamplesPerPixel, _In_ UINT NumPixels, _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ UINT DstX, @@ -26574,24 +31673,24 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) void ( STDMETHODCALLTYPE *SetViewInstanceMask )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT Mask); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) void ( STDMETHODCALLTYPE *WriteBufferImmediate )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, UINT Count, _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) void ( STDMETHODCALLTYPE *BeginRenderPass )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT NumRenderTargets, _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, @@ -26599,77 +31698,83 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) void ( STDMETHODCALLTYPE *EndRenderPass )( - ID3D12GraphicsCommandList6 * This); + ID3D12GraphicsCommandList7 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) void ( STDMETHODCALLTYPE *InitializeMetaCommand )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, _In_ SIZE_T InitializationParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, _In_ SIZE_T ExecutionParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, _In_ UINT NumPostbuildInfoDescs, _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, _In_ UINT NumSourceAccelerationStructures, _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) void ( STDMETHODCALLTYPE *SetPipelineState1 )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ ID3D12StateObject *pStateObject); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) void ( STDMETHODCALLTYPE *DispatchRays )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) void ( STDMETHODCALLTYPE *RSSetShadingRate )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ D3D12_SHADING_RATE baseShadingRate, _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_opt_ ID3D12Resource *shadingRateImage); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) void ( STDMETHODCALLTYPE *DispatchMesh )( - ID3D12GraphicsCommandList6 * This, + ID3D12GraphicsCommandList7 * This, _In_ UINT ThreadGroupCountX, _In_ UINT ThreadGroupCountY, _In_ UINT ThreadGroupCountZ); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12GraphicsCommandList7 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + END_INTERFACE - } ID3D12GraphicsCommandList6Vtbl; + } ID3D12GraphicsCommandList7Vtbl; - interface ID3D12GraphicsCommandList6 + interface ID3D12GraphicsCommandList7 { - CONST_VTBL struct ID3D12GraphicsCommandList6Vtbl *lpVtbl; + CONST_VTBL struct ID3D12GraphicsCommandList7Vtbl *lpVtbl; }; @@ -26677,256 +31782,260 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; #ifdef COBJMACROS -#define ID3D12GraphicsCommandList6_QueryInterface(This,riid,ppvObject) \ +#define ID3D12GraphicsCommandList7_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12GraphicsCommandList6_AddRef(This) \ +#define ID3D12GraphicsCommandList7_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12GraphicsCommandList6_Release(This) \ +#define ID3D12GraphicsCommandList7_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12GraphicsCommandList6_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12GraphicsCommandList7_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12GraphicsCommandList6_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12GraphicsCommandList7_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12GraphicsCommandList6_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12GraphicsCommandList7_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12GraphicsCommandList6_SetName(This,Name) \ +#define ID3D12GraphicsCommandList7_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12GraphicsCommandList6_GetDevice(This,riid,ppvDevice) \ +#define ID3D12GraphicsCommandList7_GetDevice(This,riid,ppvDevice) \ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12GraphicsCommandList6_GetType(This) \ +#define ID3D12GraphicsCommandList7_GetType(This) \ ( (This)->lpVtbl -> GetType(This) ) -#define ID3D12GraphicsCommandList6_Close(This) \ +#define ID3D12GraphicsCommandList7_Close(This) \ ( (This)->lpVtbl -> Close(This) ) -#define ID3D12GraphicsCommandList6_Reset(This,pAllocator,pInitialState) \ +#define ID3D12GraphicsCommandList7_Reset(This,pAllocator,pInitialState) \ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) -#define ID3D12GraphicsCommandList6_ClearState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList7_ClearState(This,pPipelineState) \ ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList6_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList7_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList6_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList7_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList6_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ +#define ID3D12GraphicsCommandList7_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) -#define ID3D12GraphicsCommandList6_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ +#define ID3D12GraphicsCommandList7_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) -#define ID3D12GraphicsCommandList6_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ +#define ID3D12GraphicsCommandList7_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) -#define ID3D12GraphicsCommandList6_CopyResource(This,pDstResource,pSrcResource) \ +#define ID3D12GraphicsCommandList7_CopyResource(This,pDstResource,pSrcResource) \ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) -#define ID3D12GraphicsCommandList6_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ +#define ID3D12GraphicsCommandList7_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) -#define ID3D12GraphicsCommandList6_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ +#define ID3D12GraphicsCommandList7_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) -#define ID3D12GraphicsCommandList6_IASetPrimitiveTopology(This,PrimitiveTopology) \ +#define ID3D12GraphicsCommandList7_IASetPrimitiveTopology(This,PrimitiveTopology) \ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) -#define ID3D12GraphicsCommandList6_RSSetViewports(This,NumViewports,pViewports) \ +#define ID3D12GraphicsCommandList7_RSSetViewports(This,NumViewports,pViewports) \ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) -#define ID3D12GraphicsCommandList6_RSSetScissorRects(This,NumRects,pRects) \ +#define ID3D12GraphicsCommandList7_RSSetScissorRects(This,NumRects,pRects) \ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) -#define ID3D12GraphicsCommandList6_OMSetBlendFactor(This,BlendFactor) \ +#define ID3D12GraphicsCommandList7_OMSetBlendFactor(This,BlendFactor) \ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) -#define ID3D12GraphicsCommandList6_OMSetStencilRef(This,StencilRef) \ +#define ID3D12GraphicsCommandList7_OMSetStencilRef(This,StencilRef) \ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) -#define ID3D12GraphicsCommandList6_SetPipelineState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList7_SetPipelineState(This,pPipelineState) \ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList6_ResourceBarrier(This,NumBarriers,pBarriers) \ +#define ID3D12GraphicsCommandList7_ResourceBarrier(This,NumBarriers,pBarriers) \ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) -#define ID3D12GraphicsCommandList6_ExecuteBundle(This,pCommandList) \ +#define ID3D12GraphicsCommandList7_ExecuteBundle(This,pCommandList) \ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) -#define ID3D12GraphicsCommandList6_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ +#define ID3D12GraphicsCommandList7_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) -#define ID3D12GraphicsCommandList6_SetComputeRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList7_SetComputeRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList6_SetGraphicsRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList7_SetGraphicsRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList6_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList7_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList6_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList7_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList6_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList7_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList6_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList7_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList6_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList7_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList6_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList7_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList6_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList7_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList6_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList7_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList6_IASetIndexBuffer(This,pView) \ +#define ID3D12GraphicsCommandList7_IASetIndexBuffer(This,pView) \ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) -#define ID3D12GraphicsCommandList6_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList7_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList6_SOSetTargets(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList7_SOSetTargets(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList6_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ +#define ID3D12GraphicsCommandList7_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) -#define ID3D12GraphicsCommandList6_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ +#define ID3D12GraphicsCommandList7_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) -#define ID3D12GraphicsCommandList6_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ +#define ID3D12GraphicsCommandList7_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) -#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList6_DiscardResource(This,pResource,pRegion) \ +#define ID3D12GraphicsCommandList7_DiscardResource(This,pResource,pRegion) \ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) -#define ID3D12GraphicsCommandList6_BeginQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList7_BeginQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList6_EndQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList7_EndQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList6_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ +#define ID3D12GraphicsCommandList7_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) -#define ID3D12GraphicsCommandList6_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ +#define ID3D12GraphicsCommandList7_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) -#define ID3D12GraphicsCommandList6_SetMarker(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList7_SetMarker(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList6_BeginEvent(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList7_BeginEvent(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList6_EndEvent(This) \ +#define ID3D12GraphicsCommandList7_EndEvent(This) \ ( (This)->lpVtbl -> EndEvent(This) ) -#define ID3D12GraphicsCommandList6_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ +#define ID3D12GraphicsCommandList7_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) -#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList6_OMSetDepthBounds(This,Min,Max) \ +#define ID3D12GraphicsCommandList7_OMSetDepthBounds(This,Min,Max) \ ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) -#define ID3D12GraphicsCommandList6_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ +#define ID3D12GraphicsCommandList7_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) -#define ID3D12GraphicsCommandList6_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ +#define ID3D12GraphicsCommandList7_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) -#define ID3D12GraphicsCommandList6_SetViewInstanceMask(This,Mask) \ +#define ID3D12GraphicsCommandList7_SetViewInstanceMask(This,Mask) \ ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) -#define ID3D12GraphicsCommandList6_WriteBufferImmediate(This,Count,pParams,pModes) \ +#define ID3D12GraphicsCommandList7_WriteBufferImmediate(This,Count,pParams,pModes) \ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) -#define ID3D12GraphicsCommandList6_SetProtectedResourceSession(This,pProtectedResourceSession) \ +#define ID3D12GraphicsCommandList7_SetProtectedResourceSession(This,pProtectedResourceSession) \ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) -#define ID3D12GraphicsCommandList6_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ +#define ID3D12GraphicsCommandList7_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) -#define ID3D12GraphicsCommandList6_EndRenderPass(This) \ +#define ID3D12GraphicsCommandList7_EndRenderPass(This) \ ( (This)->lpVtbl -> EndRenderPass(This) ) -#define ID3D12GraphicsCommandList6_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList7_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList6_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList7_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList6_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ +#define ID3D12GraphicsCommandList7_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) -#define ID3D12GraphicsCommandList6_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ +#define ID3D12GraphicsCommandList7_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) -#define ID3D12GraphicsCommandList6_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ +#define ID3D12GraphicsCommandList7_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) -#define ID3D12GraphicsCommandList6_SetPipelineState1(This,pStateObject) \ +#define ID3D12GraphicsCommandList7_SetPipelineState1(This,pStateObject) \ ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) -#define ID3D12GraphicsCommandList6_DispatchRays(This,pDesc) \ +#define ID3D12GraphicsCommandList7_DispatchRays(This,pDesc) \ ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) -#define ID3D12GraphicsCommandList6_RSSetShadingRate(This,baseShadingRate,combiners) \ +#define ID3D12GraphicsCommandList7_RSSetShadingRate(This,baseShadingRate,combiners) \ ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) -#define ID3D12GraphicsCommandList6_RSSetShadingRateImage(This,shadingRateImage) \ +#define ID3D12GraphicsCommandList7_RSSetShadingRateImage(This,shadingRateImage) \ ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) -#define ID3D12GraphicsCommandList6_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ +#define ID3D12GraphicsCommandList7_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList7_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + #endif /* COBJMACROS */ @@ -26935,104 +32044,104 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList6; -#endif /* __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ */ +#endif /* __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ */ -#ifndef __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ -#define __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ +#ifndef __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ -/* interface ID3D12GraphicsCommandList7 */ +/* interface ID3D12GraphicsCommandList8 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12GraphicsCommandList7; +EXTERN_C const IID IID_ID3D12GraphicsCommandList8; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("dd171223-8b61-4769-90e3-160ccde4e2c1") - ID3D12GraphicsCommandList7 : public ID3D12GraphicsCommandList6 + MIDL_INTERFACE("ee936ef9-599d-4d28-938e-23c4ad05ce51") + ID3D12GraphicsCommandList8 : public ID3D12GraphicsCommandList7 { public: - virtual void STDMETHODCALLTYPE Barrier( - UINT32 NumBarrierGroups, - _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; + virtual void STDMETHODCALLTYPE OMSetFrontAndBackStencilRef( + _In_ UINT FrontStencilRef, + _In_ UINT BackStencilRef) = 0; }; #else /* C style interface */ - typedef struct ID3D12GraphicsCommandList7Vtbl + typedef struct ID3D12GraphicsCommandList8Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12GraphicsCommandList7 * This); + ID3D12GraphicsCommandList8 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12GraphicsCommandList7 * This); + ID3D12GraphicsCommandList8 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_z_ LPCWSTR Name); DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, REFIID riid, _COM_Outptr_opt_ void **ppvDevice); DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( - ID3D12GraphicsCommandList7 * This); + ID3D12GraphicsCommandList8 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) HRESULT ( STDMETHODCALLTYPE *Close )( - ID3D12GraphicsCommandList7 * This); + ID3D12GraphicsCommandList8 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12CommandAllocator *pAllocator, _In_opt_ ID3D12PipelineState *pInitialState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) void ( STDMETHODCALLTYPE *ClearState )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_opt_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) void ( STDMETHODCALLTYPE *DrawInstanced )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT VertexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartVertexLocation, @@ -27040,7 +32149,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT IndexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartIndexLocation, @@ -27049,14 +32158,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) void ( STDMETHODCALLTYPE *Dispatch )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT ThreadGroupCountX, _In_ UINT ThreadGroupCountY, _In_ UINT ThreadGroupCountZ); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) void ( STDMETHODCALLTYPE *CopyBufferRegion )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -27065,7 +32174,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) void ( STDMETHODCALLTYPE *CopyTextureRegion )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, UINT DstX, UINT DstY, @@ -27075,13 +32184,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) void ( STDMETHODCALLTYPE *CopyResource )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12Resource *pDstResource, _In_ ID3D12Resource *pSrcResource); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) void ( STDMETHODCALLTYPE *CopyTiles )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12Resource *pTiledResource, _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, @@ -27091,7 +32200,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) void ( STDMETHODCALLTYPE *ResolveSubresource )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ ID3D12Resource *pSrcResource, @@ -27100,92 +32209,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) void ( STDMETHODCALLTYPE *RSSetViewports )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) void ( STDMETHODCALLTYPE *RSSetScissorRects )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, _In_reads_( NumRects) const D3D12_RECT *pRects); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) void ( STDMETHODCALLTYPE *OMSetBlendFactor )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) void ( STDMETHODCALLTYPE *OMSetStencilRef )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT StencilRef); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) void ( STDMETHODCALLTYPE *SetPipelineState )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) void ( STDMETHODCALLTYPE *ResourceBarrier )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT NumBarriers, _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) void ( STDMETHODCALLTYPE *ExecuteBundle )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12GraphicsCommandList *pCommandList); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT NumDescriptorHeaps, _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) void ( STDMETHODCALLTYPE *SetComputeRootSignature )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -27193,7 +32302,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -27201,62 +32310,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) void ( STDMETHODCALLTYPE *IASetIndexBuffer )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) void ( STDMETHODCALLTYPE *IASetVertexBuffers )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) void ( STDMETHODCALLTYPE *SOSetTargets )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) void ( STDMETHODCALLTYPE *OMSetRenderTargets )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT NumRenderTargetDescriptors, _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, _In_ BOOL RTsSingleHandleToDescriptorRange, @@ -27264,7 +32373,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) void ( STDMETHODCALLTYPE *ClearDepthStencilView )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, _In_ D3D12_CLEAR_FLAGS ClearFlags, _In_ FLOAT Depth, @@ -27274,7 +32383,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) void ( STDMETHODCALLTYPE *ClearRenderTargetView )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, _In_ const FLOAT ColorRGBA[ 4 ], _In_ UINT NumRects, @@ -27282,7 +32391,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -27292,7 +32401,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -27302,27 +32411,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) void ( STDMETHODCALLTYPE *DiscardResource )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12Resource *pResource, _In_opt_ const D3D12_DISCARD_REGION *pRegion); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) void ( STDMETHODCALLTYPE *BeginQuery )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) void ( STDMETHODCALLTYPE *EndQuery )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) void ( STDMETHODCALLTYPE *ResolveQueryData )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT StartIndex, @@ -27332,32 +32441,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) void ( STDMETHODCALLTYPE *SetPredication )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_opt_ ID3D12Resource *pBuffer, _In_ UINT64 AlignedBufferOffset, _In_ D3D12_PREDICATION_OP Operation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) void ( STDMETHODCALLTYPE *SetMarker )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) void ( STDMETHODCALLTYPE *BeginEvent )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) void ( STDMETHODCALLTYPE *EndEvent )( - ID3D12GraphicsCommandList7 * This); + ID3D12GraphicsCommandList8 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) void ( STDMETHODCALLTYPE *ExecuteIndirect )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12CommandSignature *pCommandSignature, _In_ UINT MaxCommandCount, _In_ ID3D12Resource *pArgumentBuffer, @@ -27367,7 +32476,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -27378,7 +32487,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -27389,20 +32498,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) void ( STDMETHODCALLTYPE *OMSetDepthBounds )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ FLOAT Min, _In_ FLOAT Max); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) void ( STDMETHODCALLTYPE *SetSamplePositions )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT NumSamplesPerPixel, _In_ UINT NumPixels, _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ UINT DstX, @@ -27415,24 +32524,24 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) void ( STDMETHODCALLTYPE *SetViewInstanceMask )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT Mask); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) void ( STDMETHODCALLTYPE *WriteBufferImmediate )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, UINT Count, _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) void ( STDMETHODCALLTYPE *BeginRenderPass )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT NumRenderTargets, _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, @@ -27440,83 +32549,89 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) void ( STDMETHODCALLTYPE *EndRenderPass )( - ID3D12GraphicsCommandList7 * This); + ID3D12GraphicsCommandList8 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) void ( STDMETHODCALLTYPE *InitializeMetaCommand )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, _In_ SIZE_T InitializationParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, _In_ SIZE_T ExecutionParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, _In_ UINT NumPostbuildInfoDescs, _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, _In_ UINT NumSourceAccelerationStructures, _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) void ( STDMETHODCALLTYPE *SetPipelineState1 )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ ID3D12StateObject *pStateObject); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) void ( STDMETHODCALLTYPE *DispatchRays )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) void ( STDMETHODCALLTYPE *RSSetShadingRate )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ D3D12_SHADING_RATE baseShadingRate, _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_opt_ ID3D12Resource *shadingRateImage); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) void ( STDMETHODCALLTYPE *DispatchMesh )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, _In_ UINT ThreadGroupCountX, _In_ UINT ThreadGroupCountY, _In_ UINT ThreadGroupCountZ); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier) void ( STDMETHODCALLTYPE *Barrier )( - ID3D12GraphicsCommandList7 * This, + ID3D12GraphicsCommandList8 * This, UINT32 NumBarrierGroups, _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList8, OMSetFrontAndBackStencilRef) + void ( STDMETHODCALLTYPE *OMSetFrontAndBackStencilRef )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT FrontStencilRef, + _In_ UINT BackStencilRef); + END_INTERFACE - } ID3D12GraphicsCommandList7Vtbl; + } ID3D12GraphicsCommandList8Vtbl; - interface ID3D12GraphicsCommandList7 + interface ID3D12GraphicsCommandList8 { - CONST_VTBL struct ID3D12GraphicsCommandList7Vtbl *lpVtbl; + CONST_VTBL struct ID3D12GraphicsCommandList8Vtbl *lpVtbl; }; @@ -27524,260 +32639,264 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; #ifdef COBJMACROS -#define ID3D12GraphicsCommandList7_QueryInterface(This,riid,ppvObject) \ +#define ID3D12GraphicsCommandList8_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12GraphicsCommandList7_AddRef(This) \ +#define ID3D12GraphicsCommandList8_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12GraphicsCommandList7_Release(This) \ +#define ID3D12GraphicsCommandList8_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12GraphicsCommandList7_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12GraphicsCommandList8_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12GraphicsCommandList7_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12GraphicsCommandList8_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12GraphicsCommandList7_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12GraphicsCommandList8_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12GraphicsCommandList7_SetName(This,Name) \ +#define ID3D12GraphicsCommandList8_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12GraphicsCommandList7_GetDevice(This,riid,ppvDevice) \ +#define ID3D12GraphicsCommandList8_GetDevice(This,riid,ppvDevice) \ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12GraphicsCommandList7_GetType(This) \ +#define ID3D12GraphicsCommandList8_GetType(This) \ ( (This)->lpVtbl -> GetType(This) ) -#define ID3D12GraphicsCommandList7_Close(This) \ +#define ID3D12GraphicsCommandList8_Close(This) \ ( (This)->lpVtbl -> Close(This) ) -#define ID3D12GraphicsCommandList7_Reset(This,pAllocator,pInitialState) \ +#define ID3D12GraphicsCommandList8_Reset(This,pAllocator,pInitialState) \ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) -#define ID3D12GraphicsCommandList7_ClearState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList8_ClearState(This,pPipelineState) \ ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList7_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList8_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList7_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList8_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList7_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ +#define ID3D12GraphicsCommandList8_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) -#define ID3D12GraphicsCommandList7_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ +#define ID3D12GraphicsCommandList8_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) -#define ID3D12GraphicsCommandList7_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ +#define ID3D12GraphicsCommandList8_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) -#define ID3D12GraphicsCommandList7_CopyResource(This,pDstResource,pSrcResource) \ +#define ID3D12GraphicsCommandList8_CopyResource(This,pDstResource,pSrcResource) \ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) -#define ID3D12GraphicsCommandList7_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ +#define ID3D12GraphicsCommandList8_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) -#define ID3D12GraphicsCommandList7_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ +#define ID3D12GraphicsCommandList8_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) -#define ID3D12GraphicsCommandList7_IASetPrimitiveTopology(This,PrimitiveTopology) \ +#define ID3D12GraphicsCommandList8_IASetPrimitiveTopology(This,PrimitiveTopology) \ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) -#define ID3D12GraphicsCommandList7_RSSetViewports(This,NumViewports,pViewports) \ +#define ID3D12GraphicsCommandList8_RSSetViewports(This,NumViewports,pViewports) \ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) -#define ID3D12GraphicsCommandList7_RSSetScissorRects(This,NumRects,pRects) \ +#define ID3D12GraphicsCommandList8_RSSetScissorRects(This,NumRects,pRects) \ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) -#define ID3D12GraphicsCommandList7_OMSetBlendFactor(This,BlendFactor) \ +#define ID3D12GraphicsCommandList8_OMSetBlendFactor(This,BlendFactor) \ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) -#define ID3D12GraphicsCommandList7_OMSetStencilRef(This,StencilRef) \ +#define ID3D12GraphicsCommandList8_OMSetStencilRef(This,StencilRef) \ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) -#define ID3D12GraphicsCommandList7_SetPipelineState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList8_SetPipelineState(This,pPipelineState) \ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList7_ResourceBarrier(This,NumBarriers,pBarriers) \ +#define ID3D12GraphicsCommandList8_ResourceBarrier(This,NumBarriers,pBarriers) \ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) -#define ID3D12GraphicsCommandList7_ExecuteBundle(This,pCommandList) \ +#define ID3D12GraphicsCommandList8_ExecuteBundle(This,pCommandList) \ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) -#define ID3D12GraphicsCommandList7_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ +#define ID3D12GraphicsCommandList8_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) -#define ID3D12GraphicsCommandList7_SetComputeRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList8_SetComputeRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList7_SetGraphicsRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList8_SetGraphicsRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList7_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList8_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList7_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList8_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList7_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList8_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList7_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList8_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList7_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList8_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList7_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList8_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList7_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList8_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList7_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList8_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList7_IASetIndexBuffer(This,pView) \ +#define ID3D12GraphicsCommandList8_IASetIndexBuffer(This,pView) \ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) -#define ID3D12GraphicsCommandList7_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList8_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList7_SOSetTargets(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList8_SOSetTargets(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList7_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ +#define ID3D12GraphicsCommandList8_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) -#define ID3D12GraphicsCommandList7_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ +#define ID3D12GraphicsCommandList8_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) -#define ID3D12GraphicsCommandList7_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ +#define ID3D12GraphicsCommandList8_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) -#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList7_DiscardResource(This,pResource,pRegion) \ +#define ID3D12GraphicsCommandList8_DiscardResource(This,pResource,pRegion) \ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) -#define ID3D12GraphicsCommandList7_BeginQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList8_BeginQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList7_EndQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList8_EndQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList7_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ +#define ID3D12GraphicsCommandList8_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) -#define ID3D12GraphicsCommandList7_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ +#define ID3D12GraphicsCommandList8_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) -#define ID3D12GraphicsCommandList7_SetMarker(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList8_SetMarker(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList7_BeginEvent(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList8_BeginEvent(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList7_EndEvent(This) \ +#define ID3D12GraphicsCommandList8_EndEvent(This) \ ( (This)->lpVtbl -> EndEvent(This) ) -#define ID3D12GraphicsCommandList7_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ +#define ID3D12GraphicsCommandList8_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) -#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList7_OMSetDepthBounds(This,Min,Max) \ +#define ID3D12GraphicsCommandList8_OMSetDepthBounds(This,Min,Max) \ ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) -#define ID3D12GraphicsCommandList7_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ +#define ID3D12GraphicsCommandList8_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) -#define ID3D12GraphicsCommandList7_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ +#define ID3D12GraphicsCommandList8_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) -#define ID3D12GraphicsCommandList7_SetViewInstanceMask(This,Mask) \ +#define ID3D12GraphicsCommandList8_SetViewInstanceMask(This,Mask) \ ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) -#define ID3D12GraphicsCommandList7_WriteBufferImmediate(This,Count,pParams,pModes) \ +#define ID3D12GraphicsCommandList8_WriteBufferImmediate(This,Count,pParams,pModes) \ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) -#define ID3D12GraphicsCommandList7_SetProtectedResourceSession(This,pProtectedResourceSession) \ +#define ID3D12GraphicsCommandList8_SetProtectedResourceSession(This,pProtectedResourceSession) \ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) -#define ID3D12GraphicsCommandList7_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ +#define ID3D12GraphicsCommandList8_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) -#define ID3D12GraphicsCommandList7_EndRenderPass(This) \ +#define ID3D12GraphicsCommandList8_EndRenderPass(This) \ ( (This)->lpVtbl -> EndRenderPass(This) ) -#define ID3D12GraphicsCommandList7_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList8_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList7_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList8_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList7_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ +#define ID3D12GraphicsCommandList8_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) -#define ID3D12GraphicsCommandList7_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ +#define ID3D12GraphicsCommandList8_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) -#define ID3D12GraphicsCommandList7_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ +#define ID3D12GraphicsCommandList8_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) -#define ID3D12GraphicsCommandList7_SetPipelineState1(This,pStateObject) \ +#define ID3D12GraphicsCommandList8_SetPipelineState1(This,pStateObject) \ ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) -#define ID3D12GraphicsCommandList7_DispatchRays(This,pDesc) \ +#define ID3D12GraphicsCommandList8_DispatchRays(This,pDesc) \ ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) -#define ID3D12GraphicsCommandList7_RSSetShadingRate(This,baseShadingRate,combiners) \ +#define ID3D12GraphicsCommandList8_RSSetShadingRate(This,baseShadingRate,combiners) \ ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) -#define ID3D12GraphicsCommandList7_RSSetShadingRateImage(This,shadingRateImage) \ +#define ID3D12GraphicsCommandList8_RSSetShadingRateImage(This,shadingRateImage) \ ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) -#define ID3D12GraphicsCommandList7_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ +#define ID3D12GraphicsCommandList8_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) -#define ID3D12GraphicsCommandList7_Barrier(This,NumBarrierGroups,pBarrierGroups) \ +#define ID3D12GraphicsCommandList8_Barrier(This,NumBarrierGroups,pBarrierGroups) \ ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + +#define ID3D12GraphicsCommandList8_OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) \ + ( (This)->lpVtbl -> OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) ) + #endif /* COBJMACROS */ @@ -27786,104 +32905,108 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList7; -#endif /* __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ */ +#endif /* __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ */ -#ifndef __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ -#define __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ +#ifndef __ID3D12GraphicsCommandList9_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList9_INTERFACE_DEFINED__ -/* interface ID3D12GraphicsCommandList8 */ +/* interface ID3D12GraphicsCommandList9 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12GraphicsCommandList8; +EXTERN_C const IID IID_ID3D12GraphicsCommandList9; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("ee936ef9-599d-4d28-938e-23c4ad05ce51") - ID3D12GraphicsCommandList8 : public ID3D12GraphicsCommandList7 + MIDL_INTERFACE("34ed2808-ffe6-4c2b-b11a-cabd2b0c59e1") + ID3D12GraphicsCommandList9 : public ID3D12GraphicsCommandList8 { public: - virtual void STDMETHODCALLTYPE OMSetFrontAndBackStencilRef( - _In_ UINT FrontStencilRef, - _In_ UINT BackStencilRef) = 0; + virtual void STDMETHODCALLTYPE RSSetDepthBias( + _In_ FLOAT DepthBias, + _In_ FLOAT DepthBiasClamp, + _In_ FLOAT SlopeScaledDepthBias) = 0; + + virtual void STDMETHODCALLTYPE IASetIndexBufferStripCutValue( + _In_ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) = 0; }; #else /* C style interface */ - typedef struct ID3D12GraphicsCommandList8Vtbl + typedef struct ID3D12GraphicsCommandList9Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12GraphicsCommandList8 * This); + ID3D12GraphicsCommandList9 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12GraphicsCommandList8 * This); + ID3D12GraphicsCommandList9 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_z_ LPCWSTR Name); DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, REFIID riid, _COM_Outptr_opt_ void **ppvDevice); DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( - ID3D12GraphicsCommandList8 * This); + ID3D12GraphicsCommandList9 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) HRESULT ( STDMETHODCALLTYPE *Close )( - ID3D12GraphicsCommandList8 * This); + ID3D12GraphicsCommandList9 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12CommandAllocator *pAllocator, _In_opt_ ID3D12PipelineState *pInitialState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) void ( STDMETHODCALLTYPE *ClearState )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_opt_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) void ( STDMETHODCALLTYPE *DrawInstanced )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT VertexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartVertexLocation, @@ -27891,7 +33014,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT IndexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartIndexLocation, @@ -27900,14 +33023,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) void ( STDMETHODCALLTYPE *Dispatch )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT ThreadGroupCountX, _In_ UINT ThreadGroupCountY, _In_ UINT ThreadGroupCountZ); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) void ( STDMETHODCALLTYPE *CopyBufferRegion )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -27916,7 +33039,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) void ( STDMETHODCALLTYPE *CopyTextureRegion )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, UINT DstX, UINT DstY, @@ -27926,13 +33049,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) void ( STDMETHODCALLTYPE *CopyResource )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12Resource *pDstResource, _In_ ID3D12Resource *pSrcResource); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) void ( STDMETHODCALLTYPE *CopyTiles )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12Resource *pTiledResource, _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, @@ -27942,7 +33065,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) void ( STDMETHODCALLTYPE *ResolveSubresource )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ ID3D12Resource *pSrcResource, @@ -27951,92 +33074,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) void ( STDMETHODCALLTYPE *RSSetViewports )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) void ( STDMETHODCALLTYPE *RSSetScissorRects )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, _In_reads_( NumRects) const D3D12_RECT *pRects); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) void ( STDMETHODCALLTYPE *OMSetBlendFactor )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) void ( STDMETHODCALLTYPE *OMSetStencilRef )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT StencilRef); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) void ( STDMETHODCALLTYPE *SetPipelineState )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) void ( STDMETHODCALLTYPE *ResourceBarrier )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT NumBarriers, _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) void ( STDMETHODCALLTYPE *ExecuteBundle )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12GraphicsCommandList *pCommandList); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT NumDescriptorHeaps, _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) void ( STDMETHODCALLTYPE *SetComputeRootSignature )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -28044,7 +33167,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -28052,62 +33175,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) void ( STDMETHODCALLTYPE *IASetIndexBuffer )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) void ( STDMETHODCALLTYPE *IASetVertexBuffers )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) void ( STDMETHODCALLTYPE *SOSetTargets )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) void ( STDMETHODCALLTYPE *OMSetRenderTargets )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT NumRenderTargetDescriptors, _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, _In_ BOOL RTsSingleHandleToDescriptorRange, @@ -28115,7 +33238,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) void ( STDMETHODCALLTYPE *ClearDepthStencilView )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, _In_ D3D12_CLEAR_FLAGS ClearFlags, _In_ FLOAT Depth, @@ -28125,7 +33248,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) void ( STDMETHODCALLTYPE *ClearRenderTargetView )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, _In_ const FLOAT ColorRGBA[ 4 ], _In_ UINT NumRects, @@ -28133,7 +33256,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -28143,7 +33266,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -28153,27 +33276,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) void ( STDMETHODCALLTYPE *DiscardResource )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12Resource *pResource, _In_opt_ const D3D12_DISCARD_REGION *pRegion); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) void ( STDMETHODCALLTYPE *BeginQuery )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) void ( STDMETHODCALLTYPE *EndQuery )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) void ( STDMETHODCALLTYPE *ResolveQueryData )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT StartIndex, @@ -28183,32 +33306,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) void ( STDMETHODCALLTYPE *SetPredication )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_opt_ ID3D12Resource *pBuffer, _In_ UINT64 AlignedBufferOffset, _In_ D3D12_PREDICATION_OP Operation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) void ( STDMETHODCALLTYPE *SetMarker )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) void ( STDMETHODCALLTYPE *BeginEvent )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) void ( STDMETHODCALLTYPE *EndEvent )( - ID3D12GraphicsCommandList8 * This); + ID3D12GraphicsCommandList9 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) void ( STDMETHODCALLTYPE *ExecuteIndirect )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12CommandSignature *pCommandSignature, _In_ UINT MaxCommandCount, _In_ ID3D12Resource *pArgumentBuffer, @@ -28218,7 +33341,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -28229,7 +33352,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -28240,20 +33363,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) void ( STDMETHODCALLTYPE *OMSetDepthBounds )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ FLOAT Min, _In_ FLOAT Max); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) void ( STDMETHODCALLTYPE *SetSamplePositions )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT NumSamplesPerPixel, _In_ UINT NumPixels, _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ UINT DstX, @@ -28266,24 +33389,24 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) void ( STDMETHODCALLTYPE *SetViewInstanceMask )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT Mask); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) void ( STDMETHODCALLTYPE *WriteBufferImmediate )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, UINT Count, _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) void ( STDMETHODCALLTYPE *BeginRenderPass )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT NumRenderTargets, _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, @@ -28291,89 +33414,101 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) void ( STDMETHODCALLTYPE *EndRenderPass )( - ID3D12GraphicsCommandList8 * This); + ID3D12GraphicsCommandList9 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) void ( STDMETHODCALLTYPE *InitializeMetaCommand )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, _In_ SIZE_T InitializationParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, _In_ SIZE_T ExecutionParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, _In_ UINT NumPostbuildInfoDescs, _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, _In_ UINT NumSourceAccelerationStructures, _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) void ( STDMETHODCALLTYPE *SetPipelineState1 )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ ID3D12StateObject *pStateObject); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) void ( STDMETHODCALLTYPE *DispatchRays )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) void ( STDMETHODCALLTYPE *RSSetShadingRate )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ D3D12_SHADING_RATE baseShadingRate, _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_opt_ ID3D12Resource *shadingRateImage); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) void ( STDMETHODCALLTYPE *DispatchMesh )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT ThreadGroupCountX, _In_ UINT ThreadGroupCountY, _In_ UINT ThreadGroupCountZ); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier) void ( STDMETHODCALLTYPE *Barrier )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, UINT32 NumBarrierGroups, _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList8, OMSetFrontAndBackStencilRef) void ( STDMETHODCALLTYPE *OMSetFrontAndBackStencilRef )( - ID3D12GraphicsCommandList8 * This, + ID3D12GraphicsCommandList9 * This, _In_ UINT FrontStencilRef, _In_ UINT BackStencilRef); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList9, RSSetDepthBias) + void ( STDMETHODCALLTYPE *RSSetDepthBias )( + ID3D12GraphicsCommandList9 * This, + _In_ FLOAT DepthBias, + _In_ FLOAT DepthBiasClamp, + _In_ FLOAT SlopeScaledDepthBias); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList9, IASetIndexBufferStripCutValue) + void ( STDMETHODCALLTYPE *IASetIndexBufferStripCutValue )( + ID3D12GraphicsCommandList9 * This, + _In_ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue); + END_INTERFACE - } ID3D12GraphicsCommandList8Vtbl; + } ID3D12GraphicsCommandList9Vtbl; - interface ID3D12GraphicsCommandList8 + interface ID3D12GraphicsCommandList9 { - CONST_VTBL struct ID3D12GraphicsCommandList8Vtbl *lpVtbl; + CONST_VTBL struct ID3D12GraphicsCommandList9Vtbl *lpVtbl; }; @@ -28381,264 +33516,271 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; #ifdef COBJMACROS -#define ID3D12GraphicsCommandList8_QueryInterface(This,riid,ppvObject) \ +#define ID3D12GraphicsCommandList9_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12GraphicsCommandList8_AddRef(This) \ +#define ID3D12GraphicsCommandList9_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12GraphicsCommandList8_Release(This) \ +#define ID3D12GraphicsCommandList9_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12GraphicsCommandList8_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12GraphicsCommandList9_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12GraphicsCommandList8_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12GraphicsCommandList9_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12GraphicsCommandList8_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12GraphicsCommandList9_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12GraphicsCommandList8_SetName(This,Name) \ +#define ID3D12GraphicsCommandList9_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12GraphicsCommandList8_GetDevice(This,riid,ppvDevice) \ +#define ID3D12GraphicsCommandList9_GetDevice(This,riid,ppvDevice) \ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12GraphicsCommandList8_GetType(This) \ +#define ID3D12GraphicsCommandList9_GetType(This) \ ( (This)->lpVtbl -> GetType(This) ) -#define ID3D12GraphicsCommandList8_Close(This) \ +#define ID3D12GraphicsCommandList9_Close(This) \ ( (This)->lpVtbl -> Close(This) ) -#define ID3D12GraphicsCommandList8_Reset(This,pAllocator,pInitialState) \ +#define ID3D12GraphicsCommandList9_Reset(This,pAllocator,pInitialState) \ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) -#define ID3D12GraphicsCommandList8_ClearState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList9_ClearState(This,pPipelineState) \ ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList8_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList9_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList8_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList9_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList8_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ +#define ID3D12GraphicsCommandList9_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) -#define ID3D12GraphicsCommandList8_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ +#define ID3D12GraphicsCommandList9_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) -#define ID3D12GraphicsCommandList8_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ +#define ID3D12GraphicsCommandList9_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) -#define ID3D12GraphicsCommandList8_CopyResource(This,pDstResource,pSrcResource) \ +#define ID3D12GraphicsCommandList9_CopyResource(This,pDstResource,pSrcResource) \ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) -#define ID3D12GraphicsCommandList8_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ +#define ID3D12GraphicsCommandList9_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) -#define ID3D12GraphicsCommandList8_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ +#define ID3D12GraphicsCommandList9_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) -#define ID3D12GraphicsCommandList8_IASetPrimitiveTopology(This,PrimitiveTopology) \ +#define ID3D12GraphicsCommandList9_IASetPrimitiveTopology(This,PrimitiveTopology) \ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) -#define ID3D12GraphicsCommandList8_RSSetViewports(This,NumViewports,pViewports) \ +#define ID3D12GraphicsCommandList9_RSSetViewports(This,NumViewports,pViewports) \ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) -#define ID3D12GraphicsCommandList8_RSSetScissorRects(This,NumRects,pRects) \ +#define ID3D12GraphicsCommandList9_RSSetScissorRects(This,NumRects,pRects) \ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) -#define ID3D12GraphicsCommandList8_OMSetBlendFactor(This,BlendFactor) \ +#define ID3D12GraphicsCommandList9_OMSetBlendFactor(This,BlendFactor) \ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) -#define ID3D12GraphicsCommandList8_OMSetStencilRef(This,StencilRef) \ +#define ID3D12GraphicsCommandList9_OMSetStencilRef(This,StencilRef) \ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) -#define ID3D12GraphicsCommandList8_SetPipelineState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList9_SetPipelineState(This,pPipelineState) \ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList8_ResourceBarrier(This,NumBarriers,pBarriers) \ +#define ID3D12GraphicsCommandList9_ResourceBarrier(This,NumBarriers,pBarriers) \ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) -#define ID3D12GraphicsCommandList8_ExecuteBundle(This,pCommandList) \ +#define ID3D12GraphicsCommandList9_ExecuteBundle(This,pCommandList) \ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) -#define ID3D12GraphicsCommandList8_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ +#define ID3D12GraphicsCommandList9_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) -#define ID3D12GraphicsCommandList8_SetComputeRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList9_SetComputeRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList8_SetGraphicsRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList9_SetGraphicsRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList8_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList9_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList8_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList9_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList9_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList9_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList9_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList9_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList8_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList9_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList8_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList9_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList8_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList9_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList8_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList9_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList8_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList9_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList8_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList9_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList8_IASetIndexBuffer(This,pView) \ +#define ID3D12GraphicsCommandList9_IASetIndexBuffer(This,pView) \ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) -#define ID3D12GraphicsCommandList8_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList9_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList8_SOSetTargets(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList9_SOSetTargets(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList8_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ +#define ID3D12GraphicsCommandList9_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) -#define ID3D12GraphicsCommandList8_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ +#define ID3D12GraphicsCommandList9_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) -#define ID3D12GraphicsCommandList8_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ +#define ID3D12GraphicsCommandList9_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) -#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList9_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList9_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList8_DiscardResource(This,pResource,pRegion) \ +#define ID3D12GraphicsCommandList9_DiscardResource(This,pResource,pRegion) \ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) -#define ID3D12GraphicsCommandList8_BeginQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList9_BeginQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList8_EndQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList9_EndQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList8_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ +#define ID3D12GraphicsCommandList9_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) -#define ID3D12GraphicsCommandList8_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ +#define ID3D12GraphicsCommandList9_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) -#define ID3D12GraphicsCommandList8_SetMarker(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList9_SetMarker(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList8_BeginEvent(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList9_BeginEvent(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList8_EndEvent(This) \ +#define ID3D12GraphicsCommandList9_EndEvent(This) \ ( (This)->lpVtbl -> EndEvent(This) ) -#define ID3D12GraphicsCommandList8_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ +#define ID3D12GraphicsCommandList9_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) -#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList9_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList9_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList8_OMSetDepthBounds(This,Min,Max) \ +#define ID3D12GraphicsCommandList9_OMSetDepthBounds(This,Min,Max) \ ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) -#define ID3D12GraphicsCommandList8_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ +#define ID3D12GraphicsCommandList9_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) -#define ID3D12GraphicsCommandList8_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ +#define ID3D12GraphicsCommandList9_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) -#define ID3D12GraphicsCommandList8_SetViewInstanceMask(This,Mask) \ +#define ID3D12GraphicsCommandList9_SetViewInstanceMask(This,Mask) \ ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) -#define ID3D12GraphicsCommandList8_WriteBufferImmediate(This,Count,pParams,pModes) \ +#define ID3D12GraphicsCommandList9_WriteBufferImmediate(This,Count,pParams,pModes) \ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) -#define ID3D12GraphicsCommandList8_SetProtectedResourceSession(This,pProtectedResourceSession) \ +#define ID3D12GraphicsCommandList9_SetProtectedResourceSession(This,pProtectedResourceSession) \ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) -#define ID3D12GraphicsCommandList8_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ +#define ID3D12GraphicsCommandList9_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) -#define ID3D12GraphicsCommandList8_EndRenderPass(This) \ +#define ID3D12GraphicsCommandList9_EndRenderPass(This) \ ( (This)->lpVtbl -> EndRenderPass(This) ) -#define ID3D12GraphicsCommandList8_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList9_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList8_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList9_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList8_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ +#define ID3D12GraphicsCommandList9_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) -#define ID3D12GraphicsCommandList8_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ +#define ID3D12GraphicsCommandList9_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) -#define ID3D12GraphicsCommandList8_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ +#define ID3D12GraphicsCommandList9_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) -#define ID3D12GraphicsCommandList8_SetPipelineState1(This,pStateObject) \ +#define ID3D12GraphicsCommandList9_SetPipelineState1(This,pStateObject) \ ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) -#define ID3D12GraphicsCommandList8_DispatchRays(This,pDesc) \ +#define ID3D12GraphicsCommandList9_DispatchRays(This,pDesc) \ ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) -#define ID3D12GraphicsCommandList8_RSSetShadingRate(This,baseShadingRate,combiners) \ +#define ID3D12GraphicsCommandList9_RSSetShadingRate(This,baseShadingRate,combiners) \ ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) -#define ID3D12GraphicsCommandList8_RSSetShadingRateImage(This,shadingRateImage) \ +#define ID3D12GraphicsCommandList9_RSSetShadingRateImage(This,shadingRateImage) \ ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) -#define ID3D12GraphicsCommandList8_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ +#define ID3D12GraphicsCommandList9_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) -#define ID3D12GraphicsCommandList8_Barrier(This,NumBarrierGroups,pBarrierGroups) \ +#define ID3D12GraphicsCommandList9_Barrier(This,NumBarrierGroups,pBarrierGroups) \ ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) -#define ID3D12GraphicsCommandList8_OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) \ +#define ID3D12GraphicsCommandList9_OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) \ ( (This)->lpVtbl -> OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) ) + +#define ID3D12GraphicsCommandList9_RSSetDepthBias(This,DepthBias,DepthBiasClamp,SlopeScaledDepthBias) \ + ( (This)->lpVtbl -> RSSetDepthBias(This,DepthBias,DepthBiasClamp,SlopeScaledDepthBias) ) + +#define ID3D12GraphicsCommandList9_IASetIndexBufferStripCutValue(This,IBStripCutValue) \ + ( (This)->lpVtbl -> IASetIndexBufferStripCutValue(This,IBStripCutValue) ) + #endif /* COBJMACROS */ @@ -28647,108 +33789,106 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList8; -#endif /* __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ */ +#endif /* __ID3D12GraphicsCommandList9_INTERFACE_DEFINED__ */ -#ifndef __ID3D12GraphicsCommandList9_INTERFACE_DEFINED__ -#define __ID3D12GraphicsCommandList9_INTERFACE_DEFINED__ +#ifndef __ID3D12GraphicsCommandList10_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList10_INTERFACE_DEFINED__ -/* interface ID3D12GraphicsCommandList9 */ +/* interface ID3D12GraphicsCommandList10 */ /* [unique][local][object][uuid] */ -EXTERN_C const IID IID_ID3D12GraphicsCommandList9; +EXTERN_C const IID IID_ID3D12GraphicsCommandList10; #if defined(__cplusplus) && !defined(CINTERFACE) - MIDL_INTERFACE("34ed2808-ffe6-4c2b-b11a-cabd2b0c59e1") - ID3D12GraphicsCommandList9 : public ID3D12GraphicsCommandList8 + MIDL_INTERFACE("7013c015-d161-4b63-a08c-238552dd8acc") + ID3D12GraphicsCommandList10 : public ID3D12GraphicsCommandList9 { public: - virtual void STDMETHODCALLTYPE RSSetDepthBias( - _In_ FLOAT DepthBias, - _In_ FLOAT DepthBiasClamp, - _In_ FLOAT SlopeScaledDepthBias) = 0; + virtual void STDMETHODCALLTYPE SetProgram( + _In_ const D3D12_SET_PROGRAM_DESC *pDesc) = 0; - virtual void STDMETHODCALLTYPE IASetIndexBufferStripCutValue( - _In_ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) = 0; + virtual void STDMETHODCALLTYPE DispatchGraph( + _In_ const D3D12_DISPATCH_GRAPH_DESC *pDesc) = 0; }; #else /* C style interface */ - typedef struct ID3D12GraphicsCommandList9Vtbl + typedef struct ID3D12GraphicsCommandList10Vtbl { BEGIN_INTERFACE DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, REFIID riid, _COM_Outptr_ void **ppvObject); DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( - ID3D12GraphicsCommandList9 * This); + ID3D12GraphicsCommandList10 * This); DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( - ID3D12GraphicsCommandList9 * This); + ID3D12GraphicsCommandList10 * This); DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ REFGUID guid, _Inout_ UINT *pDataSize, _Out_writes_bytes_opt_( *pDataSize ) void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ REFGUID guid, _In_ UINT DataSize, _In_reads_bytes_opt_( DataSize ) const void *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ REFGUID guid, _In_opt_ const IUnknown *pData); DECLSPEC_XFGVIRT(ID3D12Object, SetName) HRESULT ( STDMETHODCALLTYPE *SetName )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_z_ LPCWSTR Name); DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) HRESULT ( STDMETHODCALLTYPE *GetDevice )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, REFIID riid, _COM_Outptr_opt_ void **ppvDevice); DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( - ID3D12GraphicsCommandList9 * This); + ID3D12GraphicsCommandList10 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) HRESULT ( STDMETHODCALLTYPE *Close )( - ID3D12GraphicsCommandList9 * This); + ID3D12GraphicsCommandList10 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12CommandAllocator *pAllocator, _In_opt_ ID3D12PipelineState *pInitialState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) void ( STDMETHODCALLTYPE *ClearState )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_opt_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) void ( STDMETHODCALLTYPE *DrawInstanced )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT VertexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartVertexLocation, @@ -28756,7 +33896,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT IndexCountPerInstance, _In_ UINT InstanceCount, _In_ UINT StartIndexLocation, @@ -28765,14 +33905,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) void ( STDMETHODCALLTYPE *Dispatch )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT ThreadGroupCountX, _In_ UINT ThreadGroupCountY, _In_ UINT ThreadGroupCountZ); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) void ( STDMETHODCALLTYPE *CopyBufferRegion )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -28781,7 +33921,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) void ( STDMETHODCALLTYPE *CopyTextureRegion )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, UINT DstX, UINT DstY, @@ -28791,13 +33931,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) void ( STDMETHODCALLTYPE *CopyResource )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12Resource *pDstResource, _In_ ID3D12Resource *pSrcResource); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) void ( STDMETHODCALLTYPE *CopyTiles )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12Resource *pTiledResource, _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, @@ -28807,7 +33947,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) void ( STDMETHODCALLTYPE *ResolveSubresource )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ ID3D12Resource *pSrcResource, @@ -28816,92 +33956,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) void ( STDMETHODCALLTYPE *RSSetViewports )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) void ( STDMETHODCALLTYPE *RSSetScissorRects )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, _In_reads_( NumRects) const D3D12_RECT *pRects); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) void ( STDMETHODCALLTYPE *OMSetBlendFactor )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) void ( STDMETHODCALLTYPE *OMSetStencilRef )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT StencilRef); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) void ( STDMETHODCALLTYPE *SetPipelineState )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12PipelineState *pPipelineState); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) void ( STDMETHODCALLTYPE *ResourceBarrier )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT NumBarriers, _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) void ( STDMETHODCALLTYPE *ExecuteBundle )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12GraphicsCommandList *pCommandList); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT NumDescriptorHeaps, _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) void ( STDMETHODCALLTYPE *SetComputeRootSignature )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_opt_ ID3D12RootSignature *pRootSignature); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ UINT SrcData, _In_ UINT DestOffsetIn32BitValues); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -28909,7 +34049,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ UINT Num32BitValuesToSet, _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, @@ -28917,62 +34057,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT RootParameterIndex, _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) void ( STDMETHODCALLTYPE *IASetIndexBuffer )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) void ( STDMETHODCALLTYPE *IASetVertexBuffers )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) void ( STDMETHODCALLTYPE *SOSetTargets )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT StartSlot, _In_ UINT NumViews, _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) void ( STDMETHODCALLTYPE *OMSetRenderTargets )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT NumRenderTargetDescriptors, _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, _In_ BOOL RTsSingleHandleToDescriptorRange, @@ -28980,7 +34120,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) void ( STDMETHODCALLTYPE *ClearDepthStencilView )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, _In_ D3D12_CLEAR_FLAGS ClearFlags, _In_ FLOAT Depth, @@ -28990,7 +34130,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) void ( STDMETHODCALLTYPE *ClearRenderTargetView )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, _In_ const FLOAT ColorRGBA[ 4 ], _In_ UINT NumRects, @@ -28998,7 +34138,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -29008,7 +34148,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, _In_ ID3D12Resource *pResource, @@ -29018,27 +34158,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) void ( STDMETHODCALLTYPE *DiscardResource )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12Resource *pResource, _In_opt_ const D3D12_DISCARD_REGION *pRegion); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) void ( STDMETHODCALLTYPE *BeginQuery )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) void ( STDMETHODCALLTYPE *EndQuery )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT Index); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) void ( STDMETHODCALLTYPE *ResolveQueryData )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12QueryHeap *pQueryHeap, _In_ D3D12_QUERY_TYPE Type, _In_ UINT StartIndex, @@ -29048,32 +34188,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) void ( STDMETHODCALLTYPE *SetPredication )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_opt_ ID3D12Resource *pBuffer, _In_ UINT64 AlignedBufferOffset, _In_ D3D12_PREDICATION_OP Operation); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) void ( STDMETHODCALLTYPE *SetMarker )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) void ( STDMETHODCALLTYPE *BeginEvent )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, UINT Metadata, _In_reads_bytes_opt_(Size) const void *pData, UINT Size); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) void ( STDMETHODCALLTYPE *EndEvent )( - ID3D12GraphicsCommandList9 * This); + ID3D12GraphicsCommandList10 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) void ( STDMETHODCALLTYPE *ExecuteIndirect )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12CommandSignature *pCommandSignature, _In_ UINT MaxCommandCount, _In_ ID3D12Resource *pArgumentBuffer, @@ -29083,7 +34223,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -29094,7 +34234,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12Resource *pDstBuffer, UINT64 DstOffset, _In_ ID3D12Resource *pSrcBuffer, @@ -29105,20 +34245,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) void ( STDMETHODCALLTYPE *OMSetDepthBounds )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ FLOAT Min, _In_ FLOAT Max); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) void ( STDMETHODCALLTYPE *SetSamplePositions )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT NumSamplesPerPixel, _In_ UINT NumPixels, _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12Resource *pDstResource, _In_ UINT DstSubresource, _In_ UINT DstX, @@ -29131,24 +34271,24 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) void ( STDMETHODCALLTYPE *SetViewInstanceMask )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT Mask); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) void ( STDMETHODCALLTYPE *WriteBufferImmediate )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, UINT Count, _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) void ( STDMETHODCALLTYPE *BeginRenderPass )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT NumRenderTargets, _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, @@ -29156,101 +34296,111 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) void ( STDMETHODCALLTYPE *EndRenderPass )( - ID3D12GraphicsCommandList9 * This); + ID3D12GraphicsCommandList10 * This); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) void ( STDMETHODCALLTYPE *InitializeMetaCommand )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, _In_ SIZE_T InitializationParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12MetaCommand *pMetaCommand, _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, _In_ SIZE_T ExecutionParametersDataSizeInBytes); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, _In_ UINT NumPostbuildInfoDescs, _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, _In_ UINT NumSourceAccelerationStructures, _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) void ( STDMETHODCALLTYPE *SetPipelineState1 )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ ID3D12StateObject *pStateObject); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) void ( STDMETHODCALLTYPE *DispatchRays )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) void ( STDMETHODCALLTYPE *RSSetShadingRate )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ D3D12_SHADING_RATE baseShadingRate, _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_opt_ ID3D12Resource *shadingRateImage); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) void ( STDMETHODCALLTYPE *DispatchMesh )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT ThreadGroupCountX, _In_ UINT ThreadGroupCountY, _In_ UINT ThreadGroupCountZ); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier) void ( STDMETHODCALLTYPE *Barrier )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, UINT32 NumBarrierGroups, _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList8, OMSetFrontAndBackStencilRef) void ( STDMETHODCALLTYPE *OMSetFrontAndBackStencilRef )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ UINT FrontStencilRef, _In_ UINT BackStencilRef); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList9, RSSetDepthBias) void ( STDMETHODCALLTYPE *RSSetDepthBias )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ FLOAT DepthBias, _In_ FLOAT DepthBiasClamp, _In_ FLOAT SlopeScaledDepthBias); DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList9, IASetIndexBufferStripCutValue) void ( STDMETHODCALLTYPE *IASetIndexBufferStripCutValue )( - ID3D12GraphicsCommandList9 * This, + ID3D12GraphicsCommandList10 * This, _In_ D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue); + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList10, SetProgram) + void ( STDMETHODCALLTYPE *SetProgram )( + ID3D12GraphicsCommandList10 * This, + _In_ const D3D12_SET_PROGRAM_DESC *pDesc); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList10, DispatchGraph) + void ( STDMETHODCALLTYPE *DispatchGraph )( + ID3D12GraphicsCommandList10 * This, + _In_ const D3D12_DISPATCH_GRAPH_DESC *pDesc); + END_INTERFACE - } ID3D12GraphicsCommandList9Vtbl; + } ID3D12GraphicsCommandList10Vtbl; - interface ID3D12GraphicsCommandList9 + interface ID3D12GraphicsCommandList10 { - CONST_VTBL struct ID3D12GraphicsCommandList9Vtbl *lpVtbl; + CONST_VTBL struct ID3D12GraphicsCommandList10Vtbl *lpVtbl; }; @@ -29258,271 +34408,278 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; #ifdef COBJMACROS -#define ID3D12GraphicsCommandList9_QueryInterface(This,riid,ppvObject) \ +#define ID3D12GraphicsCommandList10_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ID3D12GraphicsCommandList9_AddRef(This) \ +#define ID3D12GraphicsCommandList10_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ID3D12GraphicsCommandList9_Release(This) \ +#define ID3D12GraphicsCommandList10_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ID3D12GraphicsCommandList9_GetPrivateData(This,guid,pDataSize,pData) \ +#define ID3D12GraphicsCommandList10_GetPrivateData(This,guid,pDataSize,pData) \ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) -#define ID3D12GraphicsCommandList9_SetPrivateData(This,guid,DataSize,pData) \ +#define ID3D12GraphicsCommandList10_SetPrivateData(This,guid,DataSize,pData) \ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) -#define ID3D12GraphicsCommandList9_SetPrivateDataInterface(This,guid,pData) \ +#define ID3D12GraphicsCommandList10_SetPrivateDataInterface(This,guid,pData) \ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) -#define ID3D12GraphicsCommandList9_SetName(This,Name) \ +#define ID3D12GraphicsCommandList10_SetName(This,Name) \ ( (This)->lpVtbl -> SetName(This,Name) ) -#define ID3D12GraphicsCommandList9_GetDevice(This,riid,ppvDevice) \ +#define ID3D12GraphicsCommandList10_GetDevice(This,riid,ppvDevice) \ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) -#define ID3D12GraphicsCommandList9_GetType(This) \ +#define ID3D12GraphicsCommandList10_GetType(This) \ ( (This)->lpVtbl -> GetType(This) ) -#define ID3D12GraphicsCommandList9_Close(This) \ +#define ID3D12GraphicsCommandList10_Close(This) \ ( (This)->lpVtbl -> Close(This) ) -#define ID3D12GraphicsCommandList9_Reset(This,pAllocator,pInitialState) \ +#define ID3D12GraphicsCommandList10_Reset(This,pAllocator,pInitialState) \ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) -#define ID3D12GraphicsCommandList9_ClearState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList10_ClearState(This,pPipelineState) \ ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList9_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList10_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList9_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ +#define ID3D12GraphicsCommandList10_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) -#define ID3D12GraphicsCommandList9_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ +#define ID3D12GraphicsCommandList10_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) -#define ID3D12GraphicsCommandList9_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ +#define ID3D12GraphicsCommandList10_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) -#define ID3D12GraphicsCommandList9_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ +#define ID3D12GraphicsCommandList10_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) -#define ID3D12GraphicsCommandList9_CopyResource(This,pDstResource,pSrcResource) \ +#define ID3D12GraphicsCommandList10_CopyResource(This,pDstResource,pSrcResource) \ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) -#define ID3D12GraphicsCommandList9_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ +#define ID3D12GraphicsCommandList10_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) -#define ID3D12GraphicsCommandList9_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ +#define ID3D12GraphicsCommandList10_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) -#define ID3D12GraphicsCommandList9_IASetPrimitiveTopology(This,PrimitiveTopology) \ +#define ID3D12GraphicsCommandList10_IASetPrimitiveTopology(This,PrimitiveTopology) \ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) -#define ID3D12GraphicsCommandList9_RSSetViewports(This,NumViewports,pViewports) \ +#define ID3D12GraphicsCommandList10_RSSetViewports(This,NumViewports,pViewports) \ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) -#define ID3D12GraphicsCommandList9_RSSetScissorRects(This,NumRects,pRects) \ +#define ID3D12GraphicsCommandList10_RSSetScissorRects(This,NumRects,pRects) \ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) -#define ID3D12GraphicsCommandList9_OMSetBlendFactor(This,BlendFactor) \ +#define ID3D12GraphicsCommandList10_OMSetBlendFactor(This,BlendFactor) \ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) -#define ID3D12GraphicsCommandList9_OMSetStencilRef(This,StencilRef) \ +#define ID3D12GraphicsCommandList10_OMSetStencilRef(This,StencilRef) \ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) -#define ID3D12GraphicsCommandList9_SetPipelineState(This,pPipelineState) \ +#define ID3D12GraphicsCommandList10_SetPipelineState(This,pPipelineState) \ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) -#define ID3D12GraphicsCommandList9_ResourceBarrier(This,NumBarriers,pBarriers) \ +#define ID3D12GraphicsCommandList10_ResourceBarrier(This,NumBarriers,pBarriers) \ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) -#define ID3D12GraphicsCommandList9_ExecuteBundle(This,pCommandList) \ +#define ID3D12GraphicsCommandList10_ExecuteBundle(This,pCommandList) \ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) -#define ID3D12GraphicsCommandList9_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ +#define ID3D12GraphicsCommandList10_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) -#define ID3D12GraphicsCommandList9_SetComputeRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList10_SetComputeRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList9_SetGraphicsRootSignature(This,pRootSignature) \ +#define ID3D12GraphicsCommandList10_SetGraphicsRootSignature(This,pRootSignature) \ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) -#define ID3D12GraphicsCommandList9_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList10_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList9_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ +#define ID3D12GraphicsCommandList10_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) -#define ID3D12GraphicsCommandList9_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList10_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList9_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList10_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList9_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList10_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList9_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ +#define ID3D12GraphicsCommandList10_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) -#define ID3D12GraphicsCommandList9_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList10_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList9_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList10_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList9_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList10_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList9_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList10_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList9_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList10_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList9_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ +#define ID3D12GraphicsCommandList10_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) -#define ID3D12GraphicsCommandList9_IASetIndexBuffer(This,pView) \ +#define ID3D12GraphicsCommandList10_IASetIndexBuffer(This,pView) \ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) -#define ID3D12GraphicsCommandList9_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList10_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList9_SOSetTargets(This,StartSlot,NumViews,pViews) \ +#define ID3D12GraphicsCommandList10_SOSetTargets(This,StartSlot,NumViews,pViews) \ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) -#define ID3D12GraphicsCommandList9_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ +#define ID3D12GraphicsCommandList10_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) -#define ID3D12GraphicsCommandList9_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ +#define ID3D12GraphicsCommandList10_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) -#define ID3D12GraphicsCommandList9_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ +#define ID3D12GraphicsCommandList10_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) -#define ID3D12GraphicsCommandList9_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList10_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList9_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ +#define ID3D12GraphicsCommandList10_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) -#define ID3D12GraphicsCommandList9_DiscardResource(This,pResource,pRegion) \ +#define ID3D12GraphicsCommandList10_DiscardResource(This,pResource,pRegion) \ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) -#define ID3D12GraphicsCommandList9_BeginQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList10_BeginQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList9_EndQuery(This,pQueryHeap,Type,Index) \ +#define ID3D12GraphicsCommandList10_EndQuery(This,pQueryHeap,Type,Index) \ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) -#define ID3D12GraphicsCommandList9_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ +#define ID3D12GraphicsCommandList10_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) -#define ID3D12GraphicsCommandList9_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ +#define ID3D12GraphicsCommandList10_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) -#define ID3D12GraphicsCommandList9_SetMarker(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList10_SetMarker(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList9_BeginEvent(This,Metadata,pData,Size) \ +#define ID3D12GraphicsCommandList10_BeginEvent(This,Metadata,pData,Size) \ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) -#define ID3D12GraphicsCommandList9_EndEvent(This) \ +#define ID3D12GraphicsCommandList10_EndEvent(This) \ ( (This)->lpVtbl -> EndEvent(This) ) -#define ID3D12GraphicsCommandList9_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ +#define ID3D12GraphicsCommandList10_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) -#define ID3D12GraphicsCommandList9_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList10_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList9_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ +#define ID3D12GraphicsCommandList10_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) -#define ID3D12GraphicsCommandList9_OMSetDepthBounds(This,Min,Max) \ +#define ID3D12GraphicsCommandList10_OMSetDepthBounds(This,Min,Max) \ ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) -#define ID3D12GraphicsCommandList9_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ +#define ID3D12GraphicsCommandList10_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) -#define ID3D12GraphicsCommandList9_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ +#define ID3D12GraphicsCommandList10_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) -#define ID3D12GraphicsCommandList9_SetViewInstanceMask(This,Mask) \ +#define ID3D12GraphicsCommandList10_SetViewInstanceMask(This,Mask) \ ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) -#define ID3D12GraphicsCommandList9_WriteBufferImmediate(This,Count,pParams,pModes) \ +#define ID3D12GraphicsCommandList10_WriteBufferImmediate(This,Count,pParams,pModes) \ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) -#define ID3D12GraphicsCommandList9_SetProtectedResourceSession(This,pProtectedResourceSession) \ +#define ID3D12GraphicsCommandList10_SetProtectedResourceSession(This,pProtectedResourceSession) \ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) -#define ID3D12GraphicsCommandList9_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ +#define ID3D12GraphicsCommandList10_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) -#define ID3D12GraphicsCommandList9_EndRenderPass(This) \ +#define ID3D12GraphicsCommandList10_EndRenderPass(This) \ ( (This)->lpVtbl -> EndRenderPass(This) ) -#define ID3D12GraphicsCommandList9_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList10_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList9_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ +#define ID3D12GraphicsCommandList10_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) -#define ID3D12GraphicsCommandList9_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ +#define ID3D12GraphicsCommandList10_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) -#define ID3D12GraphicsCommandList9_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ +#define ID3D12GraphicsCommandList10_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) -#define ID3D12GraphicsCommandList9_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ +#define ID3D12GraphicsCommandList10_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) -#define ID3D12GraphicsCommandList9_SetPipelineState1(This,pStateObject) \ +#define ID3D12GraphicsCommandList10_SetPipelineState1(This,pStateObject) \ ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) -#define ID3D12GraphicsCommandList9_DispatchRays(This,pDesc) \ +#define ID3D12GraphicsCommandList10_DispatchRays(This,pDesc) \ ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) -#define ID3D12GraphicsCommandList9_RSSetShadingRate(This,baseShadingRate,combiners) \ +#define ID3D12GraphicsCommandList10_RSSetShadingRate(This,baseShadingRate,combiners) \ ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) -#define ID3D12GraphicsCommandList9_RSSetShadingRateImage(This,shadingRateImage) \ +#define ID3D12GraphicsCommandList10_RSSetShadingRateImage(This,shadingRateImage) \ ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) -#define ID3D12GraphicsCommandList9_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ +#define ID3D12GraphicsCommandList10_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) -#define ID3D12GraphicsCommandList9_Barrier(This,NumBarrierGroups,pBarrierGroups) \ +#define ID3D12GraphicsCommandList10_Barrier(This,NumBarrierGroups,pBarrierGroups) \ ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) -#define ID3D12GraphicsCommandList9_OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) \ +#define ID3D12GraphicsCommandList10_OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) \ ( (This)->lpVtbl -> OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) ) -#define ID3D12GraphicsCommandList9_RSSetDepthBias(This,DepthBias,DepthBiasClamp,SlopeScaledDepthBias) \ +#define ID3D12GraphicsCommandList10_RSSetDepthBias(This,DepthBias,DepthBiasClamp,SlopeScaledDepthBias) \ ( (This)->lpVtbl -> RSSetDepthBias(This,DepthBias,DepthBiasClamp,SlopeScaledDepthBias) ) -#define ID3D12GraphicsCommandList9_IASetIndexBufferStripCutValue(This,IBStripCutValue) \ +#define ID3D12GraphicsCommandList10_IASetIndexBufferStripCutValue(This,IBStripCutValue) \ ( (This)->lpVtbl -> IASetIndexBufferStripCutValue(This,IBStripCutValue) ) + +#define ID3D12GraphicsCommandList10_SetProgram(This,pDesc) \ + ( (This)->lpVtbl -> SetProgram(This,pDesc) ) + +#define ID3D12GraphicsCommandList10_DispatchGraph(This,pDesc) \ + ( (This)->lpVtbl -> DispatchGraph(This,pDesc) ) + #endif /* COBJMACROS */ @@ -29531,10 +34688,160 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList9; -#endif /* __ID3D12GraphicsCommandList9_INTERFACE_DEFINED__ */ +#endif /* __ID3D12GraphicsCommandList10_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GBVDiagnostics_INTERFACE_DEFINED__ +#define __ID3D12GBVDiagnostics_INTERFACE_DEFINED__ + +/* interface ID3D12GBVDiagnostics */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GBVDiagnostics; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("597985ab-9b75-4dbb-be23-0761195bebee") + ID3D12GBVDiagnostics : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetGBVEntireSubresourceStatesData( + _In_ ID3D12Resource *pResource, + _Out_writes_bytes_(DataSize) int *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGBVSubresourceState( + _In_ ID3D12Resource *pResource, + UINT Subresource, + _Out_ int *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGBVResourceUniformState( + _In_ ID3D12Resource *pResource, + _Out_ int *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetGBVResourceInfo( + _In_ ID3D12Resource *pResource, + _In_opt_ D3D12_RESOURCE_DESC *pResourceDesc, + _In_opt_ UINT32 *pResourceHash, + _In_opt_ UINT32 *pSubresourceStatesByteOffset) = 0; + + virtual void STDMETHODCALLTYPE GBVReserved0( void) = 0; + + virtual void STDMETHODCALLTYPE GBVReserved1( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GBVDiagnosticsVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GBVDiagnostics * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GBVDiagnostics * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GBVDiagnostics * This); + + DECLSPEC_XFGVIRT(ID3D12GBVDiagnostics, GetGBVEntireSubresourceStatesData) + HRESULT ( STDMETHODCALLTYPE *GetGBVEntireSubresourceStatesData )( + ID3D12GBVDiagnostics * This, + _In_ ID3D12Resource *pResource, + _Out_writes_bytes_(DataSize) int *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12GBVDiagnostics, GetGBVSubresourceState) + HRESULT ( STDMETHODCALLTYPE *GetGBVSubresourceState )( + ID3D12GBVDiagnostics * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + _Out_ int *pData); + + DECLSPEC_XFGVIRT(ID3D12GBVDiagnostics, GetGBVResourceUniformState) + HRESULT ( STDMETHODCALLTYPE *GetGBVResourceUniformState )( + ID3D12GBVDiagnostics * This, + _In_ ID3D12Resource *pResource, + _Out_ int *pData); + + DECLSPEC_XFGVIRT(ID3D12GBVDiagnostics, GetGBVResourceInfo) + HRESULT ( STDMETHODCALLTYPE *GetGBVResourceInfo )( + ID3D12GBVDiagnostics * This, + _In_ ID3D12Resource *pResource, + _In_opt_ D3D12_RESOURCE_DESC *pResourceDesc, + _In_opt_ UINT32 *pResourceHash, + _In_opt_ UINT32 *pSubresourceStatesByteOffset); + + DECLSPEC_XFGVIRT(ID3D12GBVDiagnostics, GBVReserved0) + void ( STDMETHODCALLTYPE *GBVReserved0 )( + ID3D12GBVDiagnostics * This); + + DECLSPEC_XFGVIRT(ID3D12GBVDiagnostics, GBVReserved1) + void ( STDMETHODCALLTYPE *GBVReserved1 )( + ID3D12GBVDiagnostics * This); + + END_INTERFACE + } ID3D12GBVDiagnosticsVtbl; + + interface ID3D12GBVDiagnostics + { + CONST_VTBL struct ID3D12GBVDiagnosticsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GBVDiagnostics_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GBVDiagnostics_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GBVDiagnostics_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GBVDiagnostics_GetGBVEntireSubresourceStatesData(This,pResource,pData,DataSize) \ + ( (This)->lpVtbl -> GetGBVEntireSubresourceStatesData(This,pResource,pData,DataSize) ) + +#define ID3D12GBVDiagnostics_GetGBVSubresourceState(This,pResource,Subresource,pData) \ + ( (This)->lpVtbl -> GetGBVSubresourceState(This,pResource,Subresource,pData) ) + +#define ID3D12GBVDiagnostics_GetGBVResourceUniformState(This,pResource,pData) \ + ( (This)->lpVtbl -> GetGBVResourceUniformState(This,pResource,pData) ) + +#define ID3D12GBVDiagnostics_GetGBVResourceInfo(This,pResource,pResourceDesc,pResourceHash,pSubresourceStatesByteOffset) \ + ( (This)->lpVtbl -> GetGBVResourceInfo(This,pResource,pResourceDesc,pResourceHash,pSubresourceStatesByteOffset) ) + +#define ID3D12GBVDiagnostics_GBVReserved0(This) \ + ( (This)->lpVtbl -> GBVReserved0(This) ) + +#define ID3D12GBVDiagnostics_GBVReserved1(This) \ + ( (This)->lpVtbl -> GBVReserved1(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GBVDiagnostics_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_d3d12_0000_0066 */ +/* interface __MIDL_itf_d3d12_0000_0074 */ /* [local] */ #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ @@ -29573,6 +34880,8 @@ DEFINE_GUID(IID_ID3D12SwapChainAssistant,0xf1df64b6,0x57fd,0x49cd,0x88,0x07,0xc0 DEFINE_GUID(IID_ID3D12LifetimeTracker,0x3fd03d36,0x4eb1,0x424a,0xa5,0x82,0x49,0x4e,0xcb,0x8b,0xa8,0x13); DEFINE_GUID(IID_ID3D12StateObject,0x47016943,0xfca8,0x4594,0x93,0xea,0xaf,0x25,0x8b,0x55,0x34,0x6d); DEFINE_GUID(IID_ID3D12StateObjectProperties,0xde5fa827,0x9bf9,0x4f26,0x89,0xff,0xd7,0xf5,0x6f,0xde,0x38,0x60); +DEFINE_GUID(IID_ID3D12StateObjectProperties1,0x460caac7,0x1d24,0x446a,0xa1,0x84,0xca,0x67,0xdb,0x49,0x41,0x38); +DEFINE_GUID(IID_ID3D12WorkGraphProperties,0x065acf71,0xf863,0x4b89,0x82,0xf4,0x02,0xe4,0xd5,0x88,0x67,0x57); DEFINE_GUID(IID_ID3D12Device5,0x8b4f173b,0x2fea,0x4b80,0x8f,0x58,0x43,0x07,0x19,0x1a,0xb9,0x5d); DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings,0x82BC481C,0x6B9B,0x4030,0xAE,0xDB,0x7E,0xE3,0xD1,0xDF,0x1E,0x63); DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings1,0xDBD5AE51,0x3317,0x4F0A,0xAD,0xF9,0x1D,0x7C,0xED,0xCA,0xAE,0x0B); @@ -29594,21 +34903,27 @@ DEFINE_GUID(IID_ID3D12ShaderCacheSession,0x28e2495d,0x0f64,0x4ae4,0xa6,0xec,0x12 DEFINE_GUID(IID_ID3D12Device9,0x4c80e962,0xf032,0x4f60,0xbc,0x9e,0xeb,0xc2,0xcf,0xa1,0xd8,0x3c); DEFINE_GUID(IID_ID3D12Device10,0x517f8718,0xaa66,0x49f9,0xb0,0x2b,0xa7,0xab,0x89,0xc0,0x60,0x31); DEFINE_GUID(IID_ID3D12Device11,0x5405c344,0xd457,0x444e,0xb4,0xdd,0x23,0x66,0xe4,0x5a,0xee,0x39); +DEFINE_GUID(IID_ID3D12Device12,0x5af5c532,0x4c91,0x4cd0,0xb5,0x41,0x15,0xa4,0x05,0x39,0x5f,0xc5); +DEFINE_GUID(IID_ID3D12Device13,0x14eecffc,0x4df8,0x40f7,0xa1,0x18,0x5c,0x81,0x6f,0x45,0x69,0x5e); +DEFINE_GUID(IID_ID3D12Device14,0x5f6e592d,0xd895,0x44c2,0x8e,0x4a,0x88,0xad,0x49,0x26,0xd3,0x23); DEFINE_GUID(IID_ID3D12VirtualizationGuestDevice,0xbc66d368,0x7373,0x4943,0x87,0x57,0xfc,0x87,0xdc,0x79,0xe4,0x76); DEFINE_GUID(IID_ID3D12Tools,0x7071e1f0,0xe84b,0x4b33,0x97,0x4f,0x12,0xfa,0x49,0xde,0x65,0xc5); DEFINE_GUID(IID_ID3D12SDKConfiguration,0xe9eb5314,0x33aa,0x42b2,0xa7,0x18,0xd7,0x7f,0x58,0xb1,0xf1,0xc7); DEFINE_GUID(IID_ID3D12SDKConfiguration1,0x8aaf9303,0xad25,0x48b9,0x9a,0x57,0xd9,0xc3,0x7e,0x00,0x9d,0x9f); DEFINE_GUID(IID_ID3D12DeviceFactory,0x61f307d3,0xd34e,0x4e7c,0x83,0x74,0x3b,0xa4,0xde,0x23,0xcc,0xcb); DEFINE_GUID(IID_ID3D12DeviceConfiguration,0x78dbf87b,0xf766,0x422b,0xa6,0x1c,0xc8,0xc4,0x46,0xbd,0xb9,0xad); +DEFINE_GUID(IID_ID3D12DeviceConfiguration1,0xed342442,0x6343,0x4e16,0xbb,0x82,0xa3,0xa5,0x77,0x87,0x4e,0x56); DEFINE_GUID(IID_ID3D12GraphicsCommandList5,0x55050859,0x4024,0x474c,0x87,0xf5,0x64,0x72,0xea,0xee,0x44,0xea); DEFINE_GUID(IID_ID3D12GraphicsCommandList6,0xc3827890,0xe548,0x4cfa,0x96,0xcf,0x56,0x89,0xa9,0x37,0x0f,0x80); DEFINE_GUID(IID_ID3D12GraphicsCommandList7,0xdd171223,0x8b61,0x4769,0x90,0xe3,0x16,0x0c,0xcd,0xe4,0xe2,0xc1); DEFINE_GUID(IID_ID3D12GraphicsCommandList8,0xee936ef9,0x599d,0x4d28,0x93,0x8e,0x23,0xc4,0xad,0x05,0xce,0x51); DEFINE_GUID(IID_ID3D12GraphicsCommandList9,0x34ed2808,0xffe6,0x4c2b,0xb1,0x1a,0xca,0xbd,0x2b,0x0c,0x59,0xe1); +DEFINE_GUID(IID_ID3D12GraphicsCommandList10,0x7013c015,0xd161,0x4b63,0xa0,0x8c,0x23,0x85,0x52,0xdd,0x8a,0xcc); +DEFINE_GUID(IID_ID3D12GBVDiagnostics,0x597985ab,0x9b75,0x4dbb,0xbe,0x23,0x07,0x61,0x19,0x5b,0xeb,0xee); -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0066_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0066_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0074_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0074_v0_0_s_ifspec; /* Additional Prototypes for ALL interfaces */ diff --git a/deps/DirectX-Headers/include/directx/d3d12.idl b/deps/DirectX-Headers/include/directx/d3d12.idl index da31ff5..65f1d88 100644 --- a/deps/DirectX-Headers/include/directx/d3d12.idl +++ b/deps/DirectX-Headers/include/directx/d3d12.idl @@ -293,7 +293,7 @@ const UINT D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_END = 0xffffffff; const UINT D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_START = 0xfffffff8; const UINT D3D12_PACKED_TILE = 0xffffffff; const UINT D3D12_PIXEL_ADDRESS_RANGE_BIT_COUNT = 15; -const UINT D3D12_PREVIEW_SDK_VERSION = 707; +const UINT D3D12_PREVIEW_SDK_VERSION = 714; const UINT D3D12_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT = 16; const UINT D3D12_PS_CS_UAV_REGISTER_COMPONENTS = 1; const UINT D3D12_PS_CS_UAV_REGISTER_COUNT = 8; @@ -361,7 +361,7 @@ const UINT D3D12_REQ_TEXTURECUBE_DIMENSION = 16384; const UINT D3D12_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL = 0; const UINT D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES = 0xffffffff; const UINT D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT = 2; -const UINT D3D12_SDK_VERSION = 608; +const UINT D3D12_SDK_VERSION = 614; const UINT D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES = 32; const UINT D3D12_SHADER_MAJOR_VERSION = 5; const UINT D3D12_SHADER_MAX_INSTANCES = 65535; @@ -424,6 +424,11 @@ const UINT D3D12_VIDEO_DECODE_MAX_HISTOGRAM_COMPONENTS = 4; const UINT D3D12_VIDEO_DECODE_MIN_BITSTREAM_OFFSET_ALIGNMENT = 256; const UINT D3D12_VIDEO_DECODE_MIN_HISTOGRAM_OFFSET_ALIGNMENT = 256; const UINT D3D12_VIDEO_DECODE_STATUS_MACROBLOCKS_AFFECTED_UNKNOWN = 0xffffffff; +const UINT D3D12_VIDEO_ENCODER_AV1_INVALID_DPB_RESOURCE_INDEX = 0xFF; +const UINT D3D12_VIDEO_ENCODER_AV1_MAX_TILE_COLS = 64; +const UINT D3D12_VIDEO_ENCODER_AV1_MAX_TILE_ROWS = 64; +const UINT D3D12_VIDEO_ENCODER_AV1_SUPERRES_DENOM_MIN = 9; +const UINT D3D12_VIDEO_ENCODER_AV1_SUPERRES_NUM = 8; const UINT D3D12_VIDEO_PROCESS_MAX_FILTERS = 32; const UINT D3D12_VIDEO_PROCESS_STEREO_VIEWS = 2; const UINT D3D12_VIEWPORT_AND_SCISSORRECT_MAX_INDEX = 15; @@ -441,6 +446,8 @@ const UINT D3D12_VS_OUTPUT_REGISTER_COUNT = 32; const UINT D3D12_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT = 10; const UINT D3D12_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP = 25; const UINT D3D12_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP = 25; +const UINT D3D12_WORK_GRAPHS_BACKING_MEMORY_ALIGNMENT_IN_BYTES = 8; +const UINT D3D12_WORK_GRAPHS_MAX_NODE_DEPTH = 32; cpp_quote( "#endif" ) @@ -469,7 +476,7 @@ typedef enum D3D12_COMMAND_QUEUE_FLAGS D3D12_COMMAND_QUEUE_FLAG_NONE = 0x0, D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1, } D3D12_COMMAND_QUEUE_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_QUEUE_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_QUEUE_FLAGS )" ) typedef enum D3D12_COMMAND_QUEUE_PRIORITY { @@ -803,6 +810,28 @@ typedef struct D3D12_RASTERIZER_DESC1 D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster; } D3D12_RASTERIZER_DESC1; +typedef enum D3D12_LINE_RASTERIZATION_MODE +{ + D3D12_LINE_RASTERIZATION_MODE_ALIASED, + D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED, + D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_WIDE, + D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_NARROW, +} D3D12_LINE_RASTERIZATION_MODE; + +typedef struct D3D12_RASTERIZER_DESC2 +{ + D3D12_FILL_MODE FillMode; + D3D12_CULL_MODE CullMode; + BOOL FrontCounterClockwise; + FLOAT DepthBias; + FLOAT DepthBiasClamp; + FLOAT SlopeScaledDepthBias; + BOOL DepthClipEnable; + D3D12_LINE_RASTERIZATION_MODE LineRasterizationMode; + UINT ForcedSampleCount; + D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster; +} D3D12_RASTERIZER_DESC2; + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Pipeline State v1 @@ -843,6 +872,12 @@ typedef enum D3D12_INDEX_BUFFER_STRIP_CUT_VALUE D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF = 2 } D3D12_INDEX_BUFFER_STRIP_CUT_VALUE; +typedef enum D3D12_STANDARD_MULTISAMPLE_QUALITY_LEVELS +{ + D3D12_STANDARD_MULTISAMPLE_PATTERN = 0xffffffff, + D3D12_CENTER_MULTISAMPLE_PATTERN = 0xfffffffe +} D3D12_STANDARD_MULTISAMPLE_QUALITY_LEVELS; + typedef struct D3D12_CACHED_PIPELINE_STATE { [annotation("_Field_size_bytes_full_(CachedBlobSizeInBytes)")] const void* pCachedBlob; @@ -857,7 +892,7 @@ typedef enum D3D12_PIPELINE_STATE_FLAGS D3D12_PIPELINE_STATE_FLAG_DYNAMIC_INDEX_BUFFER_STRIP_CUT = 0x8, } D3D12_PIPELINE_STATE_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_PIPELINE_STATE_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_PIPELINE_STATE_FLAGS )" ) typedef struct D3D12_GRAPHICS_PIPELINE_STATE_DESC { @@ -940,6 +975,7 @@ typedef enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS = 25, // D3D12_SHADER_BYTECODE D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 = 26, // D3D12_DEPTH_STENCIL_DESC2 D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1 = 27, // D3D12_RASTERIZER_DESC1 + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER2 = 28, // D3D12_RASTERIZER_DESC2 D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID, } D3D12_PIPELINE_STATE_SUBOBJECT_TYPE; @@ -986,7 +1022,15 @@ typedef enum D3D12_FEATURE D3D12_FEATURE_D3D12_OPTIONS13 = 42, D3D12_FEATURE_D3D12_OPTIONS14 = 43, D3D12_FEATURE_D3D12_OPTIONS15 = 44, - D3D12_FEATURE_D3D12_OPTIONS16 = 45 + D3D12_FEATURE_D3D12_OPTIONS16 = 45, + D3D12_FEATURE_D3D12_OPTIONS17 = 46, + D3D12_FEATURE_D3D12_OPTIONS18 = 47, + D3D12_FEATURE_D3D12_OPTIONS19 = 48, + D3D12_FEATURE_D3D12_OPTIONS20 = 49, + D3D12_FEATURE_PREDICATION = 50, + D3D12_FEATURE_PLACED_RESOURCE_SUPPORT_INFO = 51, + D3D12_FEATURE_HARDWARE_COPY = 52, + D3D12_FEATURE_D3D12_OPTIONS21 = 53, } D3D12_FEATURE; typedef enum D3D12_SHADER_MIN_PRECISION_SUPPORT @@ -995,7 +1039,7 @@ typedef enum D3D12_SHADER_MIN_PRECISION_SUPPORT D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT = 0x1, D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT = 0x2 } D3D12_SHADER_MIN_PRECISION_SUPPORT; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_MIN_PRECISION_SUPPORT );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_MIN_PRECISION_SUPPORT )" ) typedef enum D3D12_TILED_RESOURCES_TIER { @@ -1054,7 +1098,7 @@ typedef enum D3D12_FORMAT_SUPPORT1 D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_INPUT = 0x20000000, D3D12_FORMAT_SUPPORT1_VIDEO_ENCODER = 0x40000000, } D3D12_FORMAT_SUPPORT1; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT1 );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT1 )" ) typedef enum D3D12_FORMAT_SUPPORT2 { @@ -1072,14 +1116,14 @@ typedef enum D3D12_FORMAT_SUPPORT2 D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x00004000, D3D12_FORMAT_SUPPORT2_SAMPLER_FEEDBACK = 0x00008000, } D3D12_FORMAT_SUPPORT2; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 )" ) typedef enum D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS { D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE = 0, D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE = 0x00000001, } D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS )" ) typedef enum D3D12_CROSS_NODE_SHARING_TIER { @@ -1111,6 +1155,11 @@ typedef enum D3D12_VIEW_INSTANCING_TIER D3D12_VIEW_INSTANCING_TIER_3 = 3, } D3D12_VIEW_INSTANCING_TIER; +typedef enum D3D12_WORK_GRAPHS_TIER { + D3D12_WORK_GRAPHS_TIER_NOT_SUPPORTED = 0, + D3D12_WORK_GRAPHS_TIER_1_0 = 10, +} D3D12_WORK_GRAPHS_TIER; + // D3D12_FEATURE_D3D12_OPTIONS typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS { @@ -1155,6 +1204,7 @@ typedef enum D3D_ROOT_SIGNATURE_VERSION D3D_ROOT_SIGNATURE_VERSION_1 = 0x1, D3D_ROOT_SIGNATURE_VERSION_1_0 = 0x1, D3D_ROOT_SIGNATURE_VERSION_1_1 = 0x2, + D3D_ROOT_SIGNATURE_VERSION_1_2 = 0x3, } D3D_ROOT_SIGNATURE_VERSION; typedef struct D3D12_FEATURE_DATA_ROOT_SIGNATURE @@ -1192,6 +1242,7 @@ typedef struct D3D12_FEATURE_DATA_FEATURE_LEVELS // D3D_SHADER_MODEL typedef enum D3D_SHADER_MODEL { + D3D_SHADER_MODEL_NONE = 0x0, // e.g MCDM Generic devices D3D_SHADER_MODEL_5_1 = 0x51, D3D_SHADER_MODEL_6_0 = 0x60, D3D_SHADER_MODEL_6_1 = 0x61, @@ -1202,7 +1253,8 @@ typedef enum D3D_SHADER_MODEL D3D_SHADER_MODEL_6_6 = 0x66, D3D_SHADER_MODEL_6_7 = 0x67, D3D_SHADER_MODEL_6_8 = 0x68, - D3D_HIGHEST_SHADER_MODEL = D3D_SHADER_MODEL_6_8 + D3D_SHADER_MODEL_6_9 = 0x69, + D3D_HIGHEST_SHADER_MODEL = D3D_SHADER_MODEL_6_9 } D3D_SHADER_MODEL; typedef struct D3D12_FEATURE_DATA_SHADER_MODEL @@ -1253,7 +1305,7 @@ typedef enum D3D12_SHADER_CACHE_SUPPORT_FLAGS D3D12_SHADER_CACHE_SUPPORT_SHADER_CONTROL_CLEAR = 0x20, D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE = 0x40 } D3D12_SHADER_CACHE_SUPPORT_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_SUPPORT_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_SUPPORT_FLAGS )" ) // D3D12_FEATURE_SHADER_CACHE typedef struct D3D12_FEATURE_DATA_SHADER_CACHE @@ -1281,7 +1333,7 @@ typedef enum D3D12_COMMAND_LIST_SUPPORT_FLAGS D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_ENCODE = 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE, } D3D12_COMMAND_LIST_SUPPORT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_SUPPORT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_SUPPORT_FLAGS )") // D3D12_FEATURE_D3D12_OPTIONS3 typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3 @@ -1492,9 +1544,83 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS15 typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS16 { [annotation("_Out_")] BOOL DynamicDepthBiasSupported; - [annotation("_Out_")] BOOL Reserved; // + [annotation("_Out_")] BOOL GPUUploadHeapSupported; } D3D12_FEATURE_DATA_D3D12_OPTIONS16; +// D3D12_FEATURE_D3D12_OPTIONS17 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS17 +{ + [annotation("_Out_")] BOOL NonNormalizedCoordinateSamplersSupported; + [annotation("_Out_")] BOOL ManualWriteTrackingResourceSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS17; + +// D3D12_FEATURE_D3D12_OPTIONS18 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS18 +{ + [annotation("_Out_")] BOOL RenderPassesValid; +} D3D12_FEATURE_DATA_D3D12_OPTIONS18; + +// D3D12_FEATURE_D3D12_OPTIONS19 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS19 +{ + BOOL MismatchingOutputDimensionsSupported; + UINT SupportedSampleCountsWithNoOutputs; + BOOL PointSamplingAddressesNeverRoundUp; + BOOL RasterizerDesc2Supported; + BOOL NarrowQuadrilateralLinesSupported; + BOOL AnisoFilterWithPointMipSupported; + UINT MaxSamplerDescriptorHeapSize; + UINT MaxSamplerDescriptorHeapSizeWithStaticSamplers; + UINT MaxViewDescriptorHeapSize; + [annotation("_Out_")] BOOL ComputeOnlyCustomHeapSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS19; + + +typedef enum D3D12_RECREATE_AT_TIER +{ + D3D12_RECREATE_AT_TIER_NOT_SUPPORTED = 0, + + // * Supports retrieving resource and heap allocation information + // with ID3D12PageableTools::GetAllocationInfo + // * Supports setting resource and heap virtual addresses with + // ID3D12DeviceTools::SetNextAllocation + D3D12_RECREATE_AT_TIER_1 = 1, + +} D3D12_RECREATE_AT_TIER; + + +// D3D12_FEATURE_D3D12_OPTIONS20 +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS20 +{ + [annotation("_Out_")] BOOL ComputeOnlyWriteWatchSupported; + D3D12_RECREATE_AT_TIER RecreateAtTier; +} D3D12_FEATURE_DATA_D3D12_OPTIONS20; + +typedef enum D3D12_EXECUTE_INDIRECT_TIER +{ + D3D12_EXECUTE_INDIRECT_TIER_1_0 = 10, + D3D12_EXECUTE_INDIRECT_TIER_1_1 = 11, +} D3D12_EXECUTE_INDIRECT_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS21 +{ + [annotation("_Out_")] D3D12_WORK_GRAPHS_TIER WorkGraphsTier; + [annotation("_Out_")] D3D12_EXECUTE_INDIRECT_TIER ExecuteIndirectTier; + [annotation("_Out_")] BOOL SampleCmpGradientAndBiasSupported; + [annotation("_Out_")] BOOL ExtendedCommandInfoSupported; +} D3D12_FEATURE_DATA_D3D12_OPTIONS21; + + +typedef struct D3D12_FEATURE_DATA_PREDICATION +{ + [annotation("_Out_")] BOOL Supported; +} D3D12_FEATURE_DATA_PREDICATION; + +typedef struct D3D12_FEATURE_DATA_HARDWARE_COPY +{ + [annotation("_Out_")] BOOL Supported; +} D3D12_FEATURE_DATA_HARDWARE_COPY; + typedef struct D3D12_RESOURCE_ALLOCATION_INFO { @@ -1515,6 +1641,7 @@ typedef enum D3D12_HEAP_TYPE D3D12_HEAP_TYPE_UPLOAD = 2, D3D12_HEAP_TYPE_READBACK = 3, D3D12_HEAP_TYPE_CUSTOM = 4, + D3D12_HEAP_TYPE_GPU_UPLOAD = 5, } D3D12_HEAP_TYPE; typedef enum D3D12_CPU_PAGE_PROPERTY @@ -1555,6 +1682,7 @@ typedef enum D3D12_HEAP_FLAGS D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS = 0x400, D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT = 0x800, D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = 0x1000, + D3D12_HEAP_FLAG_TOOLS_USE_MANUAL_WRITE_TRACKING = 0x2000, // These are convenience aliases to manage resource heap tier restrictions. They cannot be bitwise OR'ed together cleanly. D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0x0, @@ -1564,7 +1692,7 @@ typedef enum D3D12_HEAP_FLAGS } D3D12_HEAP_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_HEAP_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_HEAP_FLAGS )" ) typedef struct D3D12_HEAP_DESC { @@ -1583,6 +1711,14 @@ typedef enum D3D12_RESOURCE_DIMENSION D3D12_RESOURCE_DIMENSION_TEXTURE3D = 4, } D3D12_RESOURCE_DIMENSION; +typedef struct D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO +{ + [annotation("_In_")] DXGI_FORMAT Format; + [annotation("_In_")] D3D12_RESOURCE_DIMENSION Dimension; + [annotation("_In_")] D3D12_HEAP_PROPERTIES DestHeapProperties; + [annotation("_Out_")] BOOL Supported; +} D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO; + typedef enum D3D12_TEXTURE_LAYOUT { D3D12_TEXTURE_LAYOUT_UNKNOWN = 0, @@ -1605,7 +1741,7 @@ typedef enum D3D12_RESOURCE_FLAGS D3D12_RESOURCE_FLAG_RAYTRACING_ACCELERATION_STRUCTURE = 0x100, } D3D12_RESOURCE_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS )" ) typedef struct D3D12_MIP_REGION { @@ -1644,6 +1780,7 @@ typedef struct D3D12_RESOURCE_DESC1 } D3D12_RESOURCE_DESC1; + typedef struct D3D12_DEPTH_STENCIL_VALUE { FLOAT Depth; @@ -1739,7 +1876,7 @@ typedef enum D3D12_TILE_MAPPING_FLAGS D3D12_TILE_MAPPING_FLAG_NONE = 0x0, D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1, } D3D12_TILE_MAPPING_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_MAPPING_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_MAPPING_FLAGS )" ) typedef enum D3D12_TILE_COPY_FLAGS { @@ -1748,7 +1885,7 @@ typedef enum D3D12_TILE_COPY_FLAGS D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE = 0x2, D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x4, } D3D12_TILE_COPY_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_COPY_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_COPY_FLAGS )") // Resource Barrier typedef enum D3D12_RESOURCE_STATES @@ -1772,6 +1909,12 @@ typedef enum D3D12_RESOURCE_STATES D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE = 0x400000, D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE = 0x1000000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_8000 = 0x8000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_4000 = 0x4000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_100000 = 0x100000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_40000000 = 0x40000000, + D3D12_RESOURCE_STATE_RESERVED_INTERNAL_80000000 = 0x80000000, + D3D12_RESOURCE_STATE_GENERIC_READ = /*D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER*/ 0x0001 | /*D3D12_RESOURCE_STATE_INDEX_BUFFER*/ 0x0002 | @@ -1795,7 +1938,7 @@ typedef enum D3D12_RESOURCE_STATES D3D12_RESOURCE_STATE_VIDEO_ENCODE_WRITE = 0x00800000, } D3D12_RESOURCE_STATES; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_STATES );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_STATES )" ) typedef enum D3D12_RESOURCE_BARRIER_TYPE { @@ -1831,7 +1974,7 @@ typedef enum D3D12_RESOURCE_BARRIER_FLAGS D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY = 0x1, D3D12_RESOURCE_BARRIER_FLAG_END_ONLY = 0x2, } D3D12_RESOURCE_BARRIER_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_BARRIER_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_BARRIER_FLAGS )" ) typedef struct D3D12_RESOURCE_BARRIER { @@ -1905,7 +2048,7 @@ typedef enum D3D12_VIEW_INSTANCING_FLAGS D3D12_VIEW_INSTANCING_FLAG_NONE = 0x0, D3D12_VIEW_INSTANCING_FLAG_ENABLE_VIEW_INSTANCE_MASKING = 0x1, } D3D12_VIEW_INSTANCING_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIEW_INSTANCING_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIEW_INSTANCING_FLAGS )") typedef struct D3D12_VIEW_INSTANCING_DESC { @@ -1940,7 +2083,7 @@ typedef enum D3D12_BUFFER_SRV_FLAGS D3D12_BUFFER_SRV_FLAG_NONE = 0, D3D12_BUFFER_SRV_FLAG_RAW = 0x00000001, // allow device multi-component reads with DWORD addressing } D3D12_BUFFER_SRV_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_SRV_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_SRV_FLAGS )" ) typedef struct D3D12_BUFFER_SRV { @@ -2094,6 +2237,7 @@ typedef enum D3D12_FILTER D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x00000011, D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x00000014, D3D12_FILTER_MIN_MAG_MIP_LINEAR = 0x00000015, + D3D12_FILTER_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x00000054, D3D12_FILTER_ANISOTROPIC = 0x00000055, D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x00000080, D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x00000081, @@ -2103,6 +2247,7 @@ typedef enum D3D12_FILTER D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x00000091, D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x00000094, D3D12_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x00000095, + D3D12_FILTER_COMPARISON_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x000000d4, D3D12_FILTER_COMPARISON_ANISOTROPIC = 0x000000d5, D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x00000100, D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x00000101, @@ -2112,6 +2257,7 @@ typedef enum D3D12_FILTER D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x00000111, D3D12_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x00000114, D3D12_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x00000115, + D3D12_FILTER_MINIMUM_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x00000154, D3D12_FILTER_MINIMUM_ANISOTROPIC = 0x00000155, D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x00000180, D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x00000181, @@ -2121,6 +2267,7 @@ typedef enum D3D12_FILTER D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x00000191, D3D12_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x00000194, D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x00000195, + D3D12_FILTER_MAXIMUM_MIN_MAG_ANISOTROPIC_MIP_POINT = 0x000001d4, D3D12_FILTER_MAXIMUM_ANISOTROPIC = 0x000001d5 } D3D12_FILTER; @@ -2164,6 +2311,13 @@ cpp_quote( " D3D12_ENCODE_BASIC_FILTER( cpp_quote( " D3D12_FILTER_TYPE_LINEAR, \\" ) cpp_quote( " D3D12_FILTER_TYPE_LINEAR, \\" ) cpp_quote( " reduction ) ) ) " ) +cpp_quote( "#define D3D12_ENCODE_MIN_MAG_ANISOTROPIC_MIP_POINT_FILTER( reduction ) \\" ) +cpp_quote( " ( ( D3D12_FILTER ) ( \\" ) +cpp_quote( " D3D12_ANISOTROPIC_FILTERING_BIT | \\" ) +cpp_quote( " D3D12_ENCODE_BASIC_FILTER( D3D12_FILTER_TYPE_LINEAR, \\" ) +cpp_quote( " D3D12_FILTER_TYPE_LINEAR, \\" ) +cpp_quote( " D3D12_FILTER_TYPE_POINT, \\" ) +cpp_quote( " reduction ) ) ) " ) cpp_quote( "#define D3D12_DECODE_MIN_FILTER( D3D12Filter ) \\" ) cpp_quote( " ( ( D3D12_FILTER_TYPE ) \\" ) @@ -2187,8 +2341,7 @@ cpp_quote( " ( D3D12_DECODE_FILTER_REDUCTION( D3 cpp_quote( "#define D3D12_DECODE_IS_ANISOTROPIC_FILTER( D3D12Filter ) \\" ) cpp_quote( " ( ( ( D3D12Filter ) & D3D12_ANISOTROPIC_FILTERING_BIT ) && \\" ) cpp_quote( " ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIN_FILTER( D3D12Filter ) ) && \\" ) -cpp_quote( " ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) && \\" ) -cpp_quote( " ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIP_FILTER( D3D12Filter ) ) ) " ) +cpp_quote( " ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) ) " ) typedef enum D3D12_TEXTURE_ADDRESS_MODE { @@ -2219,9 +2372,10 @@ typedef struct D3D12_SAMPLER_DESC typedef enum D3D12_SAMPLER_FLAGS { D3D12_SAMPLER_FLAG_NONE = 0x0, - D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x01 + D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x01, + D3D12_SAMPLER_FLAG_NON_NORMALIZED_COORDINATES = 0x02, } D3D12_SAMPLER_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SAMPLER_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SAMPLER_FLAGS )") typedef struct D3D12_SAMPLER_DESC2 { @@ -2249,7 +2403,7 @@ typedef enum D3D12_BUFFER_UAV_FLAGS D3D12_BUFFER_UAV_FLAG_NONE = 0, D3D12_BUFFER_UAV_FLAG_RAW = 0x00000001, } D3D12_BUFFER_UAV_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_UAV_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_UAV_FLAGS )" ) typedef struct D3D12_BUFFER_UAV { @@ -2458,7 +2612,7 @@ typedef enum D3D12_DSV_FLAGS D3D12_DSV_FLAG_READ_ONLY_DEPTH = 0x1, D3D12_DSV_FLAG_READ_ONLY_STENCIL = 0x2, } D3D12_DSV_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_DSV_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_DSV_FLAGS )" ) typedef enum D3D12_DSV_DIMENSION { @@ -2494,7 +2648,7 @@ typedef enum D3D12_CLEAR_FLAGS D3D12_CLEAR_FLAG_DEPTH = 0x01, D3D12_CLEAR_FLAG_STENCIL = 0x02, } D3D12_CLEAR_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_CLEAR_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_CLEAR_FLAGS )" ) typedef enum D3D12_FENCE_FLAGS { @@ -2503,7 +2657,7 @@ typedef enum D3D12_FENCE_FLAGS D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x2, D3D12_FENCE_FLAG_NON_MONITORED = 0x4, } D3D12_FENCE_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_FENCE_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_FENCE_FLAGS )" ) typedef enum D3D12_DESCRIPTOR_HEAP_TYPE { @@ -2519,7 +2673,7 @@ typedef enum D3D12_DESCRIPTOR_HEAP_FLAGS D3D12_DESCRIPTOR_HEAP_FLAG_NONE = 0x0, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE = 0x1, } D3D12_DESCRIPTOR_HEAP_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_HEAP_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_HEAP_FLAGS )" ) typedef struct D3D12_DESCRIPTOR_HEAP_DESC { @@ -2616,7 +2770,7 @@ typedef enum D3D12_ROOT_SIGNATURE_FLAGS D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED = 0x400, D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED = 0x800, } D3D12_ROOT_SIGNATURE_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS )" ) typedef enum D3D12_STATIC_BORDER_COLOR @@ -2625,7 +2779,8 @@ typedef enum D3D12_STATIC_BORDER_COLOR D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK, // 0.0f,0.0f,0.0f,1.0f D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, // 1.0f,1.0f,1.0f,1.0f D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK_UINT, // 0,0,0,1 - D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE_UINT // 1,1,1,1 + D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE_UINT, // 1,1,1,1 + } D3D12_STATIC_BORDER_COLOR; typedef struct D3D12_STATIC_SAMPLER_DESC @@ -2645,6 +2800,23 @@ typedef struct D3D12_STATIC_SAMPLER_DESC D3D12_SHADER_VISIBILITY ShaderVisibility; } D3D12_STATIC_SAMPLER_DESC; +typedef struct D3D12_STATIC_SAMPLER_DESC1 +{ + D3D12_FILTER Filter; + D3D12_TEXTURE_ADDRESS_MODE AddressU; + D3D12_TEXTURE_ADDRESS_MODE AddressV; + D3D12_TEXTURE_ADDRESS_MODE AddressW; + FLOAT MipLODBias; + UINT MaxAnisotropy; + D3D12_COMPARISON_FUNC ComparisonFunc; + D3D12_STATIC_BORDER_COLOR BorderColor; + FLOAT MinLOD; + FLOAT MaxLOD; + UINT ShaderRegister; + UINT RegisterSpace; + D3D12_SHADER_VISIBILITY ShaderVisibility; + D3D12_SAMPLER_FLAGS Flags; +} D3D12_STATIC_SAMPLER_DESC1; typedef struct D3D12_ROOT_SIGNATURE_DESC { @@ -2664,7 +2836,7 @@ typedef enum D3D12_DESCRIPTOR_RANGE_FLAGS D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC = 0x8, D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS = 0x10000, } D3D12_DESCRIPTOR_RANGE_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_RANGE_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_RANGE_FLAGS )") typedef struct D3D12_DESCRIPTOR_RANGE1 { @@ -2689,7 +2861,7 @@ typedef enum D3D12_ROOT_DESCRIPTOR_FLAGS D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4, D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC = 0x8, } D3D12_ROOT_DESCRIPTOR_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_DESCRIPTOR_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_DESCRIPTOR_FLAGS )") typedef struct D3D12_ROOT_DESCRIPTOR1 { @@ -2719,6 +2891,15 @@ typedef struct D3D12_ROOT_SIGNATURE_DESC1 D3D12_ROOT_SIGNATURE_FLAGS Flags; } D3D12_ROOT_SIGNATURE_DESC1; +typedef struct D3D12_ROOT_SIGNATURE_DESC2 +{ + UINT NumParameters; + [annotation("_Field_size_full_(NumParameters)")] const D3D12_ROOT_PARAMETER1* pParameters; + UINT NumStaticSamplers; + [annotation("_Field_size_full_(NumStaticSamplers)")] const D3D12_STATIC_SAMPLER_DESC1* pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; +} D3D12_ROOT_SIGNATURE_DESC2; + typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC { @@ -2727,6 +2908,7 @@ typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC { D3D12_ROOT_SIGNATURE_DESC Desc_1_0; D3D12_ROOT_SIGNATURE_DESC1 Desc_1_1; + D3D12_ROOT_SIGNATURE_DESC2 Desc_1_2; }; } D3D12_VERSIONED_ROOT_SIGNATURE_DESC; @@ -2952,6 +3134,7 @@ typedef enum D3D12_INDIRECT_ARGUMENT_TYPE D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW, D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS, D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH, + D3D12_INDIRECT_ARGUMENT_TYPE_INCREMENTING_CONSTANT, } D3D12_INDIRECT_ARGUMENT_TYPE; typedef struct D3D12_INDIRECT_ARGUMENT_DESC @@ -2986,6 +3169,13 @@ typedef struct D3D12_INDIRECT_ARGUMENT_DESC { UINT RootParameterIndex; } UnorderedAccessView; + + // Tier 1.1 support + struct + { + UINT RootParameterIndex; + UINT DestOffsetIn32BitValues; + } IncrementingConstant; }; } D3D12_INDIRECT_ARGUMENT_DESC; @@ -3838,7 +4028,7 @@ typedef enum D3D12_MULTIPLE_FENCE_WAIT_FLAGS D3D12_MULTIPLE_FENCE_WAIT_FLAG_ALL = 0x0, // Alias, default behavior is ALL } D3D12_MULTIPLE_FENCE_WAIT_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTIPLE_FENCE_WAIT_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTIPLE_FENCE_WAIT_FLAGS )" ) // Applications may use the whole value range of UINT for a priority. // These names are merely semantic suggestions. @@ -3892,7 +4082,7 @@ typedef enum D3D12_RESIDENCY_FLAGS D3D12_RESIDENCY_FLAG_NONE = 0x0, D3D12_RESIDENCY_FLAG_DENY_OVERBUDGET = 0x1, } D3D12_RESIDENCY_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESIDENCY_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESIDENCY_FLAGS )" ) [uuid(81dadc15-2bad-4392-93c5-101345c4aa98), object, local, pointer_default(unique)] interface ID3D12Device3 @@ -3921,7 +4111,7 @@ typedef enum D3D12_COMMAND_LIST_FLAGS { D3D12_COMMAND_LIST_FLAG_NONE = 0x0, } D3D12_COMMAND_LIST_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_FLAGS )") typedef enum D3D12_COMMAND_POOL_FLAGS @@ -3929,14 +4119,14 @@ typedef enum D3D12_COMMAND_POOL_FLAGS D3D12_COMMAND_POOL_FLAG_NONE = 0x0, } D3D12_COMMAND_POOL_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_POOL_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_POOL_FLAGS )") typedef enum D3D12_COMMAND_RECORDER_FLAGS { D3D12_COMMAND_RECORDER_FLAG_NONE = 0x0, } D3D12_COMMAND_RECORDER_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_RECORDER_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_RECORDER_FLAGS )") typedef enum D3D12_PROTECTED_SESSION_STATUS { @@ -3961,7 +4151,7 @@ typedef enum D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED = 0x1, } D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS )") typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT { @@ -3974,7 +4164,7 @@ typedef enum D3D12_PROTECTED_RESOURCE_SESSION_FLAGS D3D12_PROTECTED_RESOURCE_SESSION_FLAG_NONE = 0x0, } D3D12_PROTECTED_RESOURCE_SESSION_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_FLAGS )") typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC { @@ -4088,7 +4278,7 @@ typedef enum D3D12_META_COMMAND_PARAMETER_FLAGS D3D12_META_COMMAND_PARAMETER_FLAG_INPUT = 0x00000001, D3D12_META_COMMAND_PARAMETER_FLAG_OUTPUT = 0x00000002 } D3D12_META_COMMAND_PARAMETER_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_META_COMMAND_PARAMETER_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_META_COMMAND_PARAMETER_FLAGS )") typedef enum D3D12_META_COMMAND_PARAMETER_STAGE { @@ -4128,7 +4318,7 @@ typedef enum D3D12_GRAPHICS_STATES D3D12_GRAPHICS_STATE_VIEW_INSTANCE_MASK = (1 << 16), } D3D12_GRAPHICS_STATES; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_GRAPHICS_STATES );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_GRAPHICS_STATES )") typedef struct D3D12_META_COMMAND_DESC { @@ -4154,6 +4344,55 @@ interface ID3D12StateObjectProperties void SetPipelineStackSize(UINT64 PipelineStackSizeInBytes); } +typedef struct D3D12_PROGRAM_IDENTIFIER +{ + UINT64 OpaqueData[4]; +} D3D12_PROGRAM_IDENTIFIER; + +[uuid(460caac7-1d24-446a-a184-ca67db494138), object, local, pointer_default(unique)] +interface ID3D12StateObjectProperties1 + : ID3D12StateObjectProperties +{ + D3D12_PROGRAM_IDENTIFIER GetProgramIdentifier(LPCWSTR pProgramName); +} + +typedef struct D3D12_NODE_ID +{ + LPCWSTR Name; + UINT ArrayIndex; +} D3D12_NODE_ID; + +typedef struct D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS +{ + UINT64 MinSizeInBytes; + UINT64 MaxSizeInBytes; + UINT SizeGranularityInBytes; +} D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS; + +[uuid(065acf71-f863-4b89-82f4-02e4d5886757), object, local, pointer_default(unique)] +interface ID3D12WorkGraphProperties : IUnknown +{ + UINT GetNumWorkGraphs(); + LPCWSTR GetProgramName(UINT WorkGraphIndex); + UINT GetWorkGraphIndex(LPCWSTR pProgramName); + + UINT GetNumNodes(UINT WorkGraphIndex); + D3D12_NODE_ID GetNodeID(UINT WorkGraphIndex, UINT NodeIndex); + UINT GetNodeIndex(UINT WorkGraphIndex, D3D12_NODE_ID NodeID); + UINT GetNodeLocalRootArgumentsTableIndex(UINT WorkGraphIndex, UINT NodeIndex); + + UINT GetNumEntrypoints(UINT WorkGraphIndex); + D3D12_NODE_ID GetEntrypointID(UINT WorkGraphIndex, UINT EntrypointIndex); + UINT GetEntrypointIndex(UINT WorkGraphIndex, D3D12_NODE_ID NodeID); + UINT GetEntrypointRecordSizeInBytes(UINT WorkGraphIndex, UINT EntrypointIndex); + + void GetWorkGraphMemoryRequirements( + UINT WorkGraphIndex, + [annotation("_Out_")] D3D12_WORK_GRAPH_MEMORY_REQUIREMENTS* pWorkGraphMemoryRequirements); + + UINT GetEntrypointRecordAlignmentInBytes(UINT WorkGraphIndex, UINT EntrypointIndex); +} + typedef enum D3D12_STATE_SUBOBJECT_TYPE { D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG = 0, // D3D12_STATE_OBJECT_CONFIG @@ -4169,6 +4408,25 @@ typedef enum D3D12_STATE_SUBOBJECT_TYPE D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG = 10, // D3D12_RAYTRACING_PIPELINE_CONFIG D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP = 11, // D3D12_HIT_GROUP_DESC D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 = 12, // D3D12_RAYTRACING_PIPELINE_CONFIG1 + D3D12_STATE_SUBOBJECT_TYPE_WORK_GRAPH = 13, // D3D12_WORK_GRAPH_DESC + D3D12_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT = 14, // D3D12_STREAM_OUTPUT_DESC + D3D12_STATE_SUBOBJECT_TYPE_BLEND = 15, // D3D12_BLEND_DESC + D3D12_STATE_SUBOBJECT_TYPE_SAMPLE_MASK = 16, // UINT + D3D12_STATE_SUBOBJECT_TYPE_RASTERIZER = 17, // D3D12_RASTERIZER_DESC2 + D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL = 18, // D3D12_DEPTH_STENCIL_DESC + D3D12_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT = 19, // D3D12_INPUT_LAYOUT_DESC + D3D12_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE = 20, // D3D12_INDEX_BUFFER_STRIP_CUT_VALUE + D3D12_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY = 21, // D3D12_PRIMITIVE_TOPOLOGY_TYPE + D3D12_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS = 22, // D3D12_RT_FORMAT_ARRAY + D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT = 23, // DXGI_FORMAT + D3D12_STATE_SUBOBJECT_TYPE_SAMPLE_DESC = 24, // DXGI_SAMPLE_DESC + // 25 is unused + D3D12_STATE_SUBOBJECT_TYPE_FLAGS = 26, // D3D12_PIPELINE_STATE_FLAGS + D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1 = 27, // D3D12_DEPTH_STENCIL_DESC1 + D3D12_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING = 28, // D3D12_VIEW_INSTANCING_DESC + D3D12_STATE_SUBOBJECT_TYPE_GENERIC_PROGRAM = 29, // D3D12_GENERIC_PROGRAM_DESC + D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 = 30, // D3D12_DEPTH_STENCIL_DESC2 + D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID, } D3D12_STATE_SUBOBJECT_TYPE; @@ -4185,7 +4443,7 @@ typedef enum D3D12_STATE_OBJECT_FLAGS D3D12_STATE_OBJECT_FLAG_ALLOW_EXTERNAL_DEPENDENCIES_ON_LOCAL_DEFINITIONS = 0x2, D3D12_STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS = 0x4, } D3D12_STATE_OBJECT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_STATE_OBJECT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_STATE_OBJECT_FLAGS )") typedef struct D3D12_STATE_OBJECT_CONFIG { @@ -4207,11 +4465,31 @@ typedef struct D3D12_NODE_MASK UINT NodeMask; } D3D12_NODE_MASK; +typedef struct D3D12_SAMPLE_MASK +{ + UINT SampleMask; +} D3D12_SAMPLE_MASK; + +typedef struct D3D12_IB_STRIP_CUT_VALUE +{ + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IndexBufferStripCutValue; +} D3D12_IB_STRIP_CUT_VALUE; + +typedef struct D3D12_PRIMITIVE_TOPOLOGY_DESC +{ + D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopology; +} D3D12_PRIMITIVE_TOPOLOGY_DESC; + +typedef struct D3D12_DEPTH_STENCIL_FORMAT +{ + DXGI_FORMAT DepthStencilFormat; +} D3D12_DEPTH_STENCIL_FORMAT; + typedef enum D3D12_EXPORT_FLAGS { D3D12_EXPORT_FLAG_NONE = 0x0, } D3D12_EXPORT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_EXPORT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_EXPORT_FLAGS )") typedef struct D3D12_EXPORT_DESC { @@ -4224,14 +4502,14 @@ typedef struct D3D12_DXIL_LIBRARY_DESC { D3D12_SHADER_BYTECODE DXILLibrary; UINT NumExports; // Optional, if 0 all exports in the library/collection will be surfaced - [annotation("_In_reads_(NumExports)")] D3D12_EXPORT_DESC* pExports; + [annotation("_In_reads_(NumExports)")] const D3D12_EXPORT_DESC* pExports; } D3D12_DXIL_LIBRARY_DESC; typedef struct D3D12_EXISTING_COLLECTION_DESC { ID3D12StateObject* pExistingCollection; UINT NumExports; // Optional, if 0 all exports in the library/collection will be surfaced - [annotation("_In_reads_(NumExports)")] D3D12_EXPORT_DESC* pExports; + [annotation("_In_reads_(NumExports)")] const D3D12_EXPORT_DESC* pExports; } D3D12_EXISTING_COLLECTION_DESC; typedef struct D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION @@ -4280,7 +4558,7 @@ typedef enum D3D12_RAYTRACING_PIPELINE_FLAGS D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES = 0x100, D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200, } D3D12_RAYTRACING_PIPELINE_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_PIPELINE_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_PIPELINE_FLAGS )") typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG1 { @@ -4288,12 +4566,124 @@ typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG1 D3D12_RAYTRACING_PIPELINE_FLAGS Flags; } D3D12_RAYTRACING_PIPELINE_CONFIG1; +typedef struct D3D12_NODE_OUTPUT_OVERRIDES +{ + UINT OutputIndex; + [annotation("_In_opt_")] const D3D12_NODE_ID* pNewName; + [annotation("_In_opt_")] const BOOL* pAllowSparseNodes; + [annotation("_In_opt_")] const UINT* pMaxRecords; + [annotation("_In_opt_")] const UINT* pMaxRecordsSharedWithOutputIndex; +} D3D12_NODE_OUTPUT_OVERRIDES; + +typedef struct D3D12_BROADCASTING_LAUNCH_OVERRIDES +{ + [annotation("_In_opt_")] const UINT* pLocalRootArgumentsTableIndex; + [annotation("_In_opt_")] const BOOL* pProgramEntry; + [annotation("_In_opt_")] const D3D12_NODE_ID* pNewName; + [annotation("_In_opt_ ")] const D3D12_NODE_ID* pShareInputOf; + [annotation("_In_reads_opt_(3)")] const UINT* pDispatchGrid; + [annotation("_In_reads_opt_(3)")] const UINT* pMaxDispatchGrid; + UINT NumOutputOverrides; + [annotation("_In_reads_opt_(NumOutputOverrides)")] const D3D12_NODE_OUTPUT_OVERRIDES* pOutputOverrides; +} D3D12_BROADCASTING_LAUNCH_OVERRIDES; + +typedef struct D3D12_COALESCING_LAUNCH_OVERRIDES +{ + [annotation("_In_opt_")] const UINT* pLocalRootArgumentsTableIndex; + [annotation("_In_opt_")] const BOOL* pProgramEntry; + [annotation("_In_opt_")] const D3D12_NODE_ID* pNewName; + [annotation("_In_opt_")] const D3D12_NODE_ID* pShareInputOf; + UINT NumOutputOverrides; + [annotation("_In_reads_opt_(NumOutputOverrides)")] const D3D12_NODE_OUTPUT_OVERRIDES* pOutputOverrides; +} D3D12_COALESCING_LAUNCH_OVERRIDES; + +typedef struct D3D12_THREAD_LAUNCH_OVERRIDES +{ + [annotation("_In_opt_")] const UINT* pLocalRootArgumentsTableIndex; + [annotation("_In_opt_")] const BOOL* pProgramEntry; + [annotation("_In_opt_")] const D3D12_NODE_ID* pNewName; + [annotation("_In_opt_")] const D3D12_NODE_ID* pShareInputOf; + UINT NumOutputOverrides; + [annotation("_In_reads_opt_(NumOutputOverrides)")] const D3D12_NODE_OUTPUT_OVERRIDES* pOutputOverrides; +} D3D12_THREAD_LAUNCH_OVERRIDES; + +typedef struct D3D12_COMMON_COMPUTE_NODE_OVERRIDES +{ + [annotation("_In_opt_")] const UINT* pLocalRootArgumentsTableIndex; + [annotation("_In_opt_")] const BOOL* pProgramEntry; + [annotation("_In_opt_")] const D3D12_NODE_ID* pNewName; + [annotation("_In_opt_")] const D3D12_NODE_ID* pShareInputOf; + UINT NumOutputOverrides; + [annotation("_In_reads_opt_(NumOutputOverrides)")] const D3D12_NODE_OUTPUT_OVERRIDES* pOutputOverrides; +} D3D12_COMMON_COMPUTE_NODE_OVERRIDES; + +typedef enum D3D12_NODE_OVERRIDES_TYPE +{ + D3D12_NODE_OVERRIDES_TYPE_NONE = 0, + D3D12_NODE_OVERRIDES_TYPE_BROADCASTING_LAUNCH = 1, + D3D12_NODE_OVERRIDES_TYPE_COALESCING_LAUNCH = 2, + D3D12_NODE_OVERRIDES_TYPE_THREAD_LAUNCH = 3, + D3D12_NODE_OVERRIDES_TYPE_COMMON_COMPUTE = 4, +} D3D12_NODE_OVERRIDES_TYPE; + +typedef struct D3D12_SHADER_NODE +{ + LPCWSTR Shader; + D3D12_NODE_OVERRIDES_TYPE OverridesType; + union + { + const D3D12_BROADCASTING_LAUNCH_OVERRIDES* pBroadcastingLaunchOverrides; + const D3D12_COALESCING_LAUNCH_OVERRIDES* pCoalescingLaunchOverrides; + const D3D12_THREAD_LAUNCH_OVERRIDES* pThreadLaunchOverrides; + const D3D12_COMMON_COMPUTE_NODE_OVERRIDES* pCommonComputeNodeOverrides; + }; +} D3D12_SHADER_NODE; + +typedef enum D3D12_NODE_TYPE +{ + D3D12_NODE_TYPE_SHADER = 0x0 +} D3D12_NODE_TYPE; + +typedef struct D3D12_NODE +{ + D3D12_NODE_TYPE NodeType; + union + { + D3D12_SHADER_NODE Shader; // D3D12_NODE_TYPE_SHADER + }; +} D3D12_NODE; + +typedef enum D3D12_WORK_GRAPH_FLAGS +{ + D3D12_WORK_GRAPH_FLAG_NONE = 0x0, + D3D12_WORK_GRAPH_FLAG_INCLUDE_ALL_AVAILABLE_NODES = 0x1, +} D3D12_WORK_GRAPH_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_WORK_GRAPH_FLAGS )") + +typedef struct D3D12_WORK_GRAPH_DESC +{ + LPCWSTR ProgramName; + D3D12_WORK_GRAPH_FLAGS Flags; + UINT NumEntrypoints; + [annotation("_In_reads_opt_(NumEntrypoints)")] const D3D12_NODE_ID* pEntrypoints; + UINT NumExplicitlyDefinedNodes; + [annotation("_In_reads_opt_(NumExplicitlyDefinedNodes)")] const D3D12_NODE* pExplicitlyDefinedNodes; +} D3D12_WORK_GRAPH_DESC; + +typedef struct D3D12_GENERIC_PROGRAM_DESC +{ + LPCWSTR ProgramName; + UINT NumExports; + [annotation("_In_reads_(NumExports)")] LPCWSTR* pExports; + UINT NumSubobjects; + [annotation("_In_reads_opt_(NumSubobjects)")] const D3D12_STATE_SUBOBJECT* const* ppSubobjects; +} D3D12_GENERIC_PROGRAM_DESC; + typedef enum D3D12_STATE_OBJECT_TYPE { D3D12_STATE_OBJECT_TYPE_COLLECTION = 0, - // D3D12_STATE_OBJECT_TYPE_COMPUTE_PIPELINE = 1, - // D3D12_STATE_OBJECT_TYPE_GRAPHICS_PIPELINE = 2, D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE = 3, + D3D12_STATE_OBJECT_TYPE_EXECUTABLE = 4 } D3D12_STATE_OBJECT_TYPE; typedef struct D3D12_STATE_OBJECT_DESC @@ -4309,7 +4699,7 @@ typedef enum D3D12_RAYTRACING_GEOMETRY_FLAGS D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE = 0x1, D3D12_RAYTRACING_GEOMETRY_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = 0x2, } D3D12_RAYTRACING_GEOMETRY_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_GEOMETRY_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_GEOMETRY_FLAGS )") typedef enum D3D12_RAYTRACING_GEOMETRY_TYPE { @@ -4325,7 +4715,7 @@ typedef enum D3D12_RAYTRACING_INSTANCE_FLAGS D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE = 0x4, D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_NON_OPAQUE = 0x8 } D3D12_RAYTRACING_INSTANCE_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_INSTANCE_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_INSTANCE_FLAGS )") typedef struct D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE { @@ -4383,7 +4773,7 @@ typedef enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY = 0x10, D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE = 0x20, } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS )") typedef enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE { @@ -4545,7 +4935,7 @@ typedef enum D3D12_RAY_FLAGS D3D12_RAY_FLAG_SKIP_TRIANGLES = 0x100, D3D12_RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200, } D3D12_RAY_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAY_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAY_FLAGS )" ) typedef enum D3D12_HIT_KIND { @@ -4606,24 +4996,24 @@ interface ID3D12Device5 typedef enum D3D12_AUTO_BREADCRUMB_OP { - D3D12_AUTO_BREADCRUMB_OP_SETMARKER = 0, - D3D12_AUTO_BREADCRUMB_OP_BEGINEVENT = 1, - D3D12_AUTO_BREADCRUMB_OP_ENDEVENT = 2, + D3D12_AUTO_BREADCRUMB_OP_SETMARKER = 0, + D3D12_AUTO_BREADCRUMB_OP_BEGINEVENT = 1, + D3D12_AUTO_BREADCRUMB_OP_ENDEVENT = 2, D3D12_AUTO_BREADCRUMB_OP_DRAWINSTANCED = 3, D3D12_AUTO_BREADCRUMB_OP_DRAWINDEXEDINSTANCED = 4, D3D12_AUTO_BREADCRUMB_OP_EXECUTEINDIRECT = 5, - D3D12_AUTO_BREADCRUMB_OP_DISPATCH = 6, + D3D12_AUTO_BREADCRUMB_OP_DISPATCH = 6, D3D12_AUTO_BREADCRUMB_OP_COPYBUFFERREGION = 7, D3D12_AUTO_BREADCRUMB_OP_COPYTEXTUREREGION = 8, D3D12_AUTO_BREADCRUMB_OP_COPYRESOURCE = 9, - D3D12_AUTO_BREADCRUMB_OP_COPYTILES = 10, + D3D12_AUTO_BREADCRUMB_OP_COPYTILES = 10, D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCE = 11, D3D12_AUTO_BREADCRUMB_OP_CLEARRENDERTARGETVIEW = 12, D3D12_AUTO_BREADCRUMB_OP_CLEARUNORDEREDACCESSVIEW = 13, D3D12_AUTO_BREADCRUMB_OP_CLEARDEPTHSTENCILVIEW = 14, D3D12_AUTO_BREADCRUMB_OP_RESOURCEBARRIER = 15, D3D12_AUTO_BREADCRUMB_OP_EXECUTEBUNDLE = 16, - D3D12_AUTO_BREADCRUMB_OP_PRESENT = 17, + D3D12_AUTO_BREADCRUMB_OP_PRESENT = 17, D3D12_AUTO_BREADCRUMB_OP_RESOLVEQUERYDATA = 18, D3D12_AUTO_BREADCRUMB_OP_BEGINSUBMISSION = 19, D3D12_AUTO_BREADCRUMB_OP_ENDSUBMISSION = 20, @@ -4651,6 +5041,10 @@ typedef enum D3D12_AUTO_BREADCRUMB_OP D3D12_AUTO_BREADCRUMB_OP_DISPATCHMESH = 42, D3D12_AUTO_BREADCRUMB_OP_ENCODEFRAME = 43, D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA = 44, + D3D12_AUTO_BREADCRUMB_OP_BARRIER = 45, + D3D12_AUTO_BREADCRUMB_OP_BEGIN_COMMAND_LIST = 46, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHGRAPH = 47, + D3D12_AUTO_BREADCRUMB_OP_SETPROGRAM = 48, } D3D12_AUTO_BREADCRUMB_OP; typedef struct D3D12_AUTO_BREADCRUMB_NODE @@ -4705,7 +5099,7 @@ typedef enum D3D12_DRED_FLAGS D3D12_DRED_FLAG_FORCE_ENABLE = 1, D3D12_DRED_FLAG_DISABLE_AUTOBREADCRUMBS = 2, } D3D12_DRED_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_FLAGS )") typedef enum D3D12_DRED_ENABLEMENT { @@ -4801,7 +5195,7 @@ typedef enum D3D12_DRED_PAGE_FAULT_FLAGS { D3D12_DRED_PAGE_FAULT_FLAGS_NONE = 0, } D3D12_DRED_PAGE_FAULT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_PAGE_FAULT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_PAGE_FAULT_FLAGS )") typedef enum D3D12_DRED_DEVICE_STATE { @@ -5038,6 +5432,7 @@ interface ID3D12Resource2 } + [uuid(572F7389-2168-49E3-9693-D6DF5871BF6D), object, local, pointer_default(unique)] interface ID3D12Heap1 : ID3D12Heap @@ -5062,7 +5457,10 @@ typedef enum D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD, D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE, D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR, - D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS, + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER, + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_SRV, + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_UAV } D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE; typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS @@ -5070,6 +5468,12 @@ typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS D3D12_CLEAR_VALUE ClearValue; } D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS; +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS +{ + UINT AdditionalWidth; + UINT AdditionalHeight; +} D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS; + typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS { D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE Type; @@ -5077,6 +5481,7 @@ typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS union { D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS Clear; + D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS PreserveLocal; }; } D3D12_RENDER_PASS_BEGINNING_ACCESS; @@ -5086,7 +5491,10 @@ typedef enum D3D12_RENDER_PASS_ENDING_ACCESS_TYPE D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD, D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE, D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE, - D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS, + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER, + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_SRV, + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_UAV } D3D12_RENDER_PASS_ENDING_ACCESS_TYPE; typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS @@ -5116,6 +5524,12 @@ typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS } D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS; +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS +{ + UINT AdditionalWidth; + UINT AdditionalHeight; +} D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS; + typedef struct D3D12_RENDER_PASS_ENDING_ACCESS { D3D12_RENDER_PASS_ENDING_ACCESS_TYPE Type; @@ -5123,6 +5537,7 @@ typedef struct D3D12_RENDER_PASS_ENDING_ACCESS union { D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS Resolve; + D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS PreserveLocal; }; } D3D12_RENDER_PASS_ENDING_ACCESS; @@ -5149,15 +5564,16 @@ typedef struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC } D3D12_RENDER_PASS_DEPTH_STENCIL_DESC; -// UAV Access Mode typedef enum D3D12_RENDER_PASS_FLAGS { - D3D12_RENDER_PASS_FLAG_NONE = 0x0, - D3D12_RENDER_PASS_FLAG_ALLOW_UAV_WRITES = 0x1, - D3D12_RENDER_PASS_FLAG_SUSPENDING_PASS = 0x2, - D3D12_RENDER_PASS_FLAG_RESUMING_PASS = 0x4 + D3D12_RENDER_PASS_FLAG_NONE = 0x0, + D3D12_RENDER_PASS_FLAG_ALLOW_UAV_WRITES = 0x1, + D3D12_RENDER_PASS_FLAG_SUSPENDING_PASS = 0x2, + D3D12_RENDER_PASS_FLAG_RESUMING_PASS = 0x4, + D3D12_RENDER_PASS_FLAG_BIND_READ_ONLY_DEPTH = 0x8, + D3D12_RENDER_PASS_FLAG_BIND_READ_ONLY_STENCIL = 0x10 } D3D12_RENDER_PASS_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RENDER_PASS_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_RENDER_PASS_FLAGS )") [uuid(DBB84C27-36CE-4FC9-B801-F048C46AC570), object, local, pointer_default(unique)] interface ID3D12MetaCommand : ID3D12Pageable @@ -5176,6 +5592,97 @@ typedef struct D3D12_DISPATCH_RAYS_DESC UINT Depth; } D3D12_DISPATCH_RAYS_DESC; +typedef enum D3D12_SET_WORK_GRAPH_FLAGS +{ + D3D12_SET_WORK_GRAPH_FLAG_NONE = 0x0, + D3D12_SET_WORK_GRAPH_FLAG_INITIALIZE = 0x1, +} D3D12_SET_WORK_GRAPH_FLAGS; +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_SET_WORK_GRAPH_FLAGS )" ) + +typedef struct D3D12_SET_WORK_GRAPH_DESC +{ + D3D12_PROGRAM_IDENTIFIER ProgramIdentifier; + D3D12_SET_WORK_GRAPH_FLAGS Flags; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE BackingMemory; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE NodeLocalRootArgumentsTable; +} D3D12_SET_WORK_GRAPH_DESC; + +typedef struct D3D12_SET_RAYTRACING_PIPELINE_DESC +{ + D3D12_PROGRAM_IDENTIFIER ProgramIdentifier; +} D3D12_SET_RAYTRACING_PIPELINE_DESC; + +typedef struct D3D12_SET_GENERIC_PIPELINE_DESC +{ + D3D12_PROGRAM_IDENTIFIER ProgramIdentifier; +} D3D12_SET_GENERIC_PIPELINE_DESC; + +typedef enum D3D12_PROGRAM_TYPE +{ + D3D12_PROGRAM_TYPE_GENERIC_PIPELINE = 1, + D3D12_PROGRAM_TYPE_RAYTRACING_PIPELINE = 4, + D3D12_PROGRAM_TYPE_WORK_GRAPH = 5 +} D3D12_PROGRAM_TYPE; + +typedef struct D3D12_SET_PROGRAM_DESC +{ + D3D12_PROGRAM_TYPE Type; + union + { + D3D12_SET_GENERIC_PIPELINE_DESC GenericPipeline; + D3D12_SET_RAYTRACING_PIPELINE_DESC RaytracingPipeline; + D3D12_SET_WORK_GRAPH_DESC WorkGraph; + }; +} D3D12_SET_PROGRAM_DESC; + +typedef enum D3D12_DISPATCH_MODE +{ + D3D12_DISPATCH_MODE_NODE_CPU_INPUT = 0, // D3D12_NODE_CPU_INPUT + D3D12_DISPATCH_MODE_NODE_GPU_INPUT = 1, // D3D12_NODE_GPU_INPUT in GPU memory + D3D12_DISPATCH_MODE_MULTI_NODE_CPU_INPUT = 2, // D3D12_MULTI_NODE_CPU_INPUT + D3D12_DISPATCH_MODE_MULTI_NODE_GPU_INPUT = 3 // D3D12_MULTI_NODE_GPU_INPUT in GPU memory +} D3D12_DISPATCH_MODE; + +typedef struct D3D12_NODE_CPU_INPUT +{ + UINT EntrypointIndex; + UINT NumRecords; + const void* pRecords; + UINT64 RecordStrideInBytes; +} D3D12_NODE_CPU_INPUT; + +typedef struct D3D12_NODE_GPU_INPUT +{ + UINT EntrypointIndex; + UINT NumRecords; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE Records; +} D3D12_NODE_GPU_INPUT; + +typedef struct D3D12_MULTI_NODE_CPU_INPUT +{ + UINT NumNodeInputs; + const D3D12_NODE_CPU_INPUT* pNodeInputs; + UINT64 NodeInputStrideInBytes; +} D3D12_MULTI_NODE_CPU_INPUT; + +typedef struct D3D12_MULTI_NODE_GPU_INPUT +{ + UINT NumNodeInputs; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE NodeInputs; // D3D12_GPU_NODE_INPUT array +} D3D12_MULTI_NODE_GPU_INPUT; + +typedef struct D3D12_DISPATCH_GRAPH_DESC +{ + D3D12_DISPATCH_MODE Mode; + union + { + D3D12_NODE_CPU_INPUT NodeCPUInput; + D3D12_GPU_VIRTUAL_ADDRESS NodeGPUInput; + D3D12_MULTI_NODE_CPU_INPUT MultiNodeCPUInput; + D3D12_GPU_VIRTUAL_ADDRESS MultiNodeGPUInput; + }; +} D3D12_DISPATCH_GRAPH_DESC; + [uuid(8754318e-d3a9-4541-98cf-645b50dc4874), object, local, pointer_default(unique)] interface ID3D12GraphicsCommandList4 : ID3D12GraphicsCommandList3 { @@ -5235,7 +5742,7 @@ typedef enum D3D12_SHADER_CACHE_FLAGS D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED = 0x1, D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR = 0x2, } D3D12_SHADER_CACHE_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_FLAGS )") typedef struct D3D12_SHADER_CACHE_SESSION_DESC { @@ -5316,7 +5823,7 @@ typedef enum D3D12_BARRIER_SYNC D3D12_BARRIER_SYNC_COPY_RAYTRACING_ACCELERATION_STRUCTURE = 0x1000000, D3D12_BARRIER_SYNC_SPLIT = 0x80000000, } D3D12_BARRIER_SYNC; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_SYNC );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_SYNC )" ) typedef enum D3D12_BARRIER_ACCESS { @@ -5347,7 +5854,7 @@ typedef enum D3D12_BARRIER_ACCESS D3D12_BARRIER_ACCESS_VIDEO_ENCODE_WRITE = 0x400000, D3D12_BARRIER_ACCESS_NO_ACCESS = 0x80000000, } D3D12_BARRIER_ACCESS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_ACCESS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_ACCESS )" ) typedef enum D3D12_BARRIER_TYPE { @@ -5361,7 +5868,7 @@ typedef enum D3D12_TEXTURE_BARRIER_FLAGS D3D12_TEXTURE_BARRIER_FLAG_NONE = 0x0, D3D12_TEXTURE_BARRIER_FLAG_DISCARD = 0x1, } D3D12_TEXTURE_BARRIER_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_TEXTURE_BARRIER_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_TEXTURE_BARRIER_FLAGS )") typedef struct D3D12_BARRIER_SUBRESOURCE_RANGE { @@ -5443,7 +5950,7 @@ typedef enum D3D12_SHADER_CACHE_KIND_FLAGS D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_DRIVER_MANAGED = 0x4, D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED = 0x8, } D3D12_SHADER_CACHE_KIND_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_KIND_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_KIND_FLAGS )") typedef enum D3D12_SHADER_CACHE_CONTROL_FLAGS { @@ -5451,7 +5958,7 @@ typedef enum D3D12_SHADER_CACHE_CONTROL_FLAGS D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE = 0x2, D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR = 0x4, } D3D12_SHADER_CACHE_CONTROL_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_CONTROL_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_CONTROL_FLAGS )") [uuid(4c80e962-f032-4f60-bc9e-ebc2cfa1d83c), object, local, pointer_default(unique)] interface ID3D12Device9 @@ -5474,15 +5981,6 @@ interface ID3D12Device9 ); }; -[uuid(5405c344-d457-444e-b4dd-2366e45aee39), object, local, pointer_default(unique)] -interface ID3D12Device11 - : ID3D12Device10 -{ - void CreateSampler2( - [annotation("_In_")] const D3D12_SAMPLER_DESC2* pDesc, - [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); -}; - [uuid(517f8718-aa66-49f9-b02b-a7ab89c06031), object, local, pointer_default(unique)] interface ID3D12Device10 : ID3D12Device9 @@ -5495,7 +5993,7 @@ interface ID3D12Device10 [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, [annotation("_In_opt_")] ID3D12ProtectedResourceSession* pProtectedSession, UINT32 NumCastableFormats, - [annotation("_In_opt_count_(NumCastableFormats)")] DXGI_FORMAT *pCastableFormats, + [annotation("_In_opt_count_(NumCastableFormats)")] const DXGI_FORMAT *pCastableFormats, [in] REFIID riidResource, // Expected: ID3D12Resource1* [out, iid_is(riidResource), annotation("_COM_Outptr_opt_")] void** ppvResource); @@ -5506,7 +6004,7 @@ interface ID3D12Device10 D3D12_BARRIER_LAYOUT InitialLayout, [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, UINT32 NumCastableFormats, - [annotation("_In_opt_count_(NumCastableFormats)")] DXGI_FORMAT *pCastableFormats, + [annotation("_In_opt_count_(NumCastableFormats)")] const DXGI_FORMAT *pCastableFormats, [in] REFIID riid, // Expected: ID3D12Resource* [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvResource); @@ -5516,12 +6014,59 @@ interface ID3D12Device10 [annotation("_In_opt_")] const D3D12_CLEAR_VALUE* pOptimizedClearValue, [annotation("_In_opt_")] ID3D12ProtectedResourceSession *pProtectedSession, UINT32 NumCastableFormats, - [annotation("_In_opt_count_(NumCastableFormats)")] DXGI_FORMAT *pCastableFormats, + [annotation("_In_opt_count_(NumCastableFormats)")] const DXGI_FORMAT *pCastableFormats, [in] REFIID riid, // Expected: ID3D12Resource1* [out, iid_is(riid), annotation("_COM_Outptr_opt_")] void** ppvResource ); }; +[uuid(5405c344-d457-444e-b4dd-2366e45aee39), object, local, pointer_default(unique)] +interface ID3D12Device11 + : ID3D12Device10 +{ + void CreateSampler2( + [annotation("_In_")] const D3D12_SAMPLER_DESC2* pDesc, + [annotation("_In_")] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); +}; + +[uuid(5af5c532-4c91-4cd0-b541-15a405395fc5), object, local, pointer_default(unique)] +interface ID3D12Device12 + : ID3D12Device11 +{ + D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo3( + UINT visibleMask, + UINT numResourceDescs, + [annotation("_In_reads_(numResourceDescs)")] const D3D12_RESOURCE_DESC1* pResourceDescs, + [annotation("_In_opt_count_(numResourceDescs)")] const UINT32* pNumCastableFormats, + [annotation("_In_opt_count_(numResourceDescs)")] const DXGI_FORMAT *const *ppCastableFormats, + [annotation("_Out_writes_opt_(numResourceDescs)")] D3D12_RESOURCE_ALLOCATION_INFO1* pResourceAllocationInfo1); +}; + +[uuid(14eecffc-4df8-40f7-a118-5c816f45695e), object, local, pointer_default(unique)] +interface ID3D12Device13 + : ID3D12Device12 +{ + HRESULT OpenExistingHeapFromAddress1( + [annotation("_In_")] const void* pAddress, + SIZE_T size, + [in] REFIID riid, // Expected: ID3D12Heap + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppvHeap + ); +}; + +[uuid(5f6e592d-d895-44c2-8e4a-88ad4926d323), object, local, pointer_default(unique)] +interface ID3D12Device14 : ID3D12Device13 +{ + HRESULT CreateRootSignatureFromSubobjectInLibrary( + [annotation("_In_")] UINT nodeMask, + [annotation("_In_reads_(blobLengthInBytes)")] const void* pLibraryBlob, + [annotation("_In_")] SIZE_T blobLengthInBytes, + [annotation("_In_opt_")] LPCWSTR subobjectName, + [in] REFIID riid, // Expected ID3D12RootSignature + [out, iid_is(riid), annotation("_COM_Outptr_")] void** ppvRootSignature); +}; + + [uuid(bc66d368-7373-4943-8757-fc87dc79e476), object, local, pointer_default(unique)] interface ID3D12VirtualizationGuestDevice : IUnknown @@ -5539,7 +6084,6 @@ interface ID3D12VirtualizationGuestDevice }; - [uuid(7071e1f0-e84b-4b33-974f-12fa49de65c5), object, local, pointer_default(unique)] interface ID3D12Tools : IUnknown @@ -5548,6 +6092,7 @@ interface ID3D12Tools BOOL ShaderInstrumentationEnabled(); } + typedef struct D3D12_SUBRESOURCE_DATA { const void* pData; @@ -5722,7 +6267,7 @@ typedef enum D3D12_DEVICE_FACTORY_FLAGS D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_INCOMPATIBLE_EXISTING_DEVICE = 0x2, D3D12_DEVICE_FACTORY_FLAG_DISALLOW_STORING_NEW_DEVICE_AS_SINGLETON = 0x4, } D3D12_DEVICE_FACTORY_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FACTORY_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FACTORY_FLAGS )") [uuid(61f307d3-d34e-4e7c-8374-3ba4de23cccb), object, local, pointer_default(unique)] interface ID3D12DeviceFactory @@ -5767,7 +6312,7 @@ typedef enum D3D12_DEVICE_FLAGS D3D12_DEVICE_FLAG_AUTO_DEBUG_NAME_ENABLED = 0x200, D3D12_DEVICE_FLAG_FORCE_LEGACY_STATE_VALIDATION = 0x400, } D3D12_DEVICE_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FLAGS )") typedef struct D3D12_DEVICE_CONFIGURATION_DESC { @@ -5796,6 +6341,18 @@ interface ID3D12DeviceConfiguration [annotation("_COM_Outptr_")] void **ppvDeserializer); }; +[uuid(ed342442-6343-4e16-bb82-a3a577874e56), object, local, pointer_default(unique)] +interface ID3D12DeviceConfiguration1 + : ID3D12DeviceConfiguration +{ + HRESULT CreateVersionedRootSignatureDeserializerFromSubobjectInLibrary( + [annotation("_In_reads_bytes_(Size)")] const void* pLibraryBlob, + SIZE_T Size, + LPCWSTR RootSignatureSubobjectName, + REFIID riid, + [annotation("_COM_Outptr_")] void** ppvDeserializer); +}; + typedef enum D3D12_AXIS_SHADING_RATE { @@ -5893,6 +6450,31 @@ interface ID3D12GraphicsCommandList9 : ID3D12GraphicsCommandList8 ); }; +[uuid(7013c015-d161-4b63-a08c-238552dd8acc), object, local, pointer_default(unique)] +interface ID3D12GraphicsCommandList10 : ID3D12GraphicsCommandList9 +{ + void SetProgram([annotation("_In_")] const D3D12_SET_PROGRAM_DESC* pDesc); + void DispatchGraph([annotation("_In_")] const D3D12_DISPATCH_GRAPH_DESC* pDesc); +}; + + + +[uuid(597985ab-9b75-4dbb-be23-0761195bebee), object, local, pointer_default(unique)] +interface ID3D12GBVDiagnostics + : IUnknown +{ + HRESULT GetGBVEntireSubresourceStatesData( [annotation("_In_")] ID3D12Resource* pResource, [annotation("_Out_writes_bytes_(DataSize)")] int *pData, UINT DataSize ); + HRESULT GetGBVSubresourceState( [annotation("_In_")] ID3D12Resource* pResource, UINT Subresource, [annotation("_Out_")] int *pData ); + HRESULT GetGBVResourceUniformState( [annotation("_In_")] ID3D12Resource* pResource, [annotation("_Out_")] int *pData ); + HRESULT GetGBVResourceInfo( [annotation("_In_")] ID3D12Resource* pResource, + [annotation("_In_opt_")] D3D12_RESOURCE_DESC* pResourceDesc, + [annotation("_In_opt_")] UINT32* pResourceHash, + [annotation("_In_opt_")] UINT32* pSubresourceStatesByteOffset ); + + void GBVReserved0(); + + void GBVReserved1(); +} //---------------------------------------------------------------------------------------------------------- // Old types which are still supported by the runtime for app-compat @@ -5934,6 +6516,8 @@ cpp_quote( "DEFINE_GUID(IID_ID3D12SwapChainAssistant,0xf1df64b6,0x57fd,0x49cd,0x cpp_quote( "DEFINE_GUID(IID_ID3D12LifetimeTracker,0x3fd03d36,0x4eb1,0x424a,0xa5,0x82,0x49,0x4e,0xcb,0x8b,0xa8,0x13);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12StateObject,0x47016943,0xfca8,0x4594,0x93,0xea,0xaf,0x25,0x8b,0x55,0x34,0x6d);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12StateObjectProperties,0xde5fa827,0x9bf9,0x4f26,0x89,0xff,0xd7,0xf5,0x6f,0xde,0x38,0x60);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12StateObjectProperties1,0x460caac7,0x1d24,0x446a,0xa1,0x84,0xca,0x67,0xdb,0x49,0x41,0x38);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12WorkGraphProperties,0x065acf71,0xf863,0x4b89,0x82,0xf4,0x02,0xe4,0xd5,0x88,0x67,0x57);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12Device5,0x8b4f173b,0x2fea,0x4b80,0x8f,0x58,0x43,0x07,0x19,0x1a,0xb9,0x5d);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings,0x82BC481C,0x6B9B,0x4030,0xAE,0xDB,0x7E,0xE3,0xD1,0xDF,0x1E,0x63);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings1,0xDBD5AE51,0x3317,0x4F0A,0xAD,0xF9,0x1D,0x7C,0xED,0xCA,0xAE,0x0B);" ) @@ -5955,14 +6539,20 @@ cpp_quote( "DEFINE_GUID(IID_ID3D12ShaderCacheSession,0x28e2495d,0x0f64,0x4ae4,0x cpp_quote( "DEFINE_GUID(IID_ID3D12Device9,0x4c80e962,0xf032,0x4f60,0xbc,0x9e,0xeb,0xc2,0xcf,0xa1,0xd8,0x3c);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12Device10,0x517f8718,0xaa66,0x49f9,0xb0,0x2b,0xa7,0xab,0x89,0xc0,0x60,0x31);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12Device11,0x5405c344,0xd457,0x444e,0xb4,0xdd,0x23,0x66,0xe4,0x5a,0xee,0x39);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device12,0x5af5c532,0x4c91,0x4cd0,0xb5,0x41,0x15,0xa4,0x05,0x39,0x5f,0xc5);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device13,0x14eecffc,0x4df8,0x40f7,0xa1,0x18,0x5c,0x81,0x6f,0x45,0x69,0x5e);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12Device14,0x5f6e592d,0xd895,0x44c2,0x8e,0x4a,0x88,0xad,0x49,0x26,0xd3,0x23);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12VirtualizationGuestDevice,0xbc66d368,0x7373,0x4943,0x87,0x57,0xfc,0x87,0xdc,0x79,0xe4,0x76);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12Tools,0x7071e1f0,0xe84b,0x4b33,0x97,0x4f,0x12,0xfa,0x49,0xde,0x65,0xc5);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12SDKConfiguration,0xe9eb5314,0x33aa,0x42b2,0xa7,0x18,0xd7,0x7f,0x58,0xb1,0xf1,0xc7);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12SDKConfiguration1,0x8aaf9303,0xad25,0x48b9,0x9a,0x57,0xd9,0xc3,0x7e,0x00,0x9d,0x9f);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceFactory,0x61f307d3,0xd34e,0x4e7c,0x83,0x74,0x3b,0xa4,0xde,0x23,0xcc,0xcb);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceConfiguration,0x78dbf87b,0xf766,0x422b,0xa6,0x1c,0xc8,0xc4,0x46,0xbd,0xb9,0xad);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12DeviceConfiguration1,0xed342442,0x6343,0x4e16,0xbb,0x82,0xa3,0xa5,0x77,0x87,0x4e,0x56);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList5,0x55050859,0x4024,0x474c,0x87,0xf5,0x64,0x72,0xea,0xee,0x44,0xea);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList6,0xc3827890,0xe548,0x4cfa,0x96,0xcf,0x56,0x89,0xa9,0x37,0x0f,0x80);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList7,0xdd171223,0x8b61,0x4769,0x90,0xe3,0x16,0x0c,0xcd,0xe4,0xe2,0xc1);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList8,0xee936ef9,0x599d,0x4d28,0x93,0x8e,0x23,0xc4,0xad,0x05,0xce,0x51);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList9,0x34ed2808,0xffe6,0x4c2b,0xb1,0x1a,0xca,0xbd,0x2b,0x0c,0x59,0xe1);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GraphicsCommandList10,0x7013c015,0xd161,0x4b63,0xa0,0x8c,0x23,0x85,0x52,0xdd,0x8a,0xcc);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12GBVDiagnostics,0x597985ab,0x9b75,0x4dbb,0xbe,0x23,0x07,0x61,0x19,0x5b,0xeb,0xee);" ) diff --git a/deps/DirectX-Headers/include/directx/d3d12compatibility.h b/deps/DirectX-Headers/include/directx/d3d12compatibility.h index 6322c6f..98eb3b5 100644 --- a/deps/DirectX-Headers/include/directx/d3d12compatibility.h +++ b/deps/DirectX-Headers/include/directx/d3d12compatibility.h @@ -87,6 +87,13 @@ typedef interface OpenCLOn12CreatorID OpenCLOn12CreatorID; #endif /* __OpenCLOn12CreatorID_FWD_DEFINED__ */ +#ifndef __VulkanOn12CreatorID_FWD_DEFINED__ +#define __VulkanOn12CreatorID_FWD_DEFINED__ +typedef interface VulkanOn12CreatorID VulkanOn12CreatorID; + +#endif /* __VulkanOn12CreatorID_FWD_DEFINED__ */ + + #ifndef __DirectMLTensorFlowCreatorID_FWD_DEFINED__ #define __DirectMLTensorFlowCreatorID_FWD_DEFINED__ typedef interface DirectMLTensorFlowCreatorID DirectMLTensorFlowCreatorID; @@ -126,7 +133,7 @@ enum D3D12_COMPATIBILITY_SHARED_FLAGS D3D12_COMPATIBILITY_SHARED_FLAG_9_ON_12 = 0x4 } D3D12_COMPATIBILITY_SHARED_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS ) typedef enum D3D12_REFLECT_SHARED_PROPERTY { @@ -565,6 +572,78 @@ EXTERN_C const IID IID_OpenCLOn12CreatorID; #endif /* __OpenCLOn12CreatorID_INTERFACE_DEFINED__ */ +#ifndef __VulkanOn12CreatorID_INTERFACE_DEFINED__ +#define __VulkanOn12CreatorID_INTERFACE_DEFINED__ + +/* interface VulkanOn12CreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_VulkanOn12CreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("bc806e01-3052-406c-a3e8-9fc07f048f98") + VulkanOn12CreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct VulkanOn12CreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + VulkanOn12CreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + VulkanOn12CreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + VulkanOn12CreatorID * This); + + END_INTERFACE + } VulkanOn12CreatorIDVtbl; + + interface VulkanOn12CreatorID + { + CONST_VTBL struct VulkanOn12CreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define VulkanOn12CreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define VulkanOn12CreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define VulkanOn12CreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __VulkanOn12CreatorID_INTERFACE_DEFINED__ */ + + #ifndef __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ #define __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ @@ -709,7 +788,7 @@ EXTERN_C const IID IID_DirectMLPyTorchCreatorID; #endif /* __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_d3d12compatibility_0000_0007 */ +/* interface __MIDL_itf_d3d12compatibility_0000_0008 */ /* [local] */ #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ @@ -719,12 +798,13 @@ DEFINE_GUID(IID_D3D11On12CreatorID,0xedbf5678,0x2960,0x4e81,0x84,0x29,0x99,0xd4, DEFINE_GUID(IID_D3D9On12CreatorID,0xfffcbb7f,0x15d3,0x42a2,0x84,0x1e,0x9d,0x8d,0x32,0xf3,0x7d,0xdd); DEFINE_GUID(IID_OpenGLOn12CreatorID,0x6bb3cd34,0x0d19,0x45ab,0x97,0xed,0xd7,0x20,0xba,0x3d,0xfc,0x80); DEFINE_GUID(IID_OpenCLOn12CreatorID,0x3f76bb74,0x91b5,0x4a88,0xb1,0x26,0x20,0xca,0x03,0x31,0xcd,0x60); +DEFINE_GUID(IID_VulkanOn12CreatorID,0xbc806e01,0x3052,0x406c,0xa3,0xe8,0x9f,0xc0,0x7f,0x04,0x8f,0x98); DEFINE_GUID(IID_DirectMLTensorFlowCreatorID,0xcb7490ac,0x8a0f,0x44ec,0x9b,0x7b,0x6f,0x4c,0xaf,0xe8,0xe9,0xab); DEFINE_GUID(IID_DirectMLPyTorchCreatorID,0xaf029192,0xfba1,0x4b05,0x91,0x16,0x23,0x5e,0x06,0x56,0x03,0x54); -extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0008_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0008_v0_0_s_ifspec; /* Additional Prototypes for ALL interfaces */ diff --git a/deps/DirectX-Headers/include/directx/d3d12compatibility.idl b/deps/DirectX-Headers/include/directx/d3d12compatibility.idl index d0be70a..37f2b14 100644 --- a/deps/DirectX-Headers/include/directx/d3d12compatibility.idl +++ b/deps/DirectX-Headers/include/directx/d3d12compatibility.idl @@ -22,7 +22,7 @@ typedef enum D3D12_COMPATIBILITY_SHARED_FLAGS D3D12_COMPATIBILITY_SHARED_FLAG_9_ON_12 = 0x4, } D3D12_COMPATIBILITY_SHARED_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS )" ) typedef enum D3D12_REFLECT_SHARED_PROPERTY { @@ -73,6 +73,9 @@ interface OpenGLOn12CreatorID : IUnknown { }; [uuid(3f76bb74-91b5-4a88-b126-20ca0331cd60), object, local, pointer_default(unique)] interface OpenCLOn12CreatorID : IUnknown { }; +[uuid(bc806e01-3052-406c-a3e8-9fc07f048f98), object, local, pointer_default(unique)] +interface VulkanOn12CreatorID : IUnknown { }; + [uuid(cb7490ac-8a0f-44ec-9b7b-6f4cafe8e9ab), object, local, pointer_default(unique)] interface DirectMLTensorFlowCreatorID : IUnknown { }; @@ -88,5 +91,6 @@ cpp_quote( "DEFINE_GUID(IID_D3D11On12CreatorID,0xedbf5678,0x2960,0x4e81,0x84,0x2 cpp_quote( "DEFINE_GUID(IID_D3D9On12CreatorID,0xfffcbb7f,0x15d3,0x42a2,0x84,0x1e,0x9d,0x8d,0x32,0xf3,0x7d,0xdd);" ) cpp_quote( "DEFINE_GUID(IID_OpenGLOn12CreatorID,0x6bb3cd34,0x0d19,0x45ab,0x97,0xed,0xd7,0x20,0xba,0x3d,0xfc,0x80);" ) cpp_quote( "DEFINE_GUID(IID_OpenCLOn12CreatorID,0x3f76bb74,0x91b5,0x4a88,0xb1,0x26,0x20,0xca,0x03,0x31,0xcd,0x60);" ) +cpp_quote( "DEFINE_GUID(IID_VulkanOn12CreatorID,0xbc806e01,0x3052,0x406c,0xa3,0xe8,0x9f,0xc0,0x7f,0x04,0x8f,0x98);" ) cpp_quote( "DEFINE_GUID(IID_DirectMLTensorFlowCreatorID,0xcb7490ac,0x8a0f,0x44ec,0x9b,0x7b,0x6f,0x4c,0xaf,0xe8,0xe9,0xab);" ) cpp_quote( "DEFINE_GUID(IID_DirectMLPyTorchCreatorID,0xaf029192,0xfba1,0x4b05,0x91,0x16,0x23,0x5e,0x06,0x56,0x03,0x54);" ) diff --git a/deps/DirectX-Headers/include/directx/d3d12sdklayers.h b/deps/DirectX-Headers/include/directx/d3d12sdklayers.h index 167f74e..8d96be6 100644 --- a/deps/DirectX-Headers/include/directx/d3d12sdklayers.h +++ b/deps/DirectX-Headers/include/directx/d3d12sdklayers.h @@ -171,6 +171,13 @@ typedef interface ID3D12SharingContract ID3D12SharingContract; #endif /* __ID3D12SharingContract_FWD_DEFINED__ */ +#ifndef __ID3D12ManualWriteTrackingResource_FWD_DEFINED__ +#define __ID3D12ManualWriteTrackingResource_FWD_DEFINED__ +typedef interface ID3D12ManualWriteTrackingResource ID3D12ManualWriteTrackingResource; + +#endif /* __ID3D12ManualWriteTrackingResource_FWD_DEFINED__ */ + + #ifndef __ID3D12InfoQueue_FWD_DEFINED__ #define __ID3D12InfoQueue_FWD_DEFINED__ typedef interface ID3D12InfoQueue ID3D12InfoQueue; @@ -2237,7 +2244,92 @@ EXTERN_C const IID IID_ID3D12SharingContract; #endif /* __ID3D12SharingContract_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_d3d12sdklayers_0000_0017 */ +#ifndef __ID3D12ManualWriteTrackingResource_INTERFACE_DEFINED__ +#define __ID3D12ManualWriteTrackingResource_INTERFACE_DEFINED__ + +/* interface ID3D12ManualWriteTrackingResource */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ManualWriteTrackingResource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("86ca3b85-49ad-4b6e-aed5-eddb18540f41") + ID3D12ManualWriteTrackingResource : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE TrackWrite( + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ManualWriteTrackingResourceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ManualWriteTrackingResource * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ManualWriteTrackingResource * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ManualWriteTrackingResource * This); + + DECLSPEC_XFGVIRT(ID3D12ManualWriteTrackingResource, TrackWrite) + void ( STDMETHODCALLTYPE *TrackWrite )( + ID3D12ManualWriteTrackingResource * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange); + + END_INTERFACE + } ID3D12ManualWriteTrackingResourceVtbl; + + interface ID3D12ManualWriteTrackingResource + { + CONST_VTBL struct ID3D12ManualWriteTrackingResourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ManualWriteTrackingResource_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ManualWriteTrackingResource_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ManualWriteTrackingResource_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ManualWriteTrackingResource_TrackWrite(This,Subresource,pWrittenRange) \ + ( (This)->lpVtbl -> TrackWrite(This,Subresource,pWrittenRange) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ManualWriteTrackingResource_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0018 */ /* [local] */ typedef @@ -2375,6 +2467,9 @@ enum D3D12_MESSAGE_ID D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = 115, D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = 116, D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = 117, + D3D12_MESSAGE_ID_GET_PROGRAM_IDENTIFIER_ERROR = 118, + D3D12_MESSAGE_ID_GET_WORK_GRAPH_PROPERTIES_ERROR = 119, + D3D12_MESSAGE_ID_SET_PROGRAM_ERROR = 120, D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = 135, D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = 200, D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH = 201, @@ -3200,8 +3295,58 @@ enum D3D12_MESSAGE_ID D3D12_MESSAGE_ID_DYNAMIC_DEPTH_BIAS_NO_PIPELINE = 1367, D3D12_MESSAGE_ID_DYNAMIC_INDEX_BUFFER_STRIP_CUT_FLAG_MISSING = 1368, D3D12_MESSAGE_ID_DYNAMIC_INDEX_BUFFER_STRIP_CUT_NO_PIPELINE = 1369, + D3D12_MESSAGE_ID_NONNORMALIZED_COORDINATE_SAMPLING_NOT_SUPPORTED = 1370, D3D12_MESSAGE_ID_INVALID_CAST_TARGET = 1371, - D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_INVALID_CAST_TARGET + 1 ) + D3D12_MESSAGE_ID_RENDER_PASS_COMMANDLIST_INVALID_END_STATE = 1372, + D3D12_MESSAGE_ID_RENDER_PASS_COMMANDLIST_INVALID_START_STATE = 1373, + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_ACCESS = 1374, + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_LOCAL_PRESERVE_PARAMETERS = 1375, + D3D12_MESSAGE_ID_RENDER_PASS_LOCAL_PRESERVE_RENDER_PARAMETERS_ERROR = 1376, + D3D12_MESSAGE_ID_RENDER_PASS_LOCAL_DEPTH_STENCIL_ERROR = 1377, + D3D12_MESSAGE_ID_DRAW_POTENTIALLY_OUTSIDE_OF_VALID_RENDER_AREA = 1378, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_LINERASTERIZATIONMODE = 1379, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT_SMALLRESOURCE = 1380, + D3D12_MESSAGE_ID_GENERIC_DEVICE_OPERATION_UNSUPPORTED = 1381, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDER_TARGET_WRONG_WRITE_MASK = 1382, + D3D12_MESSAGE_ID_PROBABLE_PIX_EVENT_LEAK = 1383, + D3D12_MESSAGE_ID_PIX_EVENT_UNDERFLOW = 1384, + D3D12_MESSAGE_ID_RECREATEAT_INVALID_TARGET = 1385, + D3D12_MESSAGE_ID_RECREATEAT_INSUFFICIENT_SUPPORT = 1386, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_STRUCTURED_BUFFER_STRIDE_MISMATCH = 1387, + D3D12_MESSAGE_ID_DISPATCH_GRAPH_INVALID = 1388, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_TARGET_FORMAT_INVALID = 1389, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_TARGET_DIMENSION_INVALID = 1390, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_SOURCE_COLOR_FORMAT_INVALID = 1391, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_SOURCE_DEPTH_FORMAT_INVALID = 1392, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXPOSURE_SCALE_FORMAT_INVALID = 1393, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_ENGINE_CREATE_FLAGS_INVALID = 1394, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXTENSION_INTERNAL_LOAD_FAILURE = 1395, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXTENSION_INTERNAL_ENGINE_CREATION_ERROR = 1396, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXTENSION_INTERNAL_UPSCALER_CREATION_ERROR = 1397, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXTENSION_INTERNAL_UPSCALER_EXECUTION_ERROR = 1398, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_REGION_INVALID = 1399, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_TIME_DELTA_INVALID = 1400, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_REQUIRED_TEXTURE_IS_NULL = 1401, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_MOTION_VECTORS_FORMAT_INVALID = 1402, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_FLAGS_INVALID = 1403, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_FORMAT_INVALID = 1404, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_EXPOSURE_SCALE_TEXTURE_SIZE_INVALID = 1405, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_VARIANT_INDEX_OUT_OF_BOUNDS = 1406, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_VARIANT_ID_NOT_FOUND = 1407, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_DUPLICATE_VARIANT_ID = 1408, + D3D12_MESSAGE_ID_DIRECTSR_OUT_OF_MEMORY = 1409, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_UNEXPECTED_TEXTURE_IS_IGNORED = 1410, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EVICT_UNDERFLOW = 1411, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_OPTIONAL_TEXTURE_IS_NULL = 1412, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_INVALID_CAMERA_JITTER = 1413, + D3D12_MESSAGE_ID_CREATE_STATE_OBJECT_WARNING = 1414, + D3D12_MESSAGE_ID_GUID_TEXTURE_LAYOUT_UNSUPPORTED = 1415, + D3D12_MESSAGE_ID_RESOLVE_ENCODER_INPUT_PARAM_LAYOUT_INVALID_PARAMETERS = 1416, + D3D12_MESSAGE_ID_INVALID_BARRIER_ACCESS = 1417, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INSTANCE_COUNT_ZERO = 1418, + D3D12_MESSAGE_ID_DESCRIPTOR_HEAP_NOT_SET_BEFORE_ROOT_SIGNATURE_WITH_DIRECTLY_INDEXED_FLAG = 1419, + D3D12_MESSAGE_ID_DIFFERENT_DESCRIPTOR_HEAP_SET_AFTER_ROOT_SIGNATURE_WITH_DIRECTLY_INDEXED_FLAG = 1420, + D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_DIFFERENT_DESCRIPTOR_HEAP_SET_AFTER_ROOT_SIGNATURE_WITH_DIRECTLY_INDEXED_FLAG + 1 ) } D3D12_MESSAGE_ID; typedef struct D3D12_MESSAGE @@ -3232,8 +3377,8 @@ typedef struct D3D12_INFO_QUEUE_FILTER #define D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024 -extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_s_ifspec; #ifndef __ID3D12InfoQueue_INTERFACE_DEFINED__ #define __ID3D12InfoQueue_INTERFACE_DEFINED__ @@ -3678,7 +3823,7 @@ EXTERN_C const IID IID_ID3D12InfoQueue; #endif /* __ID3D12InfoQueue_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_d3d12sdklayers_0000_0018 */ +/* interface __MIDL_itf_d3d12sdklayers_0000_0019 */ /* [local] */ typedef @@ -3698,8 +3843,8 @@ typedef void ( __stdcall *D3D12MessageFunc )( -extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_s_ifspec; #ifndef __ID3D12InfoQueue1_INTERFACE_DEFINED__ #define __ID3D12InfoQueue1_INTERFACE_DEFINED__ @@ -3719,7 +3864,7 @@ EXTERN_C const IID IID_ID3D12InfoQueue1; virtual HRESULT STDMETHODCALLTYPE RegisterMessageCallback( _In_ D3D12MessageFunc CallbackFunc, _In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags, - _In_ void *pContext, + _Inout_ void *pContext, _Inout_ DWORD *pCallbackCookie) = 0; virtual HRESULT STDMETHODCALLTYPE UnregisterMessageCallback( @@ -3921,7 +4066,7 @@ EXTERN_C const IID IID_ID3D12InfoQueue1; ID3D12InfoQueue1 * This, _In_ D3D12MessageFunc CallbackFunc, _In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags, - _In_ void *pContext, + _Inout_ void *pContext, _Inout_ DWORD *pCallbackCookie); DECLSPEC_XFGVIRT(ID3D12InfoQueue1, UnregisterMessageCallback) @@ -4075,7 +4220,7 @@ EXTERN_C const IID IID_ID3D12InfoQueue1; #endif /* __ID3D12InfoQueue1_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_d3d12sdklayers_0000_0019 */ +/* interface __MIDL_itf_d3d12sdklayers_0000_0020 */ /* [local] */ #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ @@ -4097,12 +4242,13 @@ DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0 DEFINE_GUID(IID_ID3D12DebugCommandList2,0xaeb575cf,0x4e06,0x48be,0xba,0x3b,0xc4,0x50,0xfc,0x96,0x65,0x2e); DEFINE_GUID(IID_ID3D12DebugCommandList3,0x197d5e15,0x4d37,0x4d34,0xaf,0x78,0x72,0x4c,0xd7,0x0f,0xdb,0x1f); DEFINE_GUID(IID_ID3D12SharingContract,0x0adf7d52,0x929c,0x4e61,0xad,0xdb,0xff,0xed,0x30,0xde,0x66,0xef); +DEFINE_GUID(IID_ID3D12ManualWriteTrackingResource,0x86ca3b85,0x49ad,0x4b6e,0xae,0xd5,0xed,0xdb,0x18,0x54,0x0f,0x41); DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58); DEFINE_GUID(IID_ID3D12InfoQueue1,0x2852dd88,0xb484,0x4c0c,0xb6,0xb1,0x67,0x16,0x85,0x00,0xe6,0x00); -extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0020_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0020_v0_0_s_ifspec; /* Additional Prototypes for ALL interfaces */ diff --git a/deps/DirectX-Headers/include/directx/d3d12sdklayers.idl b/deps/DirectX-Headers/include/directx/d3d12sdklayers.idl index add0f83..f7d9036 100644 --- a/deps/DirectX-Headers/include/directx/d3d12sdklayers.idl +++ b/deps/DirectX-Headers/include/directx/d3d12sdklayers.idl @@ -244,6 +244,15 @@ interface ID3D12SharingContract void EndCapturableWork([annotation("_In_")] REFGUID guid); }; +[uuid(86ca3b85-49ad-4b6e-aed5-eddb18540f41), object, local, pointer_default(unique)] +interface ID3D12ManualWriteTrackingResource + : IUnknown +{ + void TrackWrite( + UINT Subresource, + [annotation("_In_opt_")] const D3D12_RANGE* pWrittenRange); +}; + //================================================================================================================================== // @@ -405,6 +414,10 @@ typedef enum D3D12_MESSAGE_ID { D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = 116, D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = 117, + D3D12_MESSAGE_ID_GET_PROGRAM_IDENTIFIER_ERROR = 118, + D3D12_MESSAGE_ID_GET_WORK_GRAPH_PROPERTIES_ERROR = 119, + D3D12_MESSAGE_ID_SET_PROGRAM_ERROR = 120, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = 135, D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = 200, @@ -1375,7 +1388,7 @@ typedef enum D3D12_MESSAGE_ID { D3D12_MESSAGE_ID_SHADING_RATE_SOURCE_REQUIRES_DIMENSION_TEXTURE2D = 1339, D3D12_MESSAGE_ID_BUFFER_BARRIER_SUBREGION_OUT_OF_BOUNDS = 1340, - + D3D12_MESSAGE_ID_UNSUPPORTED_BARRIER_LAYOUT = 1341, D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALID_PARAMETERS = 1342, @@ -1420,7 +1433,68 @@ typedef enum D3D12_MESSAGE_ID { D3D12_MESSAGE_ID_DYNAMIC_DEPTH_BIAS_NO_PIPELINE = 1367, D3D12_MESSAGE_ID_DYNAMIC_INDEX_BUFFER_STRIP_CUT_FLAG_MISSING = 1368, D3D12_MESSAGE_ID_DYNAMIC_INDEX_BUFFER_STRIP_CUT_NO_PIPELINE = 1369, + + D3D12_MESSAGE_ID_NONNORMALIZED_COORDINATE_SAMPLING_NOT_SUPPORTED = 1370, + D3D12_MESSAGE_ID_INVALID_CAST_TARGET = 1371, + + D3D12_MESSAGE_ID_RENDER_PASS_COMMANDLIST_INVALID_END_STATE = 1372, + D3D12_MESSAGE_ID_RENDER_PASS_COMMANDLIST_INVALID_START_STATE = 1373, + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_ACCESS = 1374, + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_LOCAL_PRESERVE_PARAMETERS = 1375, + D3D12_MESSAGE_ID_RENDER_PASS_LOCAL_PRESERVE_RENDER_PARAMETERS_ERROR = 1376, + D3D12_MESSAGE_ID_RENDER_PASS_LOCAL_DEPTH_STENCIL_ERROR = 1377, + + D3D12_MESSAGE_ID_DRAW_POTENTIALLY_OUTSIDE_OF_VALID_RENDER_AREA = 1378, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_LINERASTERIZATIONMODE = 1379, + + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT_SMALLRESOURCE = 1380, + D3D12_MESSAGE_ID_GENERIC_DEVICE_OPERATION_UNSUPPORTED = 1381, + + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDER_TARGET_WRONG_WRITE_MASK = 1382, + + D3D12_MESSAGE_ID_PROBABLE_PIX_EVENT_LEAK = 1383, + D3D12_MESSAGE_ID_PIX_EVENT_UNDERFLOW = 1384, + + D3D12_MESSAGE_ID_RECREATEAT_INVALID_TARGET = 1385, + D3D12_MESSAGE_ID_RECREATEAT_INSUFFICIENT_SUPPORT = 1386, + + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_STRUCTURED_BUFFER_STRIDE_MISMATCH = 1387, + + D3D12_MESSAGE_ID_DISPATCH_GRAPH_INVALID = 1388, + + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_TARGET_FORMAT_INVALID = 1389, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_TARGET_DIMENSION_INVALID = 1390, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_SOURCE_COLOR_FORMAT_INVALID = 1391, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_SOURCE_DEPTH_FORMAT_INVALID = 1392, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXPOSURE_SCALE_FORMAT_INVALID = 1393, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_ENGINE_CREATE_FLAGS_INVALID = 1394, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXTENSION_INTERNAL_LOAD_FAILURE = 1395, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXTENSION_INTERNAL_ENGINE_CREATION_ERROR = 1396, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXTENSION_INTERNAL_UPSCALER_CREATION_ERROR = 1397, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_EXTENSION_INTERNAL_UPSCALER_EXECUTION_ERROR = 1398, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_REGION_INVALID = 1399, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_TIME_DELTA_INVALID = 1400, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_REQUIRED_TEXTURE_IS_NULL = 1401, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_MOTION_VECTORS_FORMAT_INVALID = 1402, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_FLAGS_INVALID = 1403, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_FORMAT_INVALID = 1404, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_EXPOSURE_SCALE_TEXTURE_SIZE_INVALID = 1405, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_VARIANT_INDEX_OUT_OF_BOUNDS = 1406, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_VARIANT_ID_NOT_FOUND = 1407, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_DUPLICATE_VARIANT_ID = 1408, + D3D12_MESSAGE_ID_DIRECTSR_OUT_OF_MEMORY = 1409, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_UNEXPECTED_TEXTURE_IS_IGNORED = 1410, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EVICT_UNDERFLOW = 1411, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_OPTIONAL_TEXTURE_IS_NULL = 1412, + D3D12_MESSAGE_ID_DIRECTSR_SUPERRES_UPSCALER_EXECUTE_INVALID_CAMERA_JITTER = 1413, + D3D12_MESSAGE_ID_CREATE_STATE_OBJECT_WARNING = 1414, + D3D12_MESSAGE_ID_GUID_TEXTURE_LAYOUT_UNSUPPORTED = 1415, + D3D12_MESSAGE_ID_RESOLVE_ENCODER_INPUT_PARAM_LAYOUT_INVALID_PARAMETERS = 1416, + D3D12_MESSAGE_ID_INVALID_BARRIER_ACCESS = 1417, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INSTANCE_COUNT_ZERO = 1418, + D3D12_MESSAGE_ID_DESCRIPTOR_HEAP_NOT_SET_BEFORE_ROOT_SIGNATURE_WITH_DIRECTLY_INDEXED_FLAG = 1419, + D3D12_MESSAGE_ID_DIFFERENT_DESCRIPTOR_HEAP_SET_AFTER_ROOT_SIGNATURE_WITH_DIRECTLY_INDEXED_FLAG = 1420, D3D12_MESSAGE_ID_D3D12_MESSAGES_END } D3D12_MESSAGE_ID; @@ -1735,7 +1809,7 @@ interface ID3D12InfoQueue1 HRESULT RegisterMessageCallback( [annotation("_In_")] D3D12MessageFunc CallbackFunc, [annotation("_In_")] D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags, - [annotation("_In_")] void* pContext, + [annotation("_Inout_")] void* pContext, [annotation("_Inout_")] DWORD *pCallbackCookie); HRESULT UnregisterMessageCallback( @@ -1764,5 +1838,6 @@ cpp_quote( "DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88 cpp_quote( "DEFINE_GUID(IID_ID3D12DebugCommandList2,0xaeb575cf,0x4e06,0x48be,0xba,0x3b,0xc4,0x50,0xfc,0x96,0x65,0x2e);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12DebugCommandList3,0x197d5e15,0x4d37,0x4d34,0xaf,0x78,0x72,0x4c,0xd7,0x0f,0xdb,0x1f);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12SharingContract,0x0adf7d52,0x929c,0x4e61,0xad,0xdb,0xff,0xed,0x30,0xde,0x66,0xef);" ) +cpp_quote( "DEFINE_GUID(IID_ID3D12ManualWriteTrackingResource,0x86ca3b85,0x49ad,0x4b6e,0xae,0xd5,0xed,0xdb,0x18,0x54,0x0f,0x41);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58);" ) cpp_quote( "DEFINE_GUID(IID_ID3D12InfoQueue1,0x2852dd88,0xb484,0x4c0c,0xb6,0xb1,0x67,0x16,0x85,0x00,0xe6,0x00);" ) diff --git a/deps/DirectX-Headers/include/directx/d3d12shader.h b/deps/DirectX-Headers/include/directx/d3d12shader.h index 14d9cab..65728dd 100644 --- a/deps/DirectX-Headers/include/directx/d3d12shader.h +++ b/deps/DirectX-Headers/include/directx/d3d12shader.h @@ -37,6 +37,8 @@ typedef enum D3D12_SHADER_VERSION_TYPE D3D12_SHVER_MESH_SHADER = 13, D3D12_SHVER_AMPLIFICATION_SHADER = 14, + D3D12_SHVER_NODE_SHADER = 15, + D3D12_SHVER_RESERVED0 = 0xFFF0, } D3D12_SHADER_VERSION_TYPE; @@ -201,8 +203,10 @@ typedef struct _D3D12_SHADER_INPUT_BIND_DESC #define D3D_SHADER_REQUIRES_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x04000000 #define D3D_SHADER_REQUIRES_WAVE_MMA 0x08000000 #define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000 -#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000 -#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000 +#define D3D_SHADER_REQUIRES_ADVANCED_TEXTURE_OPS 0x20000000 +#define D3D_SHADER_REQUIRES_WRITEABLE_MSAA_TEXTURES 0x40000000 +#define D3D_SHADER_REQUIRES_SAMPLE_CMP_GRADIENT_OR_BIAS 0x80000000 +#define D3D_SHADER_REQUIRES_EXTENDED_COMMAND_INFO 0x100000000ull typedef struct _D3D12_LIBRARY_DESC diff --git a/deps/DirectX-Headers/include/directx/d3d12video.h b/deps/DirectX-Headers/include/directx/d3d12video.h index 0fcc4ac..3add252 100644 --- a/deps/DirectX-Headers/include/directx/d3d12video.h +++ b/deps/DirectX-Headers/include/directx/d3d12video.h @@ -338,7 +338,9 @@ enum D3D12_FEATURE_VIDEO D3D12_FEATURE_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT = 42, D3D12_FEATURE_VIDEO_ENCODER_SUPPORT = 43, D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = 44, - D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45 + D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45, + D3D12_FEATURE_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG = 46, + D3D12_FEATURE_VIDEO_ENCODER_SUPPORT1 = 47 } D3D12_FEATURE_VIDEO; typedef @@ -407,7 +409,7 @@ enum D3D12_VIDEO_PROCESS_FILTER_FLAGS D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT = ( 1 << D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT ) } D3D12_VIDEO_PROCESS_FILTER_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS ) typedef enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS { @@ -416,7 +418,7 @@ enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM = 0x80000000 } D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS ) typedef struct D3D12_VIDEO_PROCESS_ALPHA_BLENDING { BOOL Enable; @@ -929,7 +931,7 @@ enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1 } D3D12_VIDEO_DECODE_SUPPORT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS ) typedef enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS { @@ -940,7 +942,7 @@ enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8 } D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ) typedef enum D3D12_VIDEO_DECODE_STATUS { @@ -957,7 +959,7 @@ enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS = 0, D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX = 1, D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL = 2, - D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID = 3 + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_HUFFMAN_TABLE = 3 } D3D12_VIDEO_DECODE_ARGUMENT_TYPE; typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT @@ -1032,7 +1034,7 @@ enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_A = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A ) } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS ) typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM { UINT NodeIndex; @@ -1052,7 +1054,7 @@ enum D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_SUPPORTED = 0x1 } D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS ) typedef enum D3D12_VIDEO_SCALE_SUPPORT_FLAGS { @@ -1061,7 +1063,7 @@ enum D3D12_VIDEO_SCALE_SUPPORT_FLAGS D3D12_VIDEO_SCALE_SUPPORT_FLAG_EVEN_DIMENSIONS_ONLY = 0x2 } D3D12_VIDEO_SCALE_SUPPORT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_SCALE_SUPPORT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_SCALE_SUPPORT_FLAGS ) typedef struct D3D12_VIDEO_SCALE_SUPPORT { D3D12_VIDEO_SIZE_RANGE OutputSizeRange; @@ -1352,7 +1354,7 @@ enum D3D12_VIDEO_PROCESS_FEATURE_FLAGS D3D12_VIDEO_PROCESS_FEATURE_FLAG_PIXEL_ASPECT_RATIO = 0x40 } D3D12_VIDEO_PROCESS_FEATURE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FEATURE_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FEATURE_FLAGS ) typedef enum D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS { @@ -1368,7 +1370,7 @@ enum D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_CUSTOM = 0x80000000 } D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS ) typedef enum D3D12_VIDEO_PROCESS_ORIENTATION { @@ -1390,7 +1392,7 @@ enum D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_REPEAT = 0x2 } D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS ) typedef struct D3D12_VIDEO_PROCESS_FILTER_RANGE { INT Minimum; @@ -1406,7 +1408,7 @@ enum D3D12_VIDEO_PROCESS_SUPPORT_FLAGS D3D12_VIDEO_PROCESS_SUPPORT_FLAG_SUPPORTED = 0x1 } D3D12_VIDEO_PROCESS_SUPPORT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_SUPPORT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_SUPPORT_FLAGS ) typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT { UINT NodeIndex; @@ -2761,7 +2763,7 @@ enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_16X16 = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 ) } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS ) typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION { @@ -2775,7 +2777,7 @@ enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_QUARTER_PEL = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL ) } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS ) typedef struct D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT { UINT NodeIndex; @@ -3705,7 +3707,7 @@ enum D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_SUPPORTED = 0x1 } D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS ) typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES { UINT NodeIndex; @@ -3780,7 +3782,7 @@ enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_WRITE = 0x2 } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS ); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS ) typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT { UINT NodeIndex; @@ -6311,6 +6313,16 @@ DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, 0xefd64d74, 0xc9e8,0x41d DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e); DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0); DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MONOCHROME, 0x0685b993, 0x3d8c, 0x43a0, 0x8b, 0x28, 0xd7, 0x4c, 0x2d, 0x68, 0x99, 0xa4); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MONOCHROME10, 0x142a1d0f, 0x69dd, 0x4ec9, 0x85, 0x91, 0xb1, 0x2f, 0xfc, 0xb9, 0x1a, 0x29); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN12, 0x1a72925f, 0x0c2c, 0x4f15, 0x96, 0xfb, 0xb1, 0x7d, 0x14, 0x73, 0x60, 0x3f); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10_422, 0x0bac4fe5, 0x1532, 0x4429, 0xa8, 0x54, 0xf8, 0x4d, 0xe0, 0x49, 0x53, 0xdb); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN12_422, 0x55bcac81, 0xf311, 0x4093, 0xa7, 0xd0, 0x1c, 0xbc, 0x0b, 0x84, 0x9b, 0xee); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN_444, 0x4008018f, 0xf537, 0x4b36, 0x98, 0xcf, 0x61, 0xaf, 0x8a, 0x2c, 0x1a, 0x33); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10_EXT, 0x9cc55490, 0xe37c, 0x4932, 0x86, 0x84, 0x49, 0x20, 0xf9, 0xf6, 0x40, 0x9c); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10_444, 0x0dabeffa, 0x4458, 0x4602, 0xbc, 0x03, 0x07, 0x95, 0x65, 0x9d, 0x61, 0x7c); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN12_444, 0x9798634d, 0xfe9d, 0x48e5, 0xb4, 0xda, 0xdb, 0xec, 0x45, 0xb3, 0xdf, 0x01); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN16, 0xa4fbdbb0, 0xa113, 0x482b, 0xa2, 0x32, 0x63, 0x5c, 0xc0, 0x69, 0x7f, 0x6d); DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e); DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7); DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP8, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7); @@ -6319,6 +6331,470 @@ DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE1, 0x6936ff0f, 0x45b1, 0x4163, DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2, 0x0c5f2aa1, 0xe541, 0x4089, 0xbb, 0x7b, 0x98, 0x11, 0x0a, 0x19, 0xd7, 0xc8); DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2, 0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0); DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MJPEG_VLD_420, 0x725cb506, 0xc29, 0x43c4, 0x94, 0x40, 0x8e, 0x93, 0x97, 0x90, 0x3a, 0x4); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MJPEG_VLD_422, 0x5b77b9cd, 0x1a35, 0x4c30, 0x9f, 0xd8, 0xef, 0x4b, 0x60, 0xc0, 0x35, 0xdd); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MJPEG_VLD_444, 0xd95161f9, 0xd44, 0x47e6, 0xbc, 0xf5, 0x1b, 0xfb, 0xfb, 0x26, 0x8f, 0x97); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MJPEG_VLD_4444, 0xc91748d5, 0xfd18, 0x4aca, 0x9d, 0xb3, 0x3a, 0x66, 0x34, 0xab, 0x54, 0x7d); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_JPEG_VLD_420, 0xcf782c83, 0xbef5, 0x4a2c, 0x87, 0xcb, 0x60, 0x19, 0xe7, 0xb1, 0x75, 0xac); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_JPEG_VLD_422, 0xf04df417, 0xeee2, 0x4067, 0xa7, 0x78, 0xf3, 0x5c, 0x15, 0xab, 0x97, 0x21); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_JPEG_VLD_444, 0x4cd00e17, 0x89ba, 0x48ef, 0xb9, 0xf9, 0xed, 0xcb, 0x82, 0x71, 0x3f, 0x65); +typedef +enum D3D12_VIDEO_ENCODER_AV1_PROFILE + { + D3D12_VIDEO_ENCODER_AV1_PROFILE_MAIN = 0, + D3D12_VIDEO_ENCODER_AV1_PROFILE_HIGH = 1, + D3D12_VIDEO_ENCODER_AV1_PROFILE_PROFESSIONAL = 2 + } D3D12_VIDEO_ENCODER_AV1_PROFILE; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_LEVELS + { + D3D12_VIDEO_ENCODER_AV1_LEVELS_2_0 = 0, + D3D12_VIDEO_ENCODER_AV1_LEVELS_2_1 = 1, + D3D12_VIDEO_ENCODER_AV1_LEVELS_2_2 = 2, + D3D12_VIDEO_ENCODER_AV1_LEVELS_2_3 = 3, + D3D12_VIDEO_ENCODER_AV1_LEVELS_3_0 = 4, + D3D12_VIDEO_ENCODER_AV1_LEVELS_3_1 = 5, + D3D12_VIDEO_ENCODER_AV1_LEVELS_3_2 = 6, + D3D12_VIDEO_ENCODER_AV1_LEVELS_3_3 = 7, + D3D12_VIDEO_ENCODER_AV1_LEVELS_4_0 = 8, + D3D12_VIDEO_ENCODER_AV1_LEVELS_4_1 = 9, + D3D12_VIDEO_ENCODER_AV1_LEVELS_4_2 = 10, + D3D12_VIDEO_ENCODER_AV1_LEVELS_4_3 = 11, + D3D12_VIDEO_ENCODER_AV1_LEVELS_5_0 = 12, + D3D12_VIDEO_ENCODER_AV1_LEVELS_5_1 = 13, + D3D12_VIDEO_ENCODER_AV1_LEVELS_5_2 = 14, + D3D12_VIDEO_ENCODER_AV1_LEVELS_5_3 = 15, + D3D12_VIDEO_ENCODER_AV1_LEVELS_6_0 = 16, + D3D12_VIDEO_ENCODER_AV1_LEVELS_6_1 = 17, + D3D12_VIDEO_ENCODER_AV1_LEVELS_6_2 = 18, + D3D12_VIDEO_ENCODER_AV1_LEVELS_6_3 = 19, + D3D12_VIDEO_ENCODER_AV1_LEVELS_7_0 = 20, + D3D12_VIDEO_ENCODER_AV1_LEVELS_7_1 = 21, + D3D12_VIDEO_ENCODER_AV1_LEVELS_7_2 = 22, + D3D12_VIDEO_ENCODER_AV1_LEVELS_7_3 = 23 + } D3D12_VIDEO_ENCODER_AV1_LEVELS; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_TIER + { + D3D12_VIDEO_ENCODER_AV1_TIER_MAIN = 0, + D3D12_VIDEO_ENCODER_AV1_TIER_HIGH = 1 + } D3D12_VIDEO_ENCODER_AV1_TIER; + +typedef struct D3D12_VIDEO_ENCODER_AV1_LEVEL_TIER_CONSTRAINTS + { + D3D12_VIDEO_ENCODER_AV1_LEVELS Level; + D3D12_VIDEO_ENCODER_AV1_TIER Tier; + } D3D12_VIDEO_ENCODER_AV1_LEVEL_TIER_CONSTRAINTS; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_128x128_SUPERBLOCK = 0x1, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_FILTER_INTRA = 0x2, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_INTRA_EDGE_FILTER = 0x4, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_INTERINTRA_COMPOUND = 0x8, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_MASKED_COMPOUND = 0x10, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_WARPED_MOTION = 0x20, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_DUAL_FILTER = 0x40, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_JNT_COMP = 0x80, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_FORCED_INTEGER_MOTION_VECTORS = 0x100, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_SUPER_RESOLUTION = 0x200, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_LOOP_RESTORATION_FILTER = 0x400, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_PALETTE_ENCODING = 0x800, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_CDEF_FILTERING = 0x1000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_INTRA_BLOCK_COPY = 0x2000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_FRAME_REFERENCE_MOTION_VECTORS = 0x4000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_ORDER_HINT_TOOLS = 0x8000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_AUTO_SEGMENTATION = 0x10000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_CUSTOM_SEGMENTATION = 0x20000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_LOOP_FILTER_DELTAS = 0x40000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_QUANTIZATION_DELTAS = 0x80000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_QUANTIZATION_MATRIX = 0x100000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_REDUCED_TX_SET = 0x200000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_MOTION_MODE_SWITCHABLE = 0x400000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_ALLOW_HIGH_PRECISION_MV = 0x800000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_SKIP_MODE_PRESENT = 0x1000000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_DELTA_LF_PARAMS = 0x2000000 + } D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS) +typedef +enum D3D12_VIDEO_ENCODER_AV1_TX_MODE + { + D3D12_VIDEO_ENCODER_AV1_TX_MODE_ONLY4x4 = 0, + D3D12_VIDEO_ENCODER_AV1_TX_MODE_LARGEST = 1, + D3D12_VIDEO_ENCODER_AV1_TX_MODE_SELECT = 2 + } D3D12_VIDEO_ENCODER_AV1_TX_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_ONLY4x4 = ( 1 << D3D12_VIDEO_ENCODER_AV1_TX_MODE_ONLY4x4 ) , + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_LARGEST = ( 1 << D3D12_VIDEO_ENCODER_AV1_TX_MODE_LARGEST ) , + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_SELECT = ( 1 << D3D12_VIDEO_ENCODER_AV1_TX_MODE_SELECT ) + } D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS) +typedef +enum D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS + { + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP = 0, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SMOOTH = 1, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SHARP = 2, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_BILINEAR = 3, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_SWITCHABLE = 4 + } D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_EIGHTTAP = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP ) , + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_EIGHTTAP_SMOOTH = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SMOOTH ) , + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_EIGHTTAP_SHARP = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SHARP ) , + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_BILINEAR = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_BILINEAR ) , + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_SWITCHABLE = ( 1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_SWITCHABLE ) + } D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS) +typedef +enum D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE + { + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_4x4 = 0, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_8x8 = 1, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_16x16 = 2, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_32x32 = 3, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_64x64 = 4 + } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE + { + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_DISABLED = 0, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_Q = 1, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_V = 2, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_H = 3, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_U = 4, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_V = 5, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_REF_FRAME = 6, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_SKIP = 7, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_GLOBALMV = 8 + } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_DISABLED = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_DISABLED ) , + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_Q = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_Q ) , + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_Y_V = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_V ) , + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_Y_H = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_H ) , + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_U = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_U ) , + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_V = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_V ) , + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_REF_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_REF_FRAME ) , + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_SKIP = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_SKIP ) , + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_GLOBALMV = ( 1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_GLOBALMV ) + } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS) +typedef +enum D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE + { + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_DISABLED = 0, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_SWITCHABLE = 1, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_WIENER = 2, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_SGRPROJ = 3 + } D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE + { + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_DISABLED = 0, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_32x32 = 1, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_64x64 = 2, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_128x128 = 3, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_256x256 = 4 + } D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_NOT_SUPPORTED = 0, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_32x32 = 0x1, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_64x64 = 0x2, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_128x128 = 0x4, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_256x256 = 0x8 + } D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS) +typedef +enum D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION + { + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_IDENTITY = 0, + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_TRANSLATION = 1, + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_ROTZOOM = 2, + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_AFFINE = 3 + } D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_IDENTITY = ( 1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_IDENTITY ) , + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_TRANSLATION = ( 1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_TRANSLATION ) , + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_ROTZOOM = ( 1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_ROTZOOM ) , + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_AFFINE = ( 1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_AFFINE ) + } D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS) +typedef +enum D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_QUANTIZATION = 0x1, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_QUANTIZATION_DELTA = 0x2, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_LOOP_FILTER = 0x4, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_LOOP_FILTER_DELTA = 0x8, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_CDEF_DATA = 0x10, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_CONTEXT_UPDATE_TILE_ID = 0x20, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_COMPOUND_PREDICTION_MODE = 0x40, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_PRIMARY_REF_FRAME = 0x80, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_REFERENCE_INDICES = 0x100 + } D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS) +typedef struct D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION_SUPPORT + { + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS SupportedFeatureFlags; + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS RequiredFeatureFlags; + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS SupportedInterpolationFilters; + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS SupportedRestorationParams[ 3 ][ 3 ]; + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS SupportedSegmentationModes; + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS SupportedTxModes[ 4 ]; + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE SegmentationBlockSize; + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS PostEncodeValuesFlags; + UINT MaxTemporalLayers; + UINT MaxSpatialLayers; + } D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION_SUPPORT; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE + { + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_KEY_FRAME = 0, + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTER_FRAME = 1, + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTRA_ONLY_FRAME = 2, + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_SWITCH_FRAME = 3 + } D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_KEY_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_KEY_FRAME ) , + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_INTER_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTER_FRAME ) , + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_INTRA_ONLY_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTRA_ONLY_FRAME ) , + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_SWITCH_FRAME = ( 1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_SWITCH_FRAME ) + } D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS) +typedef +enum D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE + { + D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE_SINGLE_REFERENCE = 0, + D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE_COMPOUND_REFERENCE = 1 + } D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_PICTURE_CONTROL_SUPPORT + { + D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE PredictionMode; + UINT MaxUniqueReferencesPerFrame; + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS SupportedFrameTypes; + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS SupportedReferenceWarpedMotionFlags; + } D3D12_VIDEO_ENCODER_CODEC_AV1_PICTURE_CONTROL_SUPPORT; + +typedef struct D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION + { + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS FeatureFlags; + UINT OrderHintBitsMinus1; + } D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION; + +typedef struct D3D12_VIDEO_ENCODER_AV1_SEQUENCE_STRUCTURE + { + UINT IntraDistance; + UINT InterFramePeriod; + } D3D12_VIDEO_ENCODER_AV1_SEQUENCE_STRUCTURE; + +typedef struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO + { + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION TransformationType; + INT TransformationMatrix[ 8 ]; + BOOL InvalidAffineSet; + } D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO; + +typedef struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR + { + UINT ReconstructedPictureResourceIndex; + UINT TemporalLayerIndexPlus1; + UINT SpatialLayerIndexPlus1; + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE FrameType; + D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO WarpedMotionInfo; + UINT OrderHint; + UINT PictureIndex; + } D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR; + +typedef +enum D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_ERROR_RESILIENT_MODE = 0x1, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_DISABLE_CDF_UPDATE = 0x2, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_PALETTE_ENCODING = 0x4, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_SKIP_MODE = 0x8, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_FRAME_REFERENCE_MOTION_VECTORS = 0x10, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_FORCE_INTEGER_MOTION_VECTORS = 0x20, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ALLOW_INTRA_BLOCK_COPY = 0x40, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_USE_SUPER_RESOLUTION = 0x80, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_DISABLE_FRAME_END_UPDATE_CDF = 0x100, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_FRAME_SEGMENTATION_AUTO = 0x200, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_FRAME_SEGMENTATION_CUSTOM = 0x400, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_WARPED_MOTION = 0x800, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_REDUCED_TX_SET = 0x1000, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_MOTION_MODE_SWITCHABLE = 0x2000, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ALLOW_HIGH_PRECISION_MV = 0x4000 + } D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS) +typedef struct D3D12_VIDEO_ENCODER_AV1_RESTORATION_CONFIG + { + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE FrameRestorationType[ 3 ]; + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE LoopRestorationPixelSize[ 3 ]; + } D3D12_VIDEO_ENCODER_AV1_RESTORATION_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_AV1_SEGMENT_DATA + { + UINT64 EnabledFeatures; + INT64 FeatureValue[ 8 ]; + } D3D12_VIDEO_ENCODER_AV1_SEGMENT_DATA; + +typedef struct D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG + { + UINT64 UpdateMap; + UINT64 TemporalUpdate; + UINT64 UpdateData; + UINT64 NumSegments; + D3D12_VIDEO_ENCODER_AV1_SEGMENT_DATA SegmentsData[ 8 ]; + } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MAP + { + UINT SegmentsMapByteSize; + UINT8 *pSegmentsMap; + } D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MAP; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG + { + UINT64 LoopFilterLevel[ 2 ]; + UINT64 LoopFilterLevelU; + UINT64 LoopFilterLevelV; + UINT64 LoopFilterSharpnessLevel; + UINT64 LoopFilterDeltaEnabled; + UINT64 UpdateRefDelta; + INT64 RefDeltas[ 8 ]; + UINT64 UpdateModeDelta; + INT64 ModeDeltas[ 2 ]; + } D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG + { + UINT64 DeltaLFPresent; + UINT64 DeltaLFMulti; + UINT64 DeltaLFRes; + } D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG + { + UINT64 BaseQIndex; + INT64 YDCDeltaQ; + INT64 UDCDeltaQ; + INT64 UACDeltaQ; + INT64 VDCDeltaQ; + INT64 VACDeltaQ; + UINT64 UsingQMatrix; + UINT64 QMY; + UINT64 QMU; + UINT64 QMV; + } D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG + { + UINT64 DeltaQPresent; + UINT64 DeltaQRes; + } D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG + { + UINT64 CdefBits; + UINT64 CdefDampingMinus3; + UINT64 CdefYPriStrength[ 8 ]; + UINT64 CdefUVPriStrength[ 8 ]; + UINT64 CdefYSecStrength[ 8 ]; + UINT64 CdefUVSecStrength[ 8 ]; + } D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_CODEC_DATA + { + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE FrameType; + D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE CompoundPredictionType; + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS InterpolationFilter; + D3D12_VIDEO_ENCODER_AV1_RESTORATION_CONFIG FrameRestorationConfig; + D3D12_VIDEO_ENCODER_AV1_TX_MODE TxMode; + UINT SuperResDenominator; + UINT OrderHint; + UINT PictureIndex; + UINT TemporalLayerIndexPlus1; + UINT SpatialLayerIndexPlus1; + D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR ReferenceFramesReconPictureDescriptors[ 8 ]; + UINT ReferenceIndices[ 7 ]; + UINT PrimaryRefFrame; + UINT RefreshFrameFlags; + D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG LoopFilter; + D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG LoopFilterDelta; + D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG Quantization; + D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG QuantizationDelta; + D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG CDEF; + UINT QPMapValuesCount; + _Field_size_full_(QPMapValuesCount) INT16 *pRateControlQPMap; + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG CustomSegmentation; + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MAP CustomSegmentsMap; + } D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_CODEC_DATA; + +typedef struct D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES + { + UINT64 RowCount; + UINT64 ColCount; + UINT64 RowHeights[ 64 ]; + UINT64 ColWidths[ 64 ]; + UINT64 ContextUpdateTileId; + } D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES; + +typedef struct D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES + { + UINT64 CompoundPredictionType; + D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG LoopFilter; + D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG LoopFilterDelta; + D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG Quantization; + D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG QuantizationDelta; + D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG CDEF; + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG SegmentationConfig; + UINT64 PrimaryRefFrame; + UINT64 ReferenceIndices[ 7 ]; + } D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES; + typedef enum D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE { @@ -6338,10 +6814,12 @@ enum D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_QP_RANGE = 0x4, D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_INITIAL_QP = 0x8, D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_MAX_FRAME_SIZE = 0x10, - D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_VBV_SIZES = 0x20 + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_VBV_SIZES = 0x20, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_EXTENSION1_SUPPORT = 0x40, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_QUALITY_VS_SPEED = 0x80 } D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS) typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP { UINT ConstantQP_FullIntracodedFrame; @@ -6349,6 +6827,14 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP UINT ConstantQP_InterPredictedFrame_BiDirectionalRef; } D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP; +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP1 + { + UINT ConstantQP_FullIntracodedFrame; + UINT ConstantQP_InterPredictedFrame_PrevRefOnly; + UINT ConstantQP_InterPredictedFrame_BiDirectionalRef; + UINT QualityVsSpeed; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP1; + typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR { UINT InitialQP; @@ -6360,6 +6846,18 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR UINT64 InitialVBVFullness; } D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR; +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR1 + { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + UINT QualityVsSpeed; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR1; + typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR { UINT InitialQP; @@ -6372,6 +6870,19 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR UINT64 InitialVBVFullness; } D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR; +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR1 + { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + UINT QualityVsSpeed; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR1; + typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR { UINT InitialQP; @@ -6383,6 +6894,25 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR UINT ConstantQualityTarget; } D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR; +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR1 + { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT ConstantQualityTarget; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + UINT QualityVsSpeed; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR1; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_ABSOLUTE_QP_MAP + { + UINT QualityVsSpeed; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_ABSOLUTE_QP_MAP; + typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS { UINT DataSize; @@ -6392,6 +6922,11 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR *pConfiguration_CBR; const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR *pConfiguration_VBR; const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR *pConfiguration_QVBR; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP1 *pConfiguration_CQP1; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR1 *pConfiguration_CBR1; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR1 *pConfiguration_VBR1; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR1 *pConfiguration_QVBR1; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_ABSOLUTE_QP_MAP *pConfiguration_AbsoluteQPMap; } ; } D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS; @@ -6407,7 +6942,8 @@ typedef enum D3D12_VIDEO_ENCODER_CODEC { D3D12_VIDEO_ENCODER_CODEC_H264 = 0, - D3D12_VIDEO_ENCODER_CODEC_HEVC = 1 + D3D12_VIDEO_ENCODER_CODEC_HEVC = 1, + D3D12_VIDEO_ENCODER_CODEC_AV1 = 2 } D3D12_VIDEO_ENCODER_CODEC; typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC @@ -6429,7 +6965,14 @@ typedef enum D3D12_VIDEO_ENCODER_PROFILE_HEVC { D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN = 0, - D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10 = 1 + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10 = 1, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN12 = 2, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10_422 = 3, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN12_422 = 4, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN_444 = 5, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10_444 = 6, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN12_444 = 7, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN16_444 = 8 } D3D12_VIDEO_ENCODER_PROFILE_HEVC; typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC @@ -6439,6 +6982,7 @@ typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC { D3D12_VIDEO_ENCODER_PROFILE_H264 *pH264Profile; D3D12_VIDEO_ENCODER_PROFILE_HEVC *pHEVCProfile; + D3D12_VIDEO_ENCODER_AV1_PROFILE *pAV1Profile; } ; } D3D12_VIDEO_ENCODER_PROFILE_DESC; @@ -6505,6 +7049,7 @@ typedef struct D3D12_VIDEO_ENCODER_LEVEL_SETTING { D3D12_VIDEO_ENCODER_LEVELS_H264 *pH264LevelSetting; D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC *pHEVCLevelSetting; + D3D12_VIDEO_ENCODER_AV1_LEVEL_TIER_CONSTRAINTS *pAV1LevelSetting; } ; } D3D12_VIDEO_ENCODER_LEVEL_SETTING; @@ -6591,7 +7136,9 @@ enum D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION = 1, D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED = 2, D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION = 3, - D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME = 4 + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME = 4, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_GRID_PARTITION = 5, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_CONFIGURABLE_GRID_PARTITION = 6 } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE @@ -6604,13 +7151,65 @@ typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE BOOL IsSupported; } D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; +typedef +enum D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS + { + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_NOT_SPECIFIED = 0x1, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_CODEC_CONSTRAINT = 0x2, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_HARDWARE_CONSTRAINT = 0x4, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_ROWS_COUNT = 0x8, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_COLS_COUNT = 0x10, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_WIDTH = 0x20, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_AREA = 0x40, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_TOTAL_TILES = 0x80 + } D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS) +typedef struct D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT + { + BOOL Use128SuperBlocks; + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES TilesConfiguration; + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS ValidationFlags; + UINT MinTileRows; + UINT MaxTileRows; + UINT MinTileCols; + UINT MaxTileCols; + UINT MinTileWidth; + UINT MaxTileWidth; + UINT MinTileArea; + UINT MaxTileArea; + UINT TileSizeBytesMinus1; + } D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT; + +typedef struct D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT *pAV1Support; + } ; + } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING Level; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionMode; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC FrameResolution; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT CodecSupport; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG; + typedef enum D3D12_VIDEO_ENCODER_HEAP_FLAGS { D3D12_VIDEO_ENCODER_HEAP_FLAG_NONE = 0 } D3D12_VIDEO_ENCODER_HEAP_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_HEAP_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_HEAP_FLAGS) typedef struct D3D12_VIDEO_ENCODER_HEAP_DESC { UINT NodeMask; @@ -6640,10 +7239,11 @@ enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_ADAPTIVE_8x8_TRANSFORM_ENCODING_SUPPORT = 0x8, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_SPATIAL_ENCODING_SUPPORT = 0x10, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_TEMPORAL_ENCODING_SUPPORT = 0x20, - D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x40 + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x40, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE_FLAG_SLICE_SUPPORT = 0x80 } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS) typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES { @@ -6669,7 +7269,7 @@ enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING ) } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS) typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS SupportFlags; @@ -6688,10 +7288,33 @@ enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_ASYMETRIC_MOTION_PARTITION_REQUIRED = 0x20, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_SUPPORT = 0x40, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_DISABLING_LOOP_FILTER_ACROSS_SLICES_SUPPORT = 0x80, - D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_P_FRAMES_IMPLEMENTED_AS_LOW_DELAY_B_FRAMES = 0x100 + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_P_FRAMES_IMPLEMENTED_AS_LOW_DELAY_B_FRAMES = 0x100, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE_FLAG_SLICE_SUPPORT = 0x200, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_ROTATION_ENABLED_SUPPORT = 0x400, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_ROTATION_ENABLED_REQUIRED = 0x800, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_CONTEXT_ENABLED_SUPPORT = 0x1000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_CONTEXT_ENABLED_REQUIRED = 0x2000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_IMPLICIT_RDPCM_ENABLED_SUPPORT = 0x4000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_IMPLICIT_RDPCM_ENABLED_REQUIRED = 0x8000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_EXPLICIT_RDPCM_ENABLED_SUPPORT = 0x10000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_EXPLICIT_RDPCM_ENABLED_REQUIRED = 0x20000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_EXTENDED_PRECISION_PROCESSING_SUPPORT = 0x40000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_EXTENDED_PRECISION_PROCESSING_REQUIRED = 0x80000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_INTRA_SMOOTHING_DISABLED_SUPPORT = 0x100000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_INTRA_SMOOTHING_DISABLED_REQUIRED = 0x200000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_HIGH_PRECISION_OFFSETS_ENABLED_SUPPORT = 0x400000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_HIGH_PRECISION_OFFSETS_ENABLED_REQUIRED = 0x800000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_PERSISTENT_RICE_ADAPTATION_ENABLED_SUPPORT = 0x1000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_PERSISTENT_RICE_ADAPTATION_ENABLED_REQUIRED = 0x2000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CABAC_BYPASS_ALIGNMENT_ENABLED_SUPPORT = 0x4000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CABAC_BYPASS_ALIGNMENT_ENABLED_REQUIRED = 0x8000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CROSS_COMPONENT_PREDICTION_ENABLED_FLAG_SUPPORT = 0x10000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CROSS_COMPONENT_PREDICTION_ENABLED_FLAG_REQUIRED = 0x20000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CHROMA_QP_OFFSET_LIST_ENABLED_FLAG_SUPPORT = 0x40000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CHROMA_QP_OFFSET_LIST_ENABLED_FLAG_REQUIRED = 0x80000000 } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS) typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE { @@ -6721,6 +7344,34 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC UCHAR max_transform_hierarchy_depth_intra; } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC; +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS1 + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG1_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG1_SEPARATE_COLOUR_PLANE_SUPPORT = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG1_SEPARATE_COLOUR_PLANE_REQUIRED = 0x2 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS1; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS1) +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC1 + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize; + UCHAR max_transform_hierarchy_depth_inter; + UCHAR max_transform_hierarchy_depth_intra; + UINT allowed_diff_cu_chroma_qp_offset_depth_values; + UINT allowed_log2_sao_offset_scale_luma_values; + UINT allowed_log2_sao_offset_scale_chroma_values; + UINT allowed_log2_max_transform_skip_block_size_minus2_values; + UINT allowed_chroma_qp_offset_list_len_minus1_values; + UINT allowed_cb_qp_offset_list_values[ 6 ]; + UINT allowed_cr_qp_offset_list_values[ 6 ]; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS1 SupportFlags1; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC1; + typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT { UINT DataSize; @@ -6728,6 +7379,8 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 *pH264Support; D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC *pHEVCSupport; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC1 *pHEVCSupport1; + D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION_SUPPORT *pAV1Support; } ; } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT; @@ -6765,6 +7418,7 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT { D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264 *pH264Support; D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC *pHEVCSupport; + D3D12_VIDEO_ENCODER_CODEC_AV1_PICTURE_CONTROL_SUPPORT *pAV1Support; } ; } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT; @@ -6793,10 +7447,13 @@ enum D3D12_VIDEO_ENCODER_SUPPORT_FLAGS D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_INITIAL_QP_AVAILABLE = 0x200, D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_MAX_FRAME_SIZE_AVAILABLE = 0x400, D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SEQUENCE_GOP_RECONFIGURATION_AVAILABLE = 0x800, - D3D12_VIDEO_ENCODER_SUPPORT_FLAG_MOTION_ESTIMATION_PRECISION_MODE_LIMIT_AVAILABLE = 0x1000 + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_MOTION_ESTIMATION_PRECISION_MODE_LIMIT_AVAILABLE = 0x1000, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_EXTENSION1_SUPPORT = 0x2000, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_QUALITY_VS_SPEED_AVAILABLE = 0x4000, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_READABLE_RECONSTRUCTED_PICTURE_LAYOUT_AVAILABLE = 0x8000 } D3D12_VIDEO_ENCODER_SUPPORT_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SUPPORT_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SUPPORT_FLAGS) typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS { @@ -6807,7 +7464,7 @@ enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x8 } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS) typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES { @@ -6833,10 +7490,20 @@ enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_LONG_TERM_REFERENCES = 0x8, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_ASYMETRIC_MOTION_PARTITION = 0x10, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_TRANSFORM_SKIPPING = 0x20, - D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x40 + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x40, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_TRANSFORM_SKIP_ROTATION = 0x80, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_TRANSFORM_SKIP_CONTEXT = 0x100, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_IMPLICIT_RDPCM = 0x200, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_EXPLICIT_RDPCM = 0x400, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_EXTENDED_PRECISION_PROCESSING = 0x800, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_INTRA_SMOOTHING_DISABLED = 0x1000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_HIGH_PRECISION_OFFSETS = 0x2000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_PERSISTENT_RICE_ADAPTATION = 0x4000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_CABAC_BYPASS_ALIGNMENT = 0x8000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_SEPARATE_COLOUR_PLANE = 0x10000 } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS) typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS ConfigurationFlags; @@ -6855,6 +7522,7 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264 *pH264Config; D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC *pHEVCConfig; + D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION *pAV1Config; } ; } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION; @@ -6870,7 +7538,8 @@ enum D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_MAXIMUM = 0, D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_FULL_PIXEL = 1, D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_HALF_PIXEL = 2, - D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_QUARTER_PIXEL = 3 + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_QUARTER_PIXEL = 3, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_EIGHTH_PIXEL = 4 } D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE; typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS @@ -6893,10 +7562,11 @@ enum D3D12_VIDEO_ENCODER_VALIDATION_FLAGS D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INTRA_REFRESH_MODE_NOT_SUPPORTED = 0x80, D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_MODE_NOT_SUPPORTED = 0x100, D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RESOLUTION_NOT_SUPPORTED_IN_LIST = 0x200, - D3D12_VIDEO_ENCODER_VALIDATION_FLAG_GOP_STRUCTURE_NOT_SUPPORTED = 0x800 + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_GOP_STRUCTURE_NOT_SUPPORTED = 0x800, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_DATA_NOT_SUPPORTED = 0x1000 } D3D12_VIDEO_ENCODER_VALIDATION_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_VALIDATION_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_VALIDATION_FLAGS) typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 { UINT GOPLength; @@ -6920,6 +7590,7 @@ typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE { D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 *pH264GroupOfPictures; D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC *pHEVCGroupOfPictures; + D3D12_VIDEO_ENCODER_AV1_SEQUENCE_STRUCTURE *pAV1SequenceStructure; } ; } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE; @@ -6943,6 +7614,50 @@ typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT _Field_size_full_(ResolutionsListCount) D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS *pResolutionDependentSupport; } D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT; +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES + { + union + { + UINT MaxBytesPerSlice; + UINT NumberOfCodingUnitsPerSlice; + UINT NumberOfRowsPerSlice; + UINT NumberOfSlicesPerFrame; + } ; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA + { + UINT DataSize; + union + { + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_H264; + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_HEVC; + const D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES *pTilesPartition_AV1; + } ; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1 + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence; + D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl; + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefresh; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionFrameEncoding; + UINT ResolutionsListCount; + const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList; + UINT MaxReferenceFramesInDPB; + D3D12_VIDEO_ENCODER_VALIDATION_FLAGS ValidationFlags; + D3D12_VIDEO_ENCODER_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel; + _Field_size_full_(ResolutionsListCount) D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS *pResolutionDependentSupport; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA SubregionFrameEncodingData; + UINT MaxQualityVsSpeed; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1; + typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS { UINT NodeIndex; @@ -6962,7 +7677,7 @@ enum D3D12_VIDEO_ENCODER_FLAGS D3D12_VIDEO_ENCODER_FLAG_NONE = 0 } D3D12_VIDEO_ENCODER_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_FLAGS) typedef struct D3D12_VIDEO_ENCODER_DESC { UINT NodeMask; @@ -7616,10 +8331,11 @@ typedef enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS { D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_NONE = 0, - D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1 + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_REQUEST_NUM_REF_IDX_ACTIVE_OVERRIDE_FLAG_SLICE = 0x2 } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS) typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION { UCHAR memory_management_control_operation; @@ -7684,10 +8400,13 @@ typedef enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS { D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_NONE = 0, - D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1 + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_REQUEST_NUM_REF_IDX_ACTIVE_OVERRIDE_FLAG_SLICE = 0x2, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_CROSS_COMPONENT_PREDICTION = 0x4, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_CHROMA_QP_OFFSET_LIST = 0x8 } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS) typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC { D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS Flags; @@ -7709,6 +8428,34 @@ typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC _Field_size_full_(QPMapValuesCount) INT8 *pRateControlQPMap; } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC; +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC1 + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS Flags; + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC FrameType; + UINT slice_pic_parameter_set_id; + UINT PictureOrderCountNumber; + UINT TemporalLayerIndex; + UINT List0ReferenceFramesCount; + _Field_size_full_(List0ReferenceFramesCount) UINT *pList0ReferenceFrames; + UINT List1ReferenceFramesCount; + _Field_size_full_(List1ReferenceFramesCount) UINT *pList1ReferenceFrames; + UINT ReferenceFramesReconPictureDescriptorsCount; + _Field_size_full_(ReferenceFramesReconPictureDescriptorsCount) D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC *pReferenceFramesReconPictureDescriptors; + UINT List0RefPicModificationsCount; + _Field_size_full_(List0RefPicModificationsCount) UINT *pList0RefPicModifications; + UINT List1RefPicModificationsCount; + _Field_size_full_(List1RefPicModificationsCount) UINT *pList1RefPicModifications; + UINT QPMapValuesCount; + _Field_size_full_(QPMapValuesCount) INT8 *pRateControlQPMap; + UCHAR diff_cu_chroma_qp_offset_depth; + UCHAR log2_sao_offset_scale_luma; + UCHAR log2_sao_offset_scale_chroma; + UCHAR log2_max_transform_skip_block_size_minus2; + UCHAR chroma_qp_offset_list_len_minus1; + CHAR cb_qp_offset_list[ 6 ]; + CHAR cr_qp_offset_list[ 6 ]; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC1; + typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA { UINT DataSize; @@ -7716,6 +8463,8 @@ typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA { D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 *pH264PicData; D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC *pHEVCPicData; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC1 *pHEVCPicData1; + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_CODEC_DATA *pAV1PicData; } ; } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA; @@ -7733,7 +8482,7 @@ enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_USED_AS_REFERENCE_PICTURE = 0x1 } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS) typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC { UINT IntraRefreshFrameIndex; @@ -7753,28 +8502,7 @@ enum D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_GOP_SEQUENCE_CHANGE = 0x10 } D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS); -typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES - { - union - { - UINT MaxBytesPerSlice; - UINT NumberOfCodingUnitsPerSlice; - UINT NumberOfRowsPerSlice; - UINT NumberOfSlicesPerFrame; - } ; - } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES; - -typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA - { - UINT DataSize; - union - { - const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_H264; - const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_HEVC; - } ; - } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA; - +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS) typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC { D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS Flags; @@ -7825,7 +8553,7 @@ enum D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_METADATA_BUFFER_SOURCE = 0x10 } D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS; -DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS) typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS { UINT64 AverageQP; diff --git a/deps/DirectX-Headers/include/directx/d3d12video.idl b/deps/DirectX-Headers/include/directx/d3d12video.idl index 5137927..335ddda 100644 --- a/deps/DirectX-Headers/include/directx/d3d12video.idl +++ b/deps/DirectX-Headers/include/directx/d3d12video.idl @@ -92,7 +92,8 @@ typedef enum D3D12_FEATURE_VIDEO D3D12_FEATURE_VIDEO_ENCODER_SUPPORT = 43, D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = 44, D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45, - + D3D12_FEATURE_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG = 46, + D3D12_FEATURE_VIDEO_ENCODER_SUPPORT1 = 47, } D3D12_FEATURE_VIDEO; @@ -159,7 +160,7 @@ typedef enum D3D12_VIDEO_PROCESS_FILTER_FLAGS D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT = (1 << D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT), } D3D12_VIDEO_PROCESS_FILTER_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS )") typedef enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS { @@ -168,7 +169,7 @@ typedef enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM = 0x80000000, } D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS )") typedef struct D3D12_VIDEO_PROCESS_ALPHA_BLENDING { @@ -283,7 +284,7 @@ typedef enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1, } D3D12_VIDEO_DECODE_SUPPORT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS )") typedef enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS { @@ -294,7 +295,7 @@ typedef enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8, } D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS )") typedef enum D3D12_VIDEO_DECODE_STATUS { @@ -310,7 +311,7 @@ typedef enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS = 0, D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX = 1, D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL = 2, - D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID = 3 + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_HUFFMAN_TABLE = 3, } D3D12_VIDEO_DECODE_ARGUMENT_TYPE; typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT @@ -387,7 +388,7 @@ typedef enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_A = (1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A), } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS )") typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM { @@ -407,7 +408,7 @@ typedef enum D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_SUPPORTED = 0x1, } D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS )") typedef enum D3D12_VIDEO_SCALE_SUPPORT_FLAGS { @@ -416,7 +417,7 @@ typedef enum D3D12_VIDEO_SCALE_SUPPORT_FLAGS D3D12_VIDEO_SCALE_SUPPORT_FLAG_EVEN_DIMENSIONS_ONLY = 0x2, } D3D12_VIDEO_SCALE_SUPPORT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_SCALE_SUPPORT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_SCALE_SUPPORT_FLAGS )") typedef struct D3D12_VIDEO_SCALE_SUPPORT { @@ -530,7 +531,7 @@ typedef enum D3D12_VIDEO_PROCESS_FEATURE_FLAGS D3D12_VIDEO_PROCESS_FEATURE_FLAG_PIXEL_ASPECT_RATIO = 0x40, } D3D12_VIDEO_PROCESS_FEATURE_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FEATURE_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FEATURE_FLAGS )") typedef enum D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS { @@ -546,7 +547,7 @@ typedef enum D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_CUSTOM = 0x80000000, } D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS )") typedef enum D3D12_VIDEO_PROCESS_ORIENTATION { @@ -567,7 +568,7 @@ typedef enum D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_REPEAT = 0x2, } D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS )") typedef struct D3D12_VIDEO_PROCESS_FILTER_RANGE { @@ -583,7 +584,7 @@ typedef enum D3D12_VIDEO_PROCESS_SUPPORT_FLAGS D3D12_VIDEO_PROCESS_SUPPORT_FLAG_SUPPORTED = 0x1, } D3D12_VIDEO_PROCESS_SUPPORT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_SUPPORT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_SUPPORT_FLAGS )") typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT { @@ -895,7 +896,7 @@ typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_16X16 = (1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16), } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS )" ) typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION { @@ -908,7 +909,7 @@ typedef enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_QUARTER_PEL = (1 << D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL), } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS; -cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS );" ) +cpp_quote( "DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS )" ) // D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT typedef struct D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT @@ -1130,7 +1131,7 @@ typedef enum D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_SUPPORTED = 0x1, } D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS )") // D3D12_FEATURE_VIDEO_DECODE_PROTECTED_RESOURCES typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES @@ -1208,7 +1209,7 @@ typedef enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_WRITE = 0x00000002 } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS );") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS )") typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT { @@ -1448,6 +1449,16 @@ cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, 0xefd64d74, 0 cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MONOCHROME, 0x0685b993, 0x3d8c, 0x43a0, 0x8b, 0x28, 0xd7, 0x4c, 0x2d, 0x68, 0x99, 0xa4);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MONOCHROME10, 0x142a1d0f, 0x69dd, 0x4ec9, 0x85, 0x91, 0xb1, 0x2f, 0xfc, 0xb9, 0x1a, 0x29);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN12, 0x1a72925f, 0x0c2c, 0x4f15, 0x96, 0xfb, 0xb1, 0x7d, 0x14, 0x73, 0x60, 0x3f);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10_422, 0x0bac4fe5, 0x1532, 0x4429, 0xa8, 0x54, 0xf8, 0x4d, 0xe0, 0x49, 0x53, 0xdb);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN12_422, 0x55bcac81, 0xf311, 0x4093, 0xa7, 0xd0, 0x1c, 0xbc, 0x0b, 0x84, 0x9b, 0xee);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN_444, 0x4008018f, 0xf537, 0x4b36, 0x98, 0xcf, 0x61, 0xaf, 0x8a, 0x2c, 0x1a, 0x33);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10_EXT, 0x9cc55490, 0xe37c, 0x4932, 0x86, 0x84, 0x49, 0x20, 0xf9, 0xf6, 0x40, 0x9c);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10_444, 0x0dabeffa, 0x4458, 0x4602, 0xbc, 0x03, 0x07, 0x95, 0x65, 0x9d, 0x61, 0x7c);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN12_444, 0x9798634d, 0xfe9d, 0x48e5, 0xb4, 0xda, 0xdb, 0xec, 0x45, 0xb3, 0xdf, 0x01);") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN16, 0xa4fbdbb0, 0xa113, 0x482b, 0xa2, 0x32, 0x63, 0x5c, 0xc0, 0x69, 0x7f, 0x6d);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP8, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7);") @@ -1456,12 +1467,434 @@ cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE1, 0x6936ff0f, 0x45 cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2, 0x0c5f2aa1, 0xe541, 0x4089, 0xbb, 0x7b, 0x98, 0x11, 0x0a, 0x19, 0xd7, 0xc8);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2, 0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0);") cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8);") - +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MJPEG_VLD_420, 0x725cb506, 0xc29, 0x43c4, 0x94, 0x40, 0x8e, 0x93, 0x97, 0x90, 0x3a, 0x4); ") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MJPEG_VLD_422, 0x5b77b9cd, 0x1a35, 0x4c30, 0x9f, 0xd8, 0xef, 0x4b, 0x60, 0xc0, 0x35, 0xdd); ") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MJPEG_VLD_444, 0xd95161f9, 0xd44, 0x47e6, 0xbc, 0xf5, 0x1b, 0xfb, 0xfb, 0x26, 0x8f, 0x97); ") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MJPEG_VLD_4444, 0xc91748d5, 0xfd18, 0x4aca, 0x9d, 0xb3, 0x3a, 0x66, 0x34, 0xab, 0x54, 0x7d); ") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_JPEG_VLD_420, 0xcf782c83, 0xbef5, 0x4a2c, 0x87, 0xcb, 0x60, 0x19, 0xe7, 0xb1, 0x75, 0xac); ") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_JPEG_VLD_422, 0xf04df417, 0xeee2, 0x4067, 0xa7, 0x78, 0xf3, 0x5c, 0x15, 0xab, 0x97, 0x21); ") +cpp_quote("DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_JPEG_VLD_444, 0x4cd00e17, 0x89ba, 0x48ef, 0xb9, 0xf9, 0xed, 0xcb, 0x82, 0x71, 0x3f, 0x65);") /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Video Encoder /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +typedef enum D3D12_VIDEO_ENCODER_AV1_PROFILE +{ + D3D12_VIDEO_ENCODER_AV1_PROFILE_MAIN = 0, + D3D12_VIDEO_ENCODER_AV1_PROFILE_HIGH = 1, + D3D12_VIDEO_ENCODER_AV1_PROFILE_PROFESSIONAL = 2, +} D3D12_VIDEO_ENCODER_AV1_PROFILE; + +typedef enum D3D12_VIDEO_ENCODER_AV1_LEVELS +{ // These values are defined according to the AV1 codec standard spec + D3D12_VIDEO_ENCODER_AV1_LEVELS_2_0 = 0, + D3D12_VIDEO_ENCODER_AV1_LEVELS_2_1 = 1, + D3D12_VIDEO_ENCODER_AV1_LEVELS_2_2 = 2, + D3D12_VIDEO_ENCODER_AV1_LEVELS_2_3 = 3, + D3D12_VIDEO_ENCODER_AV1_LEVELS_3_0 = 4, + D3D12_VIDEO_ENCODER_AV1_LEVELS_3_1 = 5, + D3D12_VIDEO_ENCODER_AV1_LEVELS_3_2 = 6, + D3D12_VIDEO_ENCODER_AV1_LEVELS_3_3 = 7, + D3D12_VIDEO_ENCODER_AV1_LEVELS_4_0 = 8, + D3D12_VIDEO_ENCODER_AV1_LEVELS_4_1 = 9, + D3D12_VIDEO_ENCODER_AV1_LEVELS_4_2 = 10, + D3D12_VIDEO_ENCODER_AV1_LEVELS_4_3 = 11, + D3D12_VIDEO_ENCODER_AV1_LEVELS_5_0 = 12, + D3D12_VIDEO_ENCODER_AV1_LEVELS_5_1 = 13, + D3D12_VIDEO_ENCODER_AV1_LEVELS_5_2 = 14, + D3D12_VIDEO_ENCODER_AV1_LEVELS_5_3 = 15, + D3D12_VIDEO_ENCODER_AV1_LEVELS_6_0 = 16, + D3D12_VIDEO_ENCODER_AV1_LEVELS_6_1 = 17, + D3D12_VIDEO_ENCODER_AV1_LEVELS_6_2 = 18, + D3D12_VIDEO_ENCODER_AV1_LEVELS_6_3 = 19, + D3D12_VIDEO_ENCODER_AV1_LEVELS_7_0 = 20, + D3D12_VIDEO_ENCODER_AV1_LEVELS_7_1 = 21, + D3D12_VIDEO_ENCODER_AV1_LEVELS_7_2 = 22, + D3D12_VIDEO_ENCODER_AV1_LEVELS_7_3 = 23, +} D3D12_VIDEO_ENCODER_AV1_LEVELS; + +typedef enum D3D12_VIDEO_ENCODER_AV1_TIER +{ + D3D12_VIDEO_ENCODER_AV1_TIER_MAIN = 0, + D3D12_VIDEO_ENCODER_AV1_TIER_HIGH = 1, +} D3D12_VIDEO_ENCODER_AV1_TIER; + +typedef struct D3D12_VIDEO_ENCODER_AV1_LEVEL_TIER_CONSTRAINTS +{ + D3D12_VIDEO_ENCODER_AV1_LEVELS Level; + D3D12_VIDEO_ENCODER_AV1_TIER Tier; +} D3D12_VIDEO_ENCODER_AV1_LEVEL_TIER_CONSTRAINTS; + +typedef enum D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS +{ + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_128x128_SUPERBLOCK = 0x1, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_FILTER_INTRA = 0x2, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_INTRA_EDGE_FILTER = 0x4, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_INTERINTRA_COMPOUND = 0x8, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_MASKED_COMPOUND = 0x10, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_WARPED_MOTION = 0x20, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_DUAL_FILTER = 0x40, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_JNT_COMP = 0x80, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_FORCED_INTEGER_MOTION_VECTORS = 0x100, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_SUPER_RESOLUTION = 0x200, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_LOOP_RESTORATION_FILTER = 0x400, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_PALETTE_ENCODING = 0x800, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_CDEF_FILTERING = 0x1000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_INTRA_BLOCK_COPY = 0x2000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_FRAME_REFERENCE_MOTION_VECTORS = 0x4000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_ORDER_HINT_TOOLS = 0x8000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_AUTO_SEGMENTATION = 0x10000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_CUSTOM_SEGMENTATION = 0x20000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_LOOP_FILTER_DELTAS = 0x40000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_QUANTIZATION_DELTAS = 0x80000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_QUANTIZATION_MATRIX = 0x100000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_REDUCED_TX_SET = 0x200000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_MOTION_MODE_SWITCHABLE = 0x400000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_ALLOW_HIGH_PRECISION_MV = 0x800000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_SKIP_MODE_PRESENT = 0x1000000, + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAG_DELTA_LF_PARAMS = 0x2000000, +} D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS)") + +typedef enum D3D12_VIDEO_ENCODER_AV1_TX_MODE { + D3D12_VIDEO_ENCODER_AV1_TX_MODE_ONLY4x4 = 0, + D3D12_VIDEO_ENCODER_AV1_TX_MODE_LARGEST = 1, + D3D12_VIDEO_ENCODER_AV1_TX_MODE_SELECT = 2, +} D3D12_VIDEO_ENCODER_AV1_TX_MODE; + +typedef enum D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS { + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_ONLY4x4 = (1 << D3D12_VIDEO_ENCODER_AV1_TX_MODE_ONLY4x4), + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_LARGEST = (1 << D3D12_VIDEO_ENCODER_AV1_TX_MODE_LARGEST), + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAG_SELECT = (1 << D3D12_VIDEO_ENCODER_AV1_TX_MODE_SELECT), +} D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS)") + +typedef enum D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS { + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP = 0, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SMOOTH = 1, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SHARP = 2, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_BILINEAR = 3, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_SWITCHABLE = 4, +} D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS; + +typedef enum D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS { + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_EIGHTTAP = (1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP), + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_EIGHTTAP_SMOOTH = (1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SMOOTH), + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_EIGHTTAP_SHARP = (1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_EIGHTTAP_SHARP), + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_BILINEAR = (1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_BILINEAR), + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAG_SWITCHABLE = (1 << D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_SWITCHABLE), +} D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS)") + +typedef enum D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE { + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_4x4 = 0, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_8x8 = 1, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_16x16 = 2, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_32x32 = 3, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE_64x64 = 4, +} D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE; + +typedef enum D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE { + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_DISABLED = 0, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_Q = 1, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_V = 2, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_H = 3, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_U = 4, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_V = 5, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_REF_FRAME = 6, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_SKIP = 7, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_GLOBALMV = 8, +} D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE; + +typedef enum D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS { + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_DISABLED = (1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_DISABLED), + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_Q = (1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_Q), + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_Y_V = (1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_V), + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_Y_H = (1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_Y_H), + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_U = (1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_U), + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_LF_V = (1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_LF_V), + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_REF_FRAME = (1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_REF_FRAME), + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_SKIP = (1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_SKIP), + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAG_ALT_GLOBALMV = (1 << D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_ALT_GLOBALMV), +} D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS)") + +typedef enum D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE { + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_DISABLED = 0, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_SWITCHABLE = 1, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_WIENER = 2, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE_SGRPROJ = 3, +} D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE; + +typedef enum D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE { + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_DISABLED = 0, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_32x32 = 1, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_64x64 = 2, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_128x128 = 3, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE_256x256 = 4, +} D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE; + +typedef enum D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS { + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_NOT_SUPPORTED = 0x0, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_32x32 = 0x1, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_64x64 = 0x2, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_128x128 = 0x4, + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAG_256x256 = 0x8, +} D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS)") + +typedef enum D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION +{ + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_IDENTITY = 0, + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_TRANSLATION = 1, + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_ROTZOOM = 2, + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_AFFINE = 3, +} D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION; + +typedef enum D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS { + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_NONE = 0, // None is supported, reference warp motion arguments are ignored and is_global syntax is false for all references + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_IDENTITY = (1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_IDENTITY), + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_TRANSLATION = (1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_TRANSLATION), + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_ROTZOOM = (1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_ROTZOOM), + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAG_AFFINE = (1 << D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_AFFINE), +} D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS)") + +typedef enum D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS { + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_QUANTIZATION = 0x1, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_QUANTIZATION_DELTA = 0x2, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_LOOP_FILTER = 0x4, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_LOOP_FILTER_DELTA = 0x8, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_CDEF_DATA = 0x10, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_CONTEXT_UPDATE_TILE_ID = 0x20, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_COMPOUND_PREDICTION_MODE = 0x40, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_PRIMARY_REF_FRAME = 0x80, + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAG_REFERENCE_INDICES = 0x100, +} D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS)") + +typedef struct D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION_SUPPORT { + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS SupportedFeatureFlags; + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS RequiredFeatureFlags; + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS_FLAGS SupportedInterpolationFilters; + D3D12_VIDEO_ENCODER_AV1_RESTORATION_SUPPORT_FLAGS SupportedRestorationParams[3][3]; + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS SupportedSegmentationModes; + D3D12_VIDEO_ENCODER_AV1_TX_MODE_FLAGS SupportedTxModes[4]; // Different for D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE types + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_BLOCK_SIZE SegmentationBlockSize; + D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES_FLAGS PostEncodeValuesFlags; + UINT MaxTemporalLayers; + UINT MaxSpatialLayers; +} D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION_SUPPORT; + +typedef enum D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE +{ + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_KEY_FRAME = 0, + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTER_FRAME = 1, + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTRA_ONLY_FRAME = 2, + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_SWITCH_FRAME = 3, +} D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE; + +typedef enum D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS { + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_KEY_FRAME = (1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_KEY_FRAME), + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_INTER_FRAME = (1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTER_FRAME), + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_INTRA_ONLY_FRAME = (1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_INTRA_ONLY_FRAME), + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAG_SWITCH_FRAME = (1 << D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_SWITCH_FRAME), +} D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS)") + +typedef enum D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE +{ + D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE_SINGLE_REFERENCE = 0, + D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE_COMPOUND_REFERENCE = 1, +} D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_PICTURE_CONTROL_SUPPORT { + D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE PredictionMode; + UINT MaxUniqueReferencesPerFrame; + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE_FLAGS SupportedFrameTypes; + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS SupportedReferenceWarpedMotionFlags; +} D3D12_VIDEO_ENCODER_CODEC_AV1_PICTURE_CONTROL_SUPPORT; + +typedef struct D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION { + D3D12_VIDEO_ENCODER_AV1_FEATURE_FLAGS FeatureFlags; + UINT OrderHintBitsMinus1; +} D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION; + +typedef struct D3D12_VIDEO_ENCODER_AV1_SEQUENCE_STRUCTURE +{ + UINT IntraDistance; + UINT InterFramePeriod; +} D3D12_VIDEO_ENCODER_AV1_SEQUENCE_STRUCTURE; + +typedef struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO +{ + D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION TransformationType; + INT TransformationMatrix[8]; + BOOL InvalidAffineSet; // Valid or invalid on affine set +} D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO; + +typedef struct D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR +{ + UINT ReconstructedPictureResourceIndex; + UINT TemporalLayerIndexPlus1; + UINT SpatialLayerIndexPlus1; + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE FrameType; + // Only used if supported in D3D12_VIDEO_ENCODER_AV1_REFERENCE_WARPED_MOTION_TRANSFORMATION_FLAGS, ignored by driver otherwise + D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_WARPED_MOTION_INFO WarpedMotionInfo; + UINT OrderHint; + UINT PictureIndex; +} D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR; + +typedef enum D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS +{ + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_ERROR_RESILIENT_MODE = 0x1, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_DISABLE_CDF_UPDATE = 0x2, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_PALETTE_ENCODING = 0x4, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_SKIP_MODE = 0x8, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_FRAME_REFERENCE_MOTION_VECTORS = 0x10, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_FORCE_INTEGER_MOTION_VECTORS = 0x20, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ALLOW_INTRA_BLOCK_COPY = 0x40, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_USE_SUPER_RESOLUTION = 0x80, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_DISABLE_FRAME_END_UPDATE_CDF = 0x100, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_FRAME_SEGMENTATION_AUTO = 0x200, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_FRAME_SEGMENTATION_CUSTOM = 0x400, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ENABLE_WARPED_MOTION = 0x800, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_REDUCED_TX_SET = 0x1000, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_MOTION_MODE_SWITCHABLE = 0x2000, + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAG_ALLOW_HIGH_PRECISION_MV = 0x4000, + +} D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS)") + +typedef struct D3D12_VIDEO_ENCODER_AV1_RESTORATION_CONFIG { + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TYPE FrameRestorationType[3]; + D3D12_VIDEO_ENCODER_AV1_RESTORATION_TILESIZE LoopRestorationPixelSize[3]; +} D3D12_VIDEO_ENCODER_AV1_RESTORATION_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_AV1_SEGMENT_DATA { + UINT64 EnabledFeatures; // D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE_FLAGS + // For the enabled features in EnabledFeatures, the array below + // is indexed by D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MODE - 1 + INT64 FeatureValue[8]; +} D3D12_VIDEO_ENCODER_AV1_SEGMENT_DATA; + +typedef struct D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG { + UINT64 UpdateMap; + UINT64 TemporalUpdate; + UINT64 UpdateData; + UINT64 NumSegments; + D3D12_VIDEO_ENCODER_AV1_SEGMENT_DATA SegmentsData[8]; +} D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MAP { + UINT SegmentsMapByteSize; + UINT8* pSegmentsMap; +} D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MAP; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG { + UINT64 LoopFilterLevel[2]; + UINT64 LoopFilterLevelU; + UINT64 LoopFilterLevelV; + UINT64 LoopFilterSharpnessLevel; + UINT64 LoopFilterDeltaEnabled; + // loop_filter_delta_update = UpdateRefDelta || UpdateModeDelta + UINT64 UpdateRefDelta; + INT64 RefDeltas[8]; + UINT64 UpdateModeDelta; + INT64 ModeDeltas[2]; +} D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG { + UINT64 DeltaLFPresent; + UINT64 DeltaLFMulti; + UINT64 DeltaLFRes; +} D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG { + UINT64 BaseQIndex; + INT64 YDCDeltaQ; + INT64 UDCDeltaQ; + INT64 UACDeltaQ; + INT64 VDCDeltaQ; + INT64 VACDeltaQ; + UINT64 UsingQMatrix; + UINT64 QMY; + UINT64 QMU; + UINT64 QMV; +} D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG { + UINT64 DeltaQPresent; + UINT64 DeltaQRes; +} D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG { + UINT64 CdefBits; + UINT64 CdefDampingMinus3; + UINT64 CdefYPriStrength[8]; + UINT64 CdefUVPriStrength[8]; + UINT64 CdefYSecStrength[8]; + UINT64 CdefUVSecStrength[8]; +} D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG; + +typedef struct D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_CODEC_DATA +{ + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_AV1_FRAME_TYPE FrameType; + D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE CompoundPredictionType; + D3D12_VIDEO_ENCODER_AV1_INTERPOLATION_FILTERS InterpolationFilter; + D3D12_VIDEO_ENCODER_AV1_RESTORATION_CONFIG FrameRestorationConfig; + D3D12_VIDEO_ENCODER_AV1_TX_MODE TxMode; + UINT SuperResDenominator; + UINT OrderHint; + UINT PictureIndex; + UINT TemporalLayerIndexPlus1; + UINT SpatialLayerIndexPlus1; + D3D12_VIDEO_ENCODER_AV1_REFERENCE_PICTURE_DESCRIPTOR ReferenceFramesReconPictureDescriptors[8]; + UINT ReferenceIndices[7]; + UINT PrimaryRefFrame; + UINT RefreshFrameFlags; + D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG LoopFilter; + D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG LoopFilterDelta; + D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG Quantization; + D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG QuantizationDelta; + D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG CDEF; + UINT QPMapValuesCount; + [annotation("_Field_size_full_(QPMapValuesCount)")] INT16* pRateControlQPMap; + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG CustomSegmentation; + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_MAP CustomSegmentsMap; +} D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_CODEC_DATA; + +typedef struct D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES +{ + UINT64 RowCount; + UINT64 ColCount; + UINT64 RowHeights[D3D12_VIDEO_ENCODER_AV1_MAX_TILE_ROWS]; + UINT64 ColWidths[D3D12_VIDEO_ENCODER_AV1_MAX_TILE_COLS]; + UINT64 ContextUpdateTileId; +} D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES; + +typedef struct D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES +{ + UINT64 CompoundPredictionType; // D3D12_VIDEO_ENCODER_AV1_COMP_PREDICTION_TYPE + D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_CONFIG LoopFilter; + D3D12_VIDEO_ENCODER_CODEC_AV1_LOOP_FILTER_DELTA_CONFIG LoopFilterDelta; + D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_CONFIG Quantization; + D3D12_VIDEO_ENCODER_CODEC_AV1_QUANTIZATION_DELTA_CONFIG QuantizationDelta; + D3D12_VIDEO_ENCODER_AV1_CDEF_CONFIG CDEF; + D3D12_VIDEO_ENCODER_AV1_SEGMENTATION_CONFIG SegmentationConfig; + UINT64 PrimaryRefFrame; // Aligned to 64 for use of post encode metadata with predication + UINT64 ReferenceIndices[7]; // Aligned to 64 for use of post encode metadata with predication +} D3D12_VIDEO_ENCODER_AV1_POST_ENCODE_VALUES; + // // Rate control API // @@ -1484,8 +1917,10 @@ typedef enum D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_INITIAL_QP = 0x8, D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_MAX_FRAME_SIZE = 0x10, D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_VBV_SIZES = 0x20, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_EXTENSION1_SUPPORT = 0x40, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_QUALITY_VS_SPEED = 0x80, } D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP { UINT ConstantQP_FullIntracodedFrame; @@ -1493,6 +1928,13 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP { UINT ConstantQP_InterPredictedFrame_BiDirectionalRef; } D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP; +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP1 { + UINT ConstantQP_FullIntracodedFrame; + UINT ConstantQP_InterPredictedFrame_PrevRefOnly; + UINT ConstantQP_InterPredictedFrame_BiDirectionalRef; + UINT QualityVsSpeed; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP1; + typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR { UINT InitialQP; UINT MinQP; @@ -1503,6 +1945,17 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR { UINT64 InitialVBVFullness; } D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR; +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR1 { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + UINT QualityVsSpeed; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR1; + typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR { UINT InitialQP; UINT MinQP; @@ -1514,6 +1967,18 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR { UINT64 InitialVBVFullness; } D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR; +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR1 { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + UINT QualityVsSpeed; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR1; + typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR { UINT InitialQP; UINT MinQP; @@ -1524,6 +1989,24 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR { UINT ConstantQualityTarget; } D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR; +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR1 +{ + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT ConstantQualityTarget; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + UINT QualityVsSpeed; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR1; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_ABSOLUTE_QP_MAP { + UINT QualityVsSpeed; +} D3D12_VIDEO_ENCODER_RATE_CONTROL_ABSOLUTE_QP_MAP; + typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS { UINT DataSize; @@ -1532,7 +2015,12 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS const D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP* pConfiguration_CQP; const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR* pConfiguration_CBR; const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR* pConfiguration_VBR; - const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR* pConfiguration_QVBR; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR* pConfiguration_QVBR; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP1* pConfiguration_CQP1; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR1* pConfiguration_CBR1; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR1* pConfiguration_VBR1; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR1* pConfiguration_QVBR1; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_ABSOLUTE_QP_MAP* pConfiguration_AbsoluteQPMap; }; } D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS; @@ -1550,7 +2038,8 @@ typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL { typedef enum D3D12_VIDEO_ENCODER_CODEC { D3D12_VIDEO_ENCODER_CODEC_H264 = 0, - D3D12_VIDEO_ENCODER_CODEC_HEVC = 1, + D3D12_VIDEO_ENCODER_CODEC_HEVC = 1, + D3D12_VIDEO_ENCODER_CODEC_AV1 = 2, } D3D12_VIDEO_ENCODER_CODEC; typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC @@ -1571,6 +2060,13 @@ typedef enum D3D12_VIDEO_ENCODER_PROFILE_HEVC { D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN = 0, D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10 = 1, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN12 = 2, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10_422 = 3, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN12_422 = 4, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN_444 = 5, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10_444 = 6, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN12_444 = 7, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN16_444 = 8, } D3D12_VIDEO_ENCODER_PROFILE_HEVC; typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC @@ -1580,6 +2076,7 @@ typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC { D3D12_VIDEO_ENCODER_PROFILE_H264* pH264Profile; D3D12_VIDEO_ENCODER_PROFILE_HEVC* pHEVCProfile; + D3D12_VIDEO_ENCODER_AV1_PROFILE* pAV1Profile; }; } D3D12_VIDEO_ENCODER_PROFILE_DESC; @@ -1643,6 +2140,7 @@ typedef struct D3D12_VIDEO_ENCODER_LEVEL_SETTING { D3D12_VIDEO_ENCODER_LEVELS_H264* pH264LevelSetting; D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC* pHEVCLevelSetting; + D3D12_VIDEO_ENCODER_AV1_LEVEL_TIER_CONSTRAINTS* pAV1LevelSetting; }; } D3D12_VIDEO_ENCODER_LEVEL_SETTING; @@ -1727,6 +2225,8 @@ typedef enum D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED = 2, D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION = 3, D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME = 4, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_GRID_PARTITION = 5, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_CONFIGURABLE_GRID_PARTITION = 6, } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE @@ -1739,11 +2239,62 @@ typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE BOOL IsSupported; // output } D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; +typedef enum D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS +{ + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_NONE = 0x0, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_NOT_SPECIFIED = 0x1, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_CODEC_CONSTRAINT = 0x2, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_HARDWARE_CONSTRAINT = 0x4, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_ROWS_COUNT = 0x8, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_COLS_COUNT = 0x10, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_WIDTH = 0x20, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_AREA = 0x40, + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAG_TOTAL_TILES = 0x80, + +} D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS)") + +typedef struct D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT +{ + BOOL Use128SuperBlocks; + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES TilesConfiguration; + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_VALIDATION_FLAGS ValidationFlags; + UINT MinTileRows; + UINT MaxTileRows; + UINT MinTileCols; + UINT MaxTileCols; + UINT MinTileWidth; + UINT MaxTileWidth; + UINT MinTileArea; + UINT MaxTileArea; + UINT TileSizeBytesMinus1; +} D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT; + +typedef struct D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_AV1_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT* pAV1Support; + }; +} D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG +{ + UINT NodeIndex; // input + D3D12_VIDEO_ENCODER_CODEC Codec; // input + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; // input + D3D12_VIDEO_ENCODER_LEVEL_SETTING Level; // input + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionMode; // input + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC FrameResolution; // input + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG_SUPPORT CodecSupport; // input/output + BOOL IsSupported; // output +} D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_CONFIG; + typedef enum D3D12_VIDEO_ENCODER_HEAP_FLAGS { D3D12_VIDEO_ENCODER_HEAP_FLAG_NONE = 0x0, } D3D12_VIDEO_ENCODER_HEAP_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_HEAP_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_HEAP_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_HEAP_DESC { @@ -1773,8 +2324,9 @@ typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_SPATIAL_ENCODING_SUPPORT = 0x10, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_TEMPORAL_ENCODING_SUPPORT = 0x20, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x40, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE_FLAG_SLICE_SUPPORT = 0x80, } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS)") typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = 0, @@ -1796,7 +2348,7 @@ typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = (1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES), D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = (1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING), } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS SupportFlags; @@ -1815,8 +2367,32 @@ typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_SUPPORT = 0x40, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_DISABLING_LOOP_FILTER_ACROSS_SLICES_SUPPORT = 0x80, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_P_FRAMES_IMPLEMENTED_AS_LOW_DELAY_B_FRAMES = 0x100, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE_FLAG_SLICE_SUPPORT = 0x200, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_ROTATION_ENABLED_SUPPORT = 0x400, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_ROTATION_ENABLED_REQUIRED = 0x800, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_CONTEXT_ENABLED_SUPPORT = 0x1000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_CONTEXT_ENABLED_REQUIRED = 0x2000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_IMPLICIT_RDPCM_ENABLED_SUPPORT = 0x4000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_IMPLICIT_RDPCM_ENABLED_REQUIRED = 0x8000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_EXPLICIT_RDPCM_ENABLED_SUPPORT = 0x10000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_EXPLICIT_RDPCM_ENABLED_REQUIRED = 0x20000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_EXTENDED_PRECISION_PROCESSING_SUPPORT = 0x40000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_EXTENDED_PRECISION_PROCESSING_REQUIRED = 0x80000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_INTRA_SMOOTHING_DISABLED_SUPPORT = 0x100000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_INTRA_SMOOTHING_DISABLED_REQUIRED = 0x200000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_HIGH_PRECISION_OFFSETS_ENABLED_SUPPORT = 0x400000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_HIGH_PRECISION_OFFSETS_ENABLED_REQUIRED = 0x800000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_PERSISTENT_RICE_ADAPTATION_ENABLED_SUPPORT = 0x1000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_PERSISTENT_RICE_ADAPTATION_ENABLED_REQUIRED = 0x2000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CABAC_BYPASS_ALIGNMENT_ENABLED_SUPPORT = 0x4000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CABAC_BYPASS_ALIGNMENT_ENABLED_REQUIRED = 0x8000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CROSS_COMPONENT_PREDICTION_ENABLED_FLAG_SUPPORT = 0x10000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CROSS_COMPONENT_PREDICTION_ENABLED_FLAG_REQUIRED = 0x20000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CHROMA_QP_OFFSET_LIST_ENABLED_FLAG_SUPPORT = 0x40000000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CHROMA_QP_OFFSET_LIST_ENABLED_FLAG_REQUIRED = 0x80000000, // 2^31 - 32 bit integer enum type + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS)") typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_8x8 = 0, @@ -1842,12 +2418,41 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC { UCHAR max_transform_hierarchy_depth_intra; } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC; + +typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS1 +{ + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG1_NONE = 0x0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG1_SEPARATE_COLOUR_PLANE_SUPPORT = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG1_SEPARATE_COLOUR_PLANE_REQUIRED = 0x2, +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS1; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS1)") + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC1 { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize; + UCHAR max_transform_hierarchy_depth_inter; + UCHAR max_transform_hierarchy_depth_intra; + UINT allowed_diff_cu_chroma_qp_offset_depth_values; + UINT allowed_log2_sao_offset_scale_luma_values; + UINT allowed_log2_sao_offset_scale_chroma_values; + UINT allowed_log2_max_transform_skip_block_size_minus2_values; + UINT allowed_chroma_qp_offset_list_len_minus1_values; + UINT allowed_cb_qp_offset_list_values[6]; + UINT allowed_cr_qp_offset_list_values[6]; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS1 SupportFlags1; +} D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC1; + typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT { UINT DataSize; union { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264* pH264Support; D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC* pHEVCSupport; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC1* pHEVCSupport1; + D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION_SUPPORT* pAV1Support; }; } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT; @@ -1881,6 +2486,7 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT { { D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264* pH264Support; D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC* pHEVCSupport; + D3D12_VIDEO_ENCODER_CODEC_AV1_PICTURE_CONTROL_SUPPORT* pAV1Support; }; } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT; @@ -1908,8 +2514,11 @@ typedef enum D3D12_VIDEO_ENCODER_SUPPORT_FLAGS D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_MAX_FRAME_SIZE_AVAILABLE = 0x400, D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SEQUENCE_GOP_RECONFIGURATION_AVAILABLE = 0x800, D3D12_VIDEO_ENCODER_SUPPORT_FLAG_MOTION_ESTIMATION_PRECISION_MODE_LIMIT_AVAILABLE = 0x1000, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_EXTENSION1_SUPPORT = 0x2000, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_QUALITY_VS_SPEED_AVAILABLE = 0x4000, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_READABLE_RECONSTRUCTED_PICTURE_LAYOUT_AVAILABLE = 0x8000, } D3D12_VIDEO_ENCODER_SUPPORT_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SUPPORT_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SUPPORT_FLAGS)") typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS { @@ -1919,7 +2528,7 @@ typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ENABLE_CABAC_ENCODING = 0x4, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x8, } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS)") typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_DISABLED = 0, @@ -1944,8 +2553,18 @@ typedef enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_ASYMETRIC_MOTION_PARTITION = 0x10, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_TRANSFORM_SKIPPING = 0x20, D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x40, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_TRANSFORM_SKIP_ROTATION = 0x80, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_TRANSFORM_SKIP_CONTEXT = 0x100, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_IMPLICIT_RDPCM = 0x200, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_EXPLICIT_RDPCM = 0x400, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_EXTENDED_PRECISION_PROCESSING = 0x800, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_INTRA_SMOOTHING_DISABLED = 0x1000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_HIGH_PRECISION_OFFSETS = 0x2000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_PERSISTENT_RICE_ADAPTATION = 0x4000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_CABAC_BYPASS_ALIGNMENT = 0x8000, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_SEPARATE_COLOUR_PLANE = 0x10000, } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS ConfigurationFlags; @@ -1964,6 +2583,7 @@ typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION { D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264* pH264Config; D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC* pHEVCConfig; + D3D12_VIDEO_ENCODER_AV1_CODEC_CONFIGURATION* pAV1Config; }; } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION; @@ -1980,6 +2600,7 @@ typedef enum D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_FULL_PIXEL = 1, D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_HALF_PIXEL = 2, D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_QUARTER_PIXEL = 3, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_EIGHTH_PIXEL = 4, } D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE; typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS @@ -2002,8 +2623,9 @@ typedef enum D3D12_VIDEO_ENCODER_VALIDATION_FLAGS D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_MODE_NOT_SUPPORTED = 0x100, D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RESOLUTION_NOT_SUPPORTED_IN_LIST = 0x200, D3D12_VIDEO_ENCODER_VALIDATION_FLAG_GOP_STRUCTURE_NOT_SUPPORTED = 0x800, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_DATA_NOT_SUPPORTED = 0x1000, } D3D12_VIDEO_ENCODER_VALIDATION_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_VALIDATION_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_VALIDATION_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 { @@ -2028,6 +2650,7 @@ typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE { D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264* pH264GroupOfPictures; D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC* pHEVCGroupOfPictures; + D3D12_VIDEO_ENCODER_AV1_SEQUENCE_STRUCTURE* pAV1SequenceStructure; }; } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE; @@ -2056,6 +2679,61 @@ typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT [annotation("_Field_size_full_(ResolutionsListCount)")] D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS* pResolutionDependentSupport; } D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT; +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES +{ + // Mutually exclusive options according to selected mode + union + { + // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION + UINT MaxBytesPerSlice; + + // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED + UINT NumberOfCodingUnitsPerSlice; + + // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION + UINT NumberOfRowsPerSlice; + + // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME + UINT NumberOfSlicesPerFrame; + }; +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA +{ + UINT DataSize; + union + { + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES* pSlicesPartition_H264; + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES* pSlicesPartition_HEVC; + const D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_TILES* pTilesPartition_AV1; + }; + +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1 +{ + /* Below match existing D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT */ + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence; + D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl; + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefresh; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionFrameEncoding; + UINT ResolutionsListCount; + const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC* pResolutionList; + UINT MaxReferenceFramesInDPB; + D3D12_VIDEO_ENCODER_VALIDATION_FLAGS ValidationFlags; + D3D12_VIDEO_ENCODER_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel; + [annotation("_Field_size_full_(ResolutionsListCount)")] D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS* pResolutionDependentSupport; + + /* Below are new arguments for D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1 */ + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA SubregionFrameEncodingData; // input + UINT MaxQualityVsSpeed; +} D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT1; typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS { @@ -2079,7 +2757,7 @@ typedef enum D3D12_VIDEO_ENCODER_FLAGS { D3D12_VIDEO_ENCODER_FLAG_NONE = 0x0, } D3D12_VIDEO_ENCODER_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_DESC { @@ -2165,8 +2843,9 @@ typedef enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS { D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_NONE = 0x0, D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_REQUEST_NUM_REF_IDX_ACTIVE_OVERRIDE_FLAG_SLICE = 0x2, } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION { @@ -2231,8 +2910,11 @@ typedef enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS { D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_NONE = 0x0, D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_REQUEST_NUM_REF_IDX_ACTIVE_OVERRIDE_FLAG_SLICE = 0x2, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_CROSS_COMPONENT_PREDICTION = 0x4, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_CHROMA_QP_OFFSET_LIST = 0x8, } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC { @@ -2255,6 +2937,34 @@ typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC [annotation("_Field_size_full_(QPMapValuesCount)")] INT8 *pRateControlQPMap; } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC; +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC1 +{ + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS Flags; + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC FrameType; + UINT slice_pic_parameter_set_id; + UINT PictureOrderCountNumber; + UINT TemporalLayerIndex; + UINT List0ReferenceFramesCount; + [annotation("_Field_size_full_(List0ReferenceFramesCount)")] UINT* pList0ReferenceFrames; + UINT List1ReferenceFramesCount; + [annotation("_Field_size_full_(List1ReferenceFramesCount)")] UINT* pList1ReferenceFrames; + UINT ReferenceFramesReconPictureDescriptorsCount; + [annotation("_Field_size_full_(ReferenceFramesReconPictureDescriptorsCount)")] D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC* pReferenceFramesReconPictureDescriptors; + UINT List0RefPicModificationsCount; + [annotation("_Field_size_full_(List0RefPicModificationsCount)")] UINT* pList0RefPicModifications; + UINT List1RefPicModificationsCount; + [annotation("_Field_size_full_(List1RefPicModificationsCount)")] UINT* pList1RefPicModifications; + UINT QPMapValuesCount; + [annotation("_Field_size_full_(QPMapValuesCount)")] INT8* pRateControlQPMap; + UCHAR diff_cu_chroma_qp_offset_depth; + UCHAR log2_sao_offset_scale_luma; + UCHAR log2_sao_offset_scale_chroma; + UCHAR log2_max_transform_skip_block_size_minus2; + UCHAR chroma_qp_offset_list_len_minus1; + CHAR cb_qp_offset_list[6]; + CHAR cr_qp_offset_list[6]; +} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC1; + typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA { UINT DataSize; @@ -2262,6 +2972,8 @@ typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA { D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264* pH264PicData; D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC* pHEVCPicData; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC1* pHEVCPicData1; + D3D12_VIDEO_ENCODER_AV1_PICTURE_CONTROL_CODEC_DATA* pAV1PicData; }; } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA; @@ -2277,7 +2989,7 @@ typedef enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_NONE = 0x0, D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_USED_AS_REFERENCE_PICTURE = 0x1, } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC { @@ -2296,37 +3008,7 @@ typedef enum D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_REQUEST_INTRA_REFRESH = 0x8, D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_GOP_SEQUENCE_CHANGE = 0x10, } D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS);") - -typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES -{ - // Mutually exclusive options according to selected mode - union - { - // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION - UINT MaxBytesPerSlice; - - // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED - UINT NumberOfCodingUnitsPerSlice; - - // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION - UINT NumberOfRowsPerSlice; - - // Use with mode: D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME - UINT NumberOfSlicesPerFrame; - }; -} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES; - -typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA -{ - UINT DataSize; - union - { - const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES* pSlicesPartition_H264; - const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES* pSlicesPartition_HEVC; - }; - -} D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA; +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC { @@ -2380,7 +3062,7 @@ typedef enum D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_RECONFIGURATION_REQUEST_NOT_SUPPORTED = 0x8, D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_METADATA_BUFFER_SOURCE = 0x10, } D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS; -cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS);") +cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS)") typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS { @@ -2451,7 +3133,7 @@ interface ID3D12VideoEncodeCommandList3 void Barrier( UINT32 NumBarrierGroups, [annotation("_In_reads_(NumBarrierGroups)")] const D3D12_BARRIER_GROUP *pBarrierGroups - ); + ); } cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */") diff --git a/deps/DirectX-Headers/include/directx/d3dcommon.h b/deps/DirectX-Headers/include/directx/d3dcommon.h index bcddaa3..ac51253 100644 --- a/deps/DirectX-Headers/include/directx/d3dcommon.h +++ b/deps/DirectX-Headers/include/directx/d3dcommon.h @@ -93,6 +93,7 @@ enum D3D_DRIVER_TYPE typedef enum D3D_FEATURE_LEVEL { + D3D_FEATURE_LEVEL_1_0_GENERIC = 0x100, D3D_FEATURE_LEVEL_1_0_CORE = 0x1000, D3D_FEATURE_LEVEL_9_1 = 0x9100, D3D_FEATURE_LEVEL_9_2 = 0x9200, @@ -389,6 +390,10 @@ enum D3D_SRV_DIMENSION #define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000 #define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000 #define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000 +#define D3D_SHADER_FEATURE_SAMPLE_CMP_GRADIENT_OR_BIAS 0x80000000 +#define D3D_SHADER_FEATURE_EXTENDED_COMMAND_INFO 0x100000000ull +#define D3D_OPT_SHADER_FEATURE_USES_DERIVATIVES 0x0000010000000000ull +#define D3D_OPT_SHADER_FEATURE_REQUIRES_GROUP 0x0000020000000000ull typedef struct _D3D_SHADER_MACRO { LPCSTR Name; @@ -960,10 +965,22 @@ enum D3D_REGISTER_COMPONENT_TYPE D3D_REGISTER_COMPONENT_UINT32 = 1, D3D_REGISTER_COMPONENT_SINT32 = 2, D3D_REGISTER_COMPONENT_FLOAT32 = 3, + D3D_REGISTER_COMPONENT_UINT16 = 4, + D3D_REGISTER_COMPONENT_SINT16 = 5, + D3D_REGISTER_COMPONENT_FLOAT16 = 6, + D3D_REGISTER_COMPONENT_UINT64 = 7, + D3D_REGISTER_COMPONENT_SINT64 = 8, + D3D_REGISTER_COMPONENT_FLOAT64 = 9, D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN, D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32, D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32, - D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32 + D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32, + D3D10_REGISTER_COMPONENT_UINT16 = D3D_REGISTER_COMPONENT_UINT16, + D3D10_REGISTER_COMPONENT_SINT16 = D3D_REGISTER_COMPONENT_SINT16, + D3D10_REGISTER_COMPONENT_FLOAT16 = D3D_REGISTER_COMPONENT_FLOAT16, + D3D10_REGISTER_COMPONENT_UINT64 = D3D_REGISTER_COMPONENT_UINT64, + D3D10_REGISTER_COMPONENT_SINT64 = D3D_REGISTER_COMPONENT_SINT64, + D3D10_REGISTER_COMPONENT_FLOAT64 = D3D_REGISTER_COMPONENT_FLOAT64 } D3D_REGISTER_COMPONENT_TYPE; typedef diff --git a/deps/DirectX-Headers/include/directx/d3dcommon.idl b/deps/DirectX-Headers/include/directx/d3dcommon.idl index d63d163..6ad5de7 100644 --- a/deps/DirectX-Headers/include/directx/d3dcommon.idl +++ b/deps/DirectX-Headers/include/directx/d3dcommon.idl @@ -25,6 +25,7 @@ typedef enum D3D_DRIVER_TYPE typedef enum D3D_FEATURE_LEVEL { + D3D_FEATURE_LEVEL_1_0_GENERIC = 0x100, D3D_FEATURE_LEVEL_1_0_CORE = 0x1000, D3D_FEATURE_LEVEL_9_1 = 0x9100, D3D_FEATURE_LEVEL_9_2 = 0x9200, @@ -329,6 +330,20 @@ cpp_quote("#define D3D_SHADER_FEATURE_WAVE_MMA cpp_quote("#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000") cpp_quote("#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000") cpp_quote("#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000") +cpp_quote("#define D3D_SHADER_FEATURE_SAMPLE_CMP_GRADIENT_OR_BIAS 0x80000000") +cpp_quote("#define D3D_SHADER_FEATURE_EXTENDED_COMMAND_INFO 0x100000000ull") + +// This section is for flags that do not directly indicate a required feature, +// but are used to indicate something about the shader. + +// Flag for any derivative use. This allows call-graph validation +// in the runtime to detect misuse of derivatives for an entry point that cannot +// support it, or to determine when the flag +// D3D_SHADER_FEATURE_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS is required. +cpp_quote("#define D3D_OPT_SHADER_FEATURE_USES_DERIVATIVES 0x0000010000000000ull") + +cpp_quote("#define D3D_OPT_SHADER_FEATURE_REQUIRES_GROUP 0x0000020000000000ull") + // Additional internal shader feature flags are listed in dxbcutils.h (not relevant/useful for public to see) // When adding entries here, make sure they don't conflict with what's there. @@ -806,11 +821,23 @@ typedef enum D3D_REGISTER_COMPONENT_TYPE D3D_REGISTER_COMPONENT_UINT32 = 1, D3D_REGISTER_COMPONENT_SINT32 = 2, D3D_REGISTER_COMPONENT_FLOAT32 = 3, + D3D_REGISTER_COMPONENT_UINT16 = 4, + D3D_REGISTER_COMPONENT_SINT16 = 5, + D3D_REGISTER_COMPONENT_FLOAT16 = 6, + D3D_REGISTER_COMPONENT_UINT64 = 7, + D3D_REGISTER_COMPONENT_SINT64 = 8, + D3D_REGISTER_COMPONENT_FLOAT64 = 9, D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN, D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32, D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32, D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32, + D3D10_REGISTER_COMPONENT_UINT16 = D3D_REGISTER_COMPONENT_UINT16, + D3D10_REGISTER_COMPONENT_SINT16 = D3D_REGISTER_COMPONENT_SINT16, + D3D10_REGISTER_COMPONENT_FLOAT16 = D3D_REGISTER_COMPONENT_FLOAT16, + D3D10_REGISTER_COMPONENT_UINT64 = D3D_REGISTER_COMPONENT_UINT64, + D3D10_REGISTER_COMPONENT_SINT64 = D3D_REGISTER_COMPONENT_SINT64, + D3D10_REGISTER_COMPONENT_FLOAT64 = D3D_REGISTER_COMPONENT_FLOAT64, } D3D_REGISTER_COMPONENT_TYPE; typedef enum D3D_TESSELLATOR_DOMAIN diff --git a/deps/DirectX-Headers/include/directx/d3dx12.h b/deps/DirectX-Headers/include/directx/d3dx12.h index ab68ca5..eb9200b 100644 --- a/deps/DirectX-Headers/include/directx/d3dx12.h +++ b/deps/DirectX-Headers/include/directx/d3dx12.h @@ -19,6 +19,7 @@ #include "d3dx12_render_pass.h" #include "d3dx12_resource_helpers.h" #include "d3dx12_root_signature.h" +#include "d3dx12_property_format_table.h" #ifndef D3DX12_NO_STATE_OBJECT_HELPERS #include "d3dx12_state_object.h" diff --git a/deps/DirectX-Headers/include/directx/d3dx12_barriers.h b/deps/DirectX-Headers/include/directx/d3dx12_barriers.h index 0c17c2d..2c2b135 100644 --- a/deps/DirectX-Headers/include/directx/d3dx12_barriers.h +++ b/deps/DirectX-Headers/include/directx/d3dx12_barriers.h @@ -37,8 +37,8 @@ struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER return result; } static inline CD3DX12_RESOURCE_BARRIER Aliasing( - _In_ ID3D12Resource* pResourceBefore, - _In_ ID3D12Resource* pResourceAfter) noexcept + _In_opt_ ID3D12Resource* pResourceBefore, + _In_opt_ ID3D12Resource* pResourceAfter) noexcept { CD3DX12_RESOURCE_BARRIER result = {}; D3D12_RESOURCE_BARRIER &barrier = result; @@ -48,7 +48,7 @@ struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER return result; } static inline CD3DX12_RESOURCE_BARRIER UAV( - _In_ ID3D12Resource* pResource) noexcept + _In_opt_ ID3D12Resource* pResource) noexcept { CD3DX12_RESOURCE_BARRIER result = {}; D3D12_RESOURCE_BARRIER &barrier = result; @@ -184,9 +184,9 @@ class CD3DX12_BARRIER_GROUP : public D3D12_BARRIER_GROUP pGlobalBarriers = pBarriers; } }; - #endif // D3D12_SDK_VERSION >= 608 + #endif // defined( __cplusplus ) #endif // __D3DX12_BARRIERS_H__ diff --git a/deps/DirectX-Headers/include/directx/d3dx12_check_feature_support.h b/deps/DirectX-Headers/include/directx/d3dx12_check_feature_support.h index b193a4c..d6dd5c8 100644 --- a/deps/DirectX-Headers/include/directx/d3dx12_check_feature_support.h +++ b/deps/DirectX-Headers/include/directx/d3dx12_check_feature_support.h @@ -1,4 +1,4 @@ -//********************************************************* +//********************************************************* // // Copyright (c) Microsoft Corporation. // Licensed under the MIT License (MIT). @@ -204,6 +204,37 @@ class CD3DX12FeatureSupport // D3D12_OPTIONS16 BOOL DynamicDepthBiasSupported() const noexcept; #endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + BOOL GPUUploadHeapSupported() const noexcept; + + // D3D12_OPTIONS17 + BOOL NonNormalizedCoordinateSamplersSupported() const noexcept; + BOOL ManualWriteTrackingResourceSupported() const noexcept; + + // D3D12_OPTIONS18 + BOOL RenderPassesValid() const noexcept; +#endif + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) + BOOL MismatchingOutputDimensionsSupported() const noexcept; + UINT SupportedSampleCountsWithNoOutputs() const noexcept; + BOOL PointSamplingAddressesNeverRoundUp() const noexcept; + BOOL RasterizerDesc2Supported() const noexcept; + BOOL NarrowQuadrilateralLinesSupported() const noexcept; + BOOL AnisoFilterWithPointMipSupported() const noexcept; + UINT MaxSamplerDescriptorHeapSize() const noexcept; + UINT MaxSamplerDescriptorHeapSizeWithStaticSamplers() const noexcept; + UINT MaxViewDescriptorHeapSize() const noexcept; +#endif + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611) + BOOL ComputeOnlyWriteWatchSupported() const noexcept; +#endif + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) + D3D12_EXECUTE_INDIRECT_TIER ExecuteIndirectTier() const noexcept; + D3D12_WORK_GRAPHS_TIER WorkGraphsTier() const noexcept; +#endif private: // Private structs and helpers declaration struct ProtectedResourceSessionTypesLocal : D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES @@ -279,6 +310,21 @@ class CD3DX12FeatureSupport #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) D3D12_FEATURE_DATA_D3D12_OPTIONS16 m_dOptions16; #endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + D3D12_FEATURE_DATA_D3D12_OPTIONS17 m_dOptions17; +#endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + D3D12_FEATURE_DATA_D3D12_OPTIONS18 m_dOptions18; +#endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) + D3D12_FEATURE_DATA_D3D12_OPTIONS19 m_dOptions19; +#endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611) + D3D12_FEATURE_DATA_D3D12_OPTIONS20 m_dOptions20; +#endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) + D3D12_FEATURE_DATA_D3D12_OPTIONS21 m_dOptions21; +#endif }; // Implementations for CD3DX12FeatureSupport functions @@ -358,6 +404,21 @@ inline CD3DX12FeatureSupport::CD3DX12FeatureSupport() noexcept #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) , m_dOptions16{} #endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) +, m_dOptions17{} +#endif +#if defined (D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) +, m_dOptions18{} +#endif +#if defined (D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) +, m_dOptions19{} +#endif +#if defined (D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611) +, m_dOptions20{} +#endif +#if defined (D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) +, m_dOptions21{} +#endif {} inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) @@ -496,6 +557,43 @@ inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) } #endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS17, &m_dOptions17, sizeof(m_dOptions17)))) + { + m_dOptions17 = {}; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS18, &m_dOptions18, sizeof(m_dOptions18)))) + { + m_dOptions18.RenderPassesValid = false; + } +#endif + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS19, &m_dOptions19, sizeof(m_dOptions19)))) + { + m_dOptions19 = {}; + m_dOptions19.SupportedSampleCountsWithNoOutputs = 1; + m_dOptions19.MaxSamplerDescriptorHeapSize = D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE; + m_dOptions19.MaxSamplerDescriptorHeapSizeWithStaticSamplers = D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE; + m_dOptions19.MaxViewDescriptorHeapSize = D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1; + } +#endif + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611) + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS20, &m_dOptions20, sizeof(m_dOptions20)))) + { + m_dOptions20 = {}; + } +#endif + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS21, &m_dOptions21, sizeof(m_dOptions21)))) + { + m_dOptions21 = {}; + } +#endif + // Initialize per-node feature support data structures const UINT uNodeCount = m_pDevice->GetNodeCount(); m_dProtectedResourceSessionSupport.resize(uNodeCount); @@ -840,6 +938,39 @@ FEATURE_SUPPORT_GET(BOOL, m_dOptions15, DynamicIndexBufferStripCutSupported); // 45: Options16 FEATURE_SUPPORT_GET(BOOL, m_dOptions16, DynamicDepthBiasSupported); #endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) +FEATURE_SUPPORT_GET(BOOL, m_dOptions16, GPUUploadHeapSupported); + +// 46: Options17 +FEATURE_SUPPORT_GET(BOOL, m_dOptions17, NonNormalizedCoordinateSamplersSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions17, ManualWriteTrackingResourceSupported); + +// 47: Option18 +FEATURE_SUPPORT_GET(BOOL, m_dOptions18, RenderPassesValid); +#endif + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) +FEATURE_SUPPORT_GET(BOOL, m_dOptions19, MismatchingOutputDimensionsSupported); +FEATURE_SUPPORT_GET(UINT, m_dOptions19, SupportedSampleCountsWithNoOutputs); +FEATURE_SUPPORT_GET(BOOL, m_dOptions19, PointSamplingAddressesNeverRoundUp); +FEATURE_SUPPORT_GET(BOOL, m_dOptions19, RasterizerDesc2Supported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions19, NarrowQuadrilateralLinesSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions19, AnisoFilterWithPointMipSupported); +FEATURE_SUPPORT_GET(UINT, m_dOptions19, MaxSamplerDescriptorHeapSize); +FEATURE_SUPPORT_GET(UINT, m_dOptions19, MaxSamplerDescriptorHeapSizeWithStaticSamplers); +FEATURE_SUPPORT_GET(UINT, m_dOptions19, MaxViewDescriptorHeapSize); +#endif + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611) +// 49: Options20 +FEATURE_SUPPORT_GET(BOOL, m_dOptions20, ComputeOnlyWriteWatchSupported); +#endif + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) +// 50: Options21 +FEATURE_SUPPORT_GET(D3D12_EXECUTE_INDIRECT_TIER, m_dOptions21, ExecuteIndirectTier); +FEATURE_SUPPORT_GET(D3D12_WORK_GRAPHS_TIER, m_dOptions21, WorkGraphsTier); +#endif // Helper function to decide the highest shader model supported by the system // Stores the result in m_dShaderModel @@ -851,6 +982,9 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestShaderModel() const D3D_SHADER_MODEL allModelVersions[] = { +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) + D3D_SHADER_MODEL_6_9, +#endif #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606) D3D_SHADER_MODEL_6_8, #endif @@ -897,6 +1031,9 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestRootSignatureVersion() const D3D_ROOT_SIGNATURE_VERSION allRootSignatureVersions[] = { +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + D3D_ROOT_SIGNATURE_VERSION_1_2, +#endif D3D_ROOT_SIGNATURE_VERSION_1_1, D3D_ROOT_SIGNATURE_VERSION_1_0, D3D_ROOT_SIGNATURE_VERSION_1, @@ -944,7 +1081,12 @@ inline HRESULT CD3DX12FeatureSupport::QueryHighestFeatureLevel() D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_2, D3D_FEATURE_LEVEL_9_1, - D3D_FEATURE_LEVEL_1_0_CORE +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 5) + D3D_FEATURE_LEVEL_1_0_CORE, +#endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 611) + D3D_FEATURE_LEVEL_1_0_GENERIC +#endif }; D3D12_FEATURE_DATA_FEATURE_LEVELS dFeatureLevel; diff --git a/deps/DirectX-Headers/include/directx/d3dx12_core.h b/deps/DirectX-Headers/include/directx/d3dx12_core.h index 2848e8f..87814fb 100644 --- a/deps/DirectX-Headers/include/directx/d3dx12_core.h +++ b/deps/DirectX-Headers/include/directx/d3dx12_core.h @@ -620,6 +620,112 @@ struct CD3DX12_RASTERIZER_DESC1 : public D3D12_RASTERIZER_DESC1 }; #endif // D3D12_SDK_VERSION >= 608 +//------------------------------------------------------------------------------------------------ +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) +struct CD3DX12_RASTERIZER_DESC2 : public D3D12_RASTERIZER_DESC2 +{ + CD3DX12_RASTERIZER_DESC2() = default; + explicit CD3DX12_RASTERIZER_DESC2(const D3D12_RASTERIZER_DESC2& o) noexcept : + D3D12_RASTERIZER_DESC2(o) + + { + } + explicit CD3DX12_RASTERIZER_DESC2(const D3D12_RASTERIZER_DESC1& o) noexcept + { + FillMode = o.FillMode; + CullMode = o.CullMode; + FrontCounterClockwise = o.FrontCounterClockwise; + DepthBias = o.DepthBias; + DepthBiasClamp = o.DepthBiasClamp; + SlopeScaledDepthBias = o.SlopeScaledDepthBias; + DepthClipEnable = o.DepthClipEnable; + LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_ALIASED; + if (o.MultisampleEnable) + { + LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_QUADRILATERAL_WIDE; + } + else if (o.AntialiasedLineEnable) + { + LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED; + } + ForcedSampleCount = o.ForcedSampleCount; + ConservativeRaster = o.ConservativeRaster; + } + explicit CD3DX12_RASTERIZER_DESC2(const D3D12_RASTERIZER_DESC& o) noexcept + : CD3DX12_RASTERIZER_DESC2(CD3DX12_RASTERIZER_DESC1(o)) + { + } + explicit CD3DX12_RASTERIZER_DESC2(CD3DX12_DEFAULT) noexcept + { + FillMode = D3D12_FILL_MODE_SOLID; + CullMode = D3D12_CULL_MODE_BACK; + FrontCounterClockwise = FALSE; + DepthBias = D3D12_DEFAULT_DEPTH_BIAS; + DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP; + SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; + DepthClipEnable = TRUE; + LineRasterizationMode = D3D12_LINE_RASTERIZATION_MODE_ALIASED; + ForcedSampleCount = 0; + ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF; + } + explicit CD3DX12_RASTERIZER_DESC2( + D3D12_FILL_MODE fillMode, + D3D12_CULL_MODE cullMode, + BOOL frontCounterClockwise, + FLOAT depthBias, + FLOAT depthBiasClamp, + FLOAT slopeScaledDepthBias, + BOOL depthClipEnable, + D3D12_LINE_RASTERIZATION_MODE lineRasterizationMode, + UINT forcedSampleCount, + D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster) noexcept + { + FillMode = fillMode; + CullMode = cullMode; + FrontCounterClockwise = frontCounterClockwise; + DepthBias = depthBias; + DepthBiasClamp = depthBiasClamp; + SlopeScaledDepthBias = slopeScaledDepthBias; + DepthClipEnable = depthClipEnable; + LineRasterizationMode = lineRasterizationMode; + ForcedSampleCount = forcedSampleCount; + ConservativeRaster = conservativeRaster; + } + + + operator D3D12_RASTERIZER_DESC1() const noexcept + { + D3D12_RASTERIZER_DESC1 o; + + o.FillMode = FillMode; + o.CullMode = CullMode; + o.FrontCounterClockwise = FrontCounterClockwise; + o.DepthBias = DepthBias; + o.DepthBiasClamp = DepthBiasClamp; + o.SlopeScaledDepthBias = SlopeScaledDepthBias; + o.DepthClipEnable = DepthClipEnable; + o.MultisampleEnable = FALSE; + o.AntialiasedLineEnable = FALSE; + if (LineRasterizationMode == D3D12_LINE_RASTERIZATION_MODE_ALPHA_ANTIALIASED) + { + o.AntialiasedLineEnable = TRUE; + } + else if (LineRasterizationMode != D3D12_LINE_RASTERIZATION_MODE_ALIASED) + { + o.MultisampleEnable = TRUE; + } + o.ForcedSampleCount = ForcedSampleCount; + o.ConservativeRaster = ConservativeRaster; + + return o; + } + operator D3D12_RASTERIZER_DESC() const noexcept + { + return static_cast(CD3DX12_RASTERIZER_DESC1(static_cast(*this))); + } +}; +#endif // D3D12_SDK_VERSION >= 610 + //------------------------------------------------------------------------------------------------ struct CD3DX12_RESOURCE_ALLOCATION_INFO : public D3D12_RESOURCE_ALLOCATION_INFO { @@ -669,6 +775,9 @@ struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES bool IsCPUAccessible() const noexcept { return Type == D3D12_HEAP_TYPE_UPLOAD || Type == D3D12_HEAP_TYPE_READBACK +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + || Type == D3D12_HEAP_TYPE_GPU_UPLOAD +#endif || (Type == D3D12_HEAP_TYPE_CUSTOM && (CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE || CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_BACK)); } @@ -1386,6 +1495,7 @@ inline const CD3DX12_RESOURCE_DESC1* D3DX12ConditionallyExpandAPIDesc( } } + //------------------------------------------------------------------------------------------------ struct CD3DX12_VIEW_INSTANCING_DESC : public D3D12_VIEW_INSTANCING_DESC { @@ -1424,3 +1534,4 @@ struct CD3DX12_RT_FORMAT_ARRAY : public D3D12_RT_FORMAT_ARRAY // assumes ARRAY_SIZE(pFormats) == ARRAY_SIZE(RTFormats) } }; + diff --git a/deps/DirectX-Headers/include/directx/d3dx12_pipeline_state_stream.h b/deps/DirectX-Headers/include/directx/d3dx12_pipeline_state_stream.h index bd0f512..a3ee813 100644 --- a/deps/DirectX-Headers/include/directx/d3dx12_pipeline_state_stream.h +++ b/deps/DirectX-Headers/include/directx/d3dx12_pipeline_state_stream.h @@ -11,8 +11,8 @@ #error D3DX12 requires C++ #endif -#include "d3d12.h" #include "d3dx12_default.h" +#include "d3d12.h" #include "d3dx12_core.h" //------------------------------------------------------------------------------------------------ @@ -25,8 +25,10 @@ struct DefaultSampleMask { operator UINT() noexcept { return UINT_MAX; } }; struct DefaultSampleDesc { operator DXGI_SAMPLE_DESC() noexcept { return DXGI_SAMPLE_DESC{1, 0}; } }; +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4324) +#endif template class alignas(void*) CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT { @@ -42,7 +44,9 @@ class alignas(void*) CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT InnerStructType* operator&() noexcept { return &pssInner; } InnerStructType const* operator&() const noexcept { return &pssInner; } }; +#ifdef _MSC_VER #pragma warning(pop) +#endif typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PIPELINE_STATE_FLAGS, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS> CD3DX12_PIPELINE_STATE_STREAM_FLAGS; typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK> CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK; typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< ID3D12RootSignature*, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE> CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE; @@ -69,6 +73,9 @@ typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_RASTERIZER_DESC, #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_RASTERIZER_DESC1, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER1; #endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_RASTERIZER_DESC2, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER2, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER2; +#endif typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_RT_FORMAT_ARRAY, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS> CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS; typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< DXGI_SAMPLE_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC, DefaultSampleDesc> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC; typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK, DefaultSampleMask> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK; @@ -105,7 +112,10 @@ struct ID3DX12PipelineParserCallbacks virtual void DSVFormatCb(DXGI_FORMAT) {} virtual void RasterizerStateCb(const D3D12_RASTERIZER_DESC&) {} #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) - virtual void RasterizerState2Cb(const D3D12_RASTERIZER_DESC1&) {} + virtual void RasterizerState1Cb(const D3D12_RASTERIZER_DESC1&) {} +#endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) + virtual void RasterizerState2Cb(const D3D12_RASTERIZER_DESC2&) {} #endif virtual void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY&) {} virtual void SampleDescCb(const DXGI_SAMPLE_DESC&) {} @@ -117,6 +127,9 @@ struct ID3DX12PipelineParserCallbacks virtual void ErrorBadInputParameter(UINT /*ParameterIndex*/) {} virtual void ErrorDuplicateSubobject(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE /*DuplicateType*/) {} virtual void ErrorUnknownSubobject(UINT /*UnknownTypeValue*/) {} +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 613) + virtual void FinalizeCb() {} +#endif virtual ~ID3DX12PipelineParserCallbacks() = default; }; @@ -141,6 +154,131 @@ struct D3DX12_MESH_SHADER_PIPELINE_STATE_DESC D3D12_PIPELINE_STATE_FLAGS Flags; }; +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) +// Use CD3DX12_PIPELINE_STATE_STREAM5 for D3D12_RASTERIZER_DESC2 when CheckFeatureSupport returns true for Options19::RasterizerDesc2Supported is true +// Use CD3DX12_PIPELINE_STATE_STREAM4 for D3D12_RASTERIZER_DESC1 when CheckFeatureSupport returns true for Options16::DynamicDepthBiasSupported is true +// Use CD3DX12_PIPELINE_STATE_STREAM3 for D3D12_DEPTH_STENCIL_DESC2 when CheckFeatureSupport returns true for Options14::IndependentFrontAndBackStencilSupported is true +// Use CD3DX12_PIPELINE_STATE_STREAM2 for OS Build 19041+ (where there is a new mesh shader pipeline). +// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject). +// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support. +struct CD3DX12_PIPELINE_STATE_STREAM5 +{ + CD3DX12_PIPELINE_STATE_STREAM5() = default; + // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC + CD3DX12_PIPELINE_STATE_STREAM5(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , InputLayout(Desc.InputLayout) + , IBStripCutValue(Desc.IBStripCutValue) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , VS(Desc.VS) + , GS(Desc.GS) + , StreamOutput(Desc.StreamOutput) + , HS(Desc.HS) + , DS(Desc.DS) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC2(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM5(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , PS(Desc.PS) + , AS(Desc.AS) + , MS(Desc.MS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC2(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM5(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , CS(CD3DX12_SHADER_BYTECODE(Desc.CS)) + , CachedPSO(Desc.CachedPSO) + { + static_cast(DepthStencilState).DepthEnable = false; + } + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout; + CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; + CD3DX12_PIPELINE_STATE_STREAM_VS VS; + CD3DX12_PIPELINE_STATE_STREAM_GS GS; + CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput; + CD3DX12_PIPELINE_STATE_STREAM_HS HS; + CD3DX12_PIPELINE_STATE_STREAM_DS DS; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_AS AS; + CD3DX12_PIPELINE_STATE_STREAM_MS MS; + CD3DX12_PIPELINE_STATE_STREAM_CS CS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER2 RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc; + + D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.InputLayout = this->InputLayout; + D.IBStripCutValue = this->IBStripCutValue; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.VS = this->VS; + D.GS = this->GS; + D.StreamOutput = this->StreamOutput; + D.HS = this->HS; + D.DS = this->DS; + D.PS = this->PS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(D3D12_DEPTH_STENCIL_DESC2(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = CD3DX12_RASTERIZER_DESC2(D3D12_RASTERIZER_DESC2(this->RasterizerState)); + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } + D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept + { + D3D12_COMPUTE_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.CS = this->CS; + D.CachedPSO = this->CachedPSO; + return D; + } +}; +#endif // D3D12_SDK_VERSION >= 610 + #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) // Use CD3DX12_PIPELINE_STATE_STREAM4 for D3D12_RASTERIZER_DESC1 when CheckFeatureSupport returns true for Options16::DynamicDepthBiasSupported is true // Use CD3DX12_PIPELINE_STATE_STREAM3 for D3D12_DEPTH_STENCIL_DESC2 when CheckFeatureSupport returns true for Options14::IndependentFrontAndBackStencilSupported is true @@ -629,6 +767,7 @@ struct CD3DX12_PIPELINE_MESH_STATE_STREAM : Flags(Desc.Flags) , NodeMask(Desc.NodeMask) , pRootSignature(Desc.pRootSignature) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) , PS(Desc.PS) , AS(Desc.AS) , MS(Desc.MS) @@ -645,6 +784,7 @@ struct CD3DX12_PIPELINE_MESH_STATE_STREAM CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; CD3DX12_PIPELINE_STATE_STREAM_PS PS; CD3DX12_PIPELINE_STATE_STREAM_AS AS; CD3DX12_PIPELINE_STATE_STREAM_MS MS; @@ -660,21 +800,22 @@ struct CD3DX12_PIPELINE_MESH_STATE_STREAM D3DX12_MESH_SHADER_PIPELINE_STATE_DESC MeshShaderDescV0() const noexcept { D3DX12_MESH_SHADER_PIPELINE_STATE_DESC D; - D.Flags = this->Flags; - D.NodeMask = this->NodeMask; - D.pRootSignature = this->pRootSignature; - D.PS = this->PS; - D.AS = this->AS; - D.MS = this->MS; - D.BlendState = this->BlendState; - D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); - D.DSVFormat = this->DSVFormat; - D.RasterizerState = this->RasterizerState; - D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.PS = this->PS; + D.AS = this->AS; + D.MS = this->MS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); - D.SampleDesc = this->SampleDesc; - D.SampleMask = this->SampleMask; - D.CachedPSO = this->CachedPSO; + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; return D; } }; @@ -955,7 +1096,7 @@ struct CD3DX12_PIPELINE_STATE_STREAM4_PARSE_HELPER : public ID3DX12PipelineParse } } void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC1(RasterizerState); } - void RasterizerState2Cb(const D3D12_RASTERIZER_DESC1& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC1(RasterizerState); } + void RasterizerState1Cb(const D3D12_RASTERIZER_DESC1& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC1(RasterizerState); } void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override { PipelineStream.RTVFormats = RTVFormats; } void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override { PipelineStream.SampleDesc = SampleDesc; } void SampleMaskCb(UINT SampleMask) override { PipelineStream.SampleMask = SampleMask; } @@ -967,6 +1108,155 @@ struct CD3DX12_PIPELINE_STATE_STREAM4_PARSE_HELPER : public ID3DX12PipelineParse }; #endif // D3D12_SDK_VERSION >= 608 +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 613) +// This SDK 613 version has better primitive topology default handling than the v610 equivalent below. +struct CD3DX12_PIPELINE_STATE_STREAM5_PARSE_HELPER : public ID3DX12PipelineParserCallbacks +{ + CD3DX12_PIPELINE_STATE_STREAM5 PipelineStream; + CD3DX12_PIPELINE_STATE_STREAM5_PARSE_HELPER() noexcept + : SeenDSS(false), + SeenMS(false), + SeenTopology(false) + { + // Adjust defaults to account for absent members. + PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + + // Depth disabled if no DSV format specified. + static_cast(PipelineStream.DepthStencilState).DepthEnable = false; + } + + // ID3DX12PipelineParserCallbacks + void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override { PipelineStream.Flags = Flags; } + void NodeMaskCb(UINT NodeMask) override { PipelineStream.NodeMask = NodeMask; } + void RootSignatureCb(ID3D12RootSignature* pRootSignature) override { PipelineStream.pRootSignature = pRootSignature; } + void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override { PipelineStream.InputLayout = InputLayout; } + void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override { PipelineStream.IBStripCutValue = IBStripCutValue; } + void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override + { + PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType; + SeenTopology = true; + } + void VSCb(const D3D12_SHADER_BYTECODE& VS) override { PipelineStream.VS = VS; } + void GSCb(const D3D12_SHADER_BYTECODE& GS) override { PipelineStream.GS = GS; } + void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override { PipelineStream.StreamOutput = StreamOutput; } + void HSCb(const D3D12_SHADER_BYTECODE& HS) override { PipelineStream.HS = HS; } + void DSCb(const D3D12_SHADER_BYTECODE& DS) override { PipelineStream.DS = DS; } + void PSCb(const D3D12_SHADER_BYTECODE& PS) override { PipelineStream.PS = PS; } + void CSCb(const D3D12_SHADER_BYTECODE& CS) override { PipelineStream.CS = CS; } + void ASCb(const D3D12_SHADER_BYTECODE& AS) override { PipelineStream.AS = AS; } + void MSCb(const D3D12_SHADER_BYTECODE& MS) override { PipelineStream.MS = MS; SeenMS = true; } + void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override { PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState); } + void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DSVFormatCb(DXGI_FORMAT DSVFormat) override {PipelineStream.DSVFormat = DSVFormat;} + void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC2(RasterizerState); } + void RasterizerState1Cb(const D3D12_RASTERIZER_DESC1& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC2(RasterizerState); } + void RasterizerState2Cb(const D3D12_RASTERIZER_DESC2& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC2(RasterizerState); } + void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override { PipelineStream.RTVFormats = RTVFormats; } + void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override { PipelineStream.SampleDesc = SampleDesc; } + void SampleMaskCb(UINT SampleMask) override { PipelineStream.SampleMask = SampleMask; } + void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override { PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc); } + void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override { PipelineStream.CachedPSO = CachedPSO; } + void FinalizeCb() override + { + if (!SeenDSS && PipelineStream.DSVFormat != DXGI_FORMAT_UNKNOWN) + { + // Re-enable depth for the default state. + static_cast(PipelineStream.DepthStencilState).DepthEnable = true; + } + if (!SeenTopology && SeenMS) + { + PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED; + } + } + +private: + bool SeenDSS; + bool SeenMS; + bool SeenTopology; +}; +#elif defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) +struct CD3DX12_PIPELINE_STATE_STREAM5_PARSE_HELPER : public ID3DX12PipelineParserCallbacks +{ + CD3DX12_PIPELINE_STATE_STREAM5 PipelineStream; + CD3DX12_PIPELINE_STATE_STREAM5_PARSE_HELPER() noexcept + : SeenDSS(false) + { + // Adjust defaults to account for absent members. + PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + + // Depth disabled if no DSV format specified. + static_cast(PipelineStream.DepthStencilState).DepthEnable = false; + } + + // ID3DX12PipelineParserCallbacks + void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override { PipelineStream.Flags = Flags; } + void NodeMaskCb(UINT NodeMask) override { PipelineStream.NodeMask = NodeMask; } + void RootSignatureCb(ID3D12RootSignature* pRootSignature) override { PipelineStream.pRootSignature = pRootSignature; } + void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override { PipelineStream.InputLayout = InputLayout; } + void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override { PipelineStream.IBStripCutValue = IBStripCutValue; } + void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override { PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType; } + void VSCb(const D3D12_SHADER_BYTECODE& VS) override { PipelineStream.VS = VS; } + void GSCb(const D3D12_SHADER_BYTECODE& GS) override { PipelineStream.GS = GS; } + void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override { PipelineStream.StreamOutput = StreamOutput; } + void HSCb(const D3D12_SHADER_BYTECODE& HS) override { PipelineStream.HS = HS; } + void DSCb(const D3D12_SHADER_BYTECODE& DS) override { PipelineStream.DS = DS; } + void PSCb(const D3D12_SHADER_BYTECODE& PS) override { PipelineStream.PS = PS; } + void CSCb(const D3D12_SHADER_BYTECODE& CS) override { PipelineStream.CS = CS; } + void ASCb(const D3D12_SHADER_BYTECODE& AS) override { PipelineStream.AS = AS; } + void MSCb(const D3D12_SHADER_BYTECODE& MS) override { PipelineStream.MS = MS; } + void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override { PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState); } + void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DSVFormatCb(DXGI_FORMAT DSVFormat) override + { + PipelineStream.DSVFormat = DSVFormat; + if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN) + { + // Re-enable depth for the default state. + static_cast(PipelineStream.DepthStencilState).DepthEnable = true; + } + } + void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC2(RasterizerState); } + void RasterizerState1Cb(const D3D12_RASTERIZER_DESC1& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC2(RasterizerState); } + void RasterizerState2Cb(const D3D12_RASTERIZER_DESC2& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC2(RasterizerState); } + void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override { PipelineStream.RTVFormats = RTVFormats; } + void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override { PipelineStream.SampleDesc = SampleDesc; } + void SampleMaskCb(UINT SampleMask) override { PipelineStream.SampleMask = SampleMask; } + void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override { PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc); } + void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override { PipelineStream.CachedPSO = CachedPSO; } + +private: + bool SeenDSS; +}; +#endif // D3D12_SDK_VERSION >= 610 + struct CD3DX12_PIPELINE_STATE_STREAM_PARSE_HELPER : public ID3DX12PipelineParserCallbacks { CD3DX12_PIPELINE_STATE_STREAM1 PipelineStream; @@ -1129,9 +1419,15 @@ inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& break; #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 608) case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER1: - pCallbacks->RasterizerState2Cb(*reinterpret_cast(pStream)); + pCallbacks->RasterizerState1Cb(*reinterpret_cast(pStream)); SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM4::RasterizerState); break; +#endif +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 610) + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER2: + pCallbacks->RasterizerState2Cb(*reinterpret_cast(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM5::RasterizerState); + break; #endif case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL: pCallbacks->DepthStencilStateCb(*reinterpret_cast(pStream)); @@ -1192,6 +1488,10 @@ inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& return E_INVALIDARG; } } +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 613) + pCallbacks->FinalizeCb(); +#endif return S_OK; } + diff --git a/deps/DirectX-Headers/include/directx/d3dx12_property_format_table.h b/deps/DirectX-Headers/include/directx/d3dx12_property_format_table.h new file mode 100644 index 0000000..301100c --- /dev/null +++ b/deps/DirectX-Headers/include/directx/d3dx12_property_format_table.h @@ -0,0 +1,124 @@ +//********************************************************* +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +// +//********************************************************* +#ifndef __D3D12_PROPERTY_LAYOUT_FORMAT_TABLE_H__ +#define __D3D12_PROPERTY_LAYOUT_FORMAT_TABLE_H__ +#include "d3d12.h" +#define MAP_ALIGN_REQUIREMENT 16 // Map is required to return 16-byte aligned addresses + +struct D3D12_PROPERTY_LAYOUT_FORMAT_TABLE +{ +public: + // ---------------------------------------------------------------------------- + // Information describing everything about a D3D Resource Format + // ---------------------------------------------------------------------------- + typedef struct FORMAT_DETAIL + { + DXGI_FORMAT DXGIFormat; + DXGI_FORMAT ParentFormat; + const DXGI_FORMAT* pDefaultFormatCastSet; // This is dependent on FL/driver version, but is here to save a lot of space + UINT8 BitsPerComponent[4]; // only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE + UINT8 BitsPerUnit; + BYTE SRGBFormat : 1; + UINT WidthAlignment : 4; // number of texels to align to in a mip level. + UINT HeightAlignment : 4; // Top level dimensions must be a multiple of these + UINT DepthAlignment : 1; // values. + D3D_FORMAT_LAYOUT Layout : 1; + D3D_FORMAT_TYPE_LEVEL TypeLevel : 2; + D3D_FORMAT_COMPONENT_NAME ComponentName0 : 3; // RED ... only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE + D3D_FORMAT_COMPONENT_NAME ComponentName1 : 3; // GREEN ... only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE + D3D_FORMAT_COMPONENT_NAME ComponentName2 : 3; // BLUE ... only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE + D3D_FORMAT_COMPONENT_NAME ComponentName3 : 3; // ALPHA ... only used for D3DFTL_PARTIAL_TYPE or FULL_TYPE + D3D_FORMAT_COMPONENT_INTERPRETATION ComponentInterpretation0 : 3; // only used for D3DFTL_FULL_TYPE + D3D_FORMAT_COMPONENT_INTERPRETATION ComponentInterpretation1 : 3; // only used for D3DFTL_FULL_TYPE + D3D_FORMAT_COMPONENT_INTERPRETATION ComponentInterpretation2 : 3; // only used for D3DFTL_FULL_TYPE + D3D_FORMAT_COMPONENT_INTERPRETATION ComponentInterpretation3 : 3; // only used for D3DFTL_FULL_TYPE + bool bDX9VertexOrIndexFormat : 1; + bool bDX9TextureFormat : 1; + bool bFloatNormFormat : 1; + bool bPlanar : 1; + bool bYUV : 1; + bool bDependantFormatCastSet : 1; // This indicates that the format cast set is dependent on FL/driver version + bool bInternal : 1; + } FORMAT_DETAIL; + +private: + static const FORMAT_DETAIL s_FormatDetail[]; + static const UINT s_NumFormats; + static const LPCSTR s_FormatNames[]; // separate from above structure so it can be compiled out of runtime. +public: + static UINT GetNumFormats(); + static const FORMAT_DETAIL* GetFormatTable(); + static D3D_FEATURE_LEVEL GetHighestDefinedFeatureLevel(); + + static DXGI_FORMAT GetFormat (SIZE_T Index); + static bool FormatExists (DXGI_FORMAT Format); + static bool FormatExistsInHeader (DXGI_FORMAT Format, bool bExternalHeader = true); + static UINT GetByteAlignment (DXGI_FORMAT Format); + static bool IsBlockCompressFormat (DXGI_FORMAT Format); + static LPCSTR GetName (DXGI_FORMAT Format, bool bHideInternalFormats = true); + static bool IsSRGBFormat (DXGI_FORMAT Format); + static UINT GetBitsPerStencil (DXGI_FORMAT Format); + static void GetFormatReturnTypes (DXGI_FORMAT Format, D3D_FORMAT_COMPONENT_INTERPRETATION* pInterpretations); // return array of 4 components + static UINT GetNumComponentsInFormat(DXGI_FORMAT Format); + + // Converts the sequential component index (range from 0 to GetNumComponentsInFormat()) to + // the absolute component index (range 0 to 3). + static UINT Sequential2AbsoluteComponentIndex (DXGI_FORMAT Format, UINT SequentialComponentIndex); + static bool CanBeCastEvenFullyTyped (DXGI_FORMAT Format, D3D_FEATURE_LEVEL fl); + static UINT8 GetAddressingBitsPerAlignedSize (DXGI_FORMAT Format); + static DXGI_FORMAT GetParentFormat (DXGI_FORMAT Format); + static const DXGI_FORMAT* GetFormatCastSet (DXGI_FORMAT Format); + static D3D_FORMAT_LAYOUT GetLayout (DXGI_FORMAT Format); + static D3D_FORMAT_TYPE_LEVEL GetTypeLevel (DXGI_FORMAT Format); + static UINT GetBitsPerUnit (DXGI_FORMAT Format); + static UINT GetBitsPerUnitThrow (DXGI_FORMAT Format); + static UINT GetBitsPerElement (DXGI_FORMAT Format); // Legacy function used to support D3D10on9 only. Do not use. + static UINT GetWidthAlignment (DXGI_FORMAT Format); + static UINT GetHeightAlignment (DXGI_FORMAT Format); + static UINT GetDepthAlignment (DXGI_FORMAT Format); + static BOOL Planar (DXGI_FORMAT Format); + static BOOL NonOpaquePlanar (DXGI_FORMAT Format); + static BOOL YUV (DXGI_FORMAT Format); + static BOOL Opaque (DXGI_FORMAT Format); + static bool FamilySupportsStencil (DXGI_FORMAT Format); + static UINT NonOpaquePlaneCount (DXGI_FORMAT Format); + static BOOL DX9VertexOrIndexFormat (DXGI_FORMAT Format); + static BOOL DX9TextureFormat (DXGI_FORMAT Format); + static BOOL FloatNormTextureFormat (DXGI_FORMAT Format); + static bool DepthOnlyFormat (DXGI_FORMAT format); + static UINT8 GetPlaneCount (DXGI_FORMAT Format); + static bool MotionEstimatorAllowedInputFormat (DXGI_FORMAT Format); + static bool SupportsSamplerFeedback (DXGI_FORMAT Format); + static bool DecodeHistogramAllowedForOutputFormatSupport(DXGI_FORMAT Format); + static UINT8 GetPlaneSliceFromViewFormat (DXGI_FORMAT ResourceFormat, DXGI_FORMAT ViewFormat); + static bool FloatAndNotFloatFormats (DXGI_FORMAT FormatA, DXGI_FORMAT FormatB); + static bool SNORMAndUNORMFormats (DXGI_FORMAT FormatA, DXGI_FORMAT FormatB); + static bool ValidCastToR32UAV (DXGI_FORMAT from, DXGI_FORMAT to); + static bool IsSupportedTextureDisplayableFormat (DXGI_FORMAT, bool bMediaFormatOnly); + static D3D_FORMAT_COMPONENT_INTERPRETATION GetFormatComponentInterpretation (DXGI_FORMAT Format, UINT AbsoluteComponentIndex); + static UINT GetBitsPerComponent (DXGI_FORMAT Format, UINT AbsoluteComponentIndex); + static D3D_FORMAT_COMPONENT_NAME GetComponentName (DXGI_FORMAT Format, UINT AbsoluteComponentIndex); + static HRESULT CalculateExtraPlanarRows (DXGI_FORMAT format, UINT plane0Height, _Out_ UINT& totalHeight); + static HRESULT CalculateMinimumRowMajorRowPitch (DXGI_FORMAT Format, UINT Width, _Out_ UINT& RowPitch); + static HRESULT CalculateMinimumRowMajorSlicePitch (DXGI_FORMAT Format, UINT ContextBasedRowPitch, UINT Height, _Out_ UINT& SlicePitch); + static void GetYCbCrChromaSubsampling (DXGI_FORMAT Format, _Out_ UINT& HorizontalSubsampling, _Out_ UINT& VerticalSubsampling); + + static HRESULT CalculateResourceSize (UINT width, UINT height, UINT depth, DXGI_FORMAT format, UINT mipLevels, UINT subresources, _Out_ SIZE_T& totalByteSize, _Out_writes_opt_(subresources) D3D12_MEMCPY_DEST* pDst = nullptr); + static void GetTileShape (D3D12_TILE_SHAPE* pTileShape, DXGI_FORMAT Format, D3D12_RESOURCE_DIMENSION Dimension, UINT SampleCount); + static void Get4KTileShape (D3D12_TILE_SHAPE* pTileShape, DXGI_FORMAT Format, D3D12_RESOURCE_DIMENSION Dimension, UINT SampleCount); + static void GetMipDimensions (UINT8 mipSlice, _Inout_ UINT64* pWidth, _Inout_opt_ UINT64* pHeight = nullptr, _Inout_opt_ UINT64* pDepth = nullptr); + static void GetPlaneSubsampledSizeAndFormatForCopyableLayout(UINT PlaneSlice, DXGI_FORMAT Format, UINT Width, UINT Height, _Out_ DXGI_FORMAT& PlaneFormat, _Out_ UINT& MinPlanePitchWidth, _Out_ UINT& PlaneWidth, _Out_ UINT& PlaneHeight); + + static UINT GetDetailTableIndex (DXGI_FORMAT Format); + static UINT GetDetailTableIndexNoThrow (DXGI_FORMAT Format); + static UINT GetDetailTableIndexThrow (DXGI_FORMAT Format); +private: + static const FORMAT_DETAIL* GetFormatDetail (DXGI_FORMAT Format); + +}; + +#endif \ No newline at end of file diff --git a/deps/DirectX-Headers/include/directx/d3dx12_render_pass.h b/deps/DirectX-Headers/include/directx/d3dx12_render_pass.h index 942ede7..c88fbdf 100644 --- a/deps/DirectX-Headers/include/directx/d3dx12_render_pass.h +++ b/deps/DirectX-Headers/include/directx/d3dx12_render_pass.h @@ -12,11 +12,28 @@ #endif #include "d3d12.h" +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) +inline bool operator==(const D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS& a, const D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS& b) noexcept +{ + return ((a.AdditionalWidth == b.AdditionalWidth) && (a.AdditionalHeight == b.AdditionalHeight)); +} + +inline bool operator==(const D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS& a, const D3D12_RENDER_PASS_BEGINNING_ACCESS_PRESERVE_LOCAL_PARAMETERS& b) noexcept +{ + return ((a.AdditionalWidth == b.AdditionalWidth) && (a.AdditionalHeight == b.AdditionalHeight)); +} + +inline bool operator==(const D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS& a, const D3D12_RENDER_PASS_ENDING_ACCESS_PRESERVE_LOCAL_PARAMETERS& b) noexcept +{ + return ((a.AdditionalWidth == b.AdditionalWidth) && (a.AdditionalHeight == b.AdditionalHeight)); +} +#endif inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &b) noexcept { return a.ClearValue == b.ClearValue; } + inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &a, const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &b) noexcept { if (a.pSrcResource != b.pSrcResource) return false; @@ -27,18 +44,49 @@ inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS if (a.PreserveResolveSource != b.PreserveResolveSource) return false; return true; } + inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS &b) noexcept { if (a.Type != b.Type) return false; - if (a.Type == D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR && !(a.Clear == b.Clear)) return false; + switch (a.Type) + { + case D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR: + if (!(a.Clear == b.Clear)) return false; + break; +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + case D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER: + case D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_SRV: + case D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE_LOCAL_UAV: + if (!(a.PreserveLocal == b.PreserveLocal)) return false; + break; +#endif + default: + break; + } return true; } -inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS &a, const D3D12_RENDER_PASS_ENDING_ACCESS &b) noexcept + +inline bool operator==(const D3D12_RENDER_PASS_ENDING_ACCESS& a, const D3D12_RENDER_PASS_ENDING_ACCESS& b) noexcept { if (a.Type != b.Type) return false; - if (a.Type == D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE && !(a.Resolve == b.Resolve)) return false; + switch (a.Type) + { + case D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE: + if (!(a.Resolve == b.Resolve)) return false; + break; +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + case D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_RENDER: + case D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_SRV: + case D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE_LOCAL_UAV: + if (!(a.PreserveLocal == b.PreserveLocal)) return false; + break; +#endif + default: + break; + } return true; } + inline bool operator==( const D3D12_RENDER_PASS_RENDER_TARGET_DESC &a, const D3D12_RENDER_PASS_RENDER_TARGET_DESC &b) noexcept { if (a.cpuDescriptor.ptr != b.cpuDescriptor.ptr) return false; diff --git a/deps/DirectX-Headers/include/directx/d3dx12_resource_helpers.h b/deps/DirectX-Headers/include/directx/d3dx12_resource_helpers.h index 9f173ad..c0c540c 100644 --- a/deps/DirectX-Headers/include/directx/d3dx12_resource_helpers.h +++ b/deps/DirectX-Headers/include/directx/d3dx12_resource_helpers.h @@ -11,6 +11,7 @@ #error D3DX12 requires C++ #endif +#include "d3dx12_property_format_table.h" #include "d3d12.h" #include "d3dx12_core.h" //------------------------------------------------------------------------------------------------ @@ -398,3 +399,204 @@ inline const CD3DX12_RESOURCE_DESC1* D3DX12ConditionallyExpandAPIDesc( { return D3DX12ConditionallyExpandAPIDesc(static_cast(LclDesc), static_cast(pDesc)); } + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606) +//------------------------------------------------------------------------------------------------ +// The difference between D3DX12GetCopyableFootprints and ID3D12Device::GetCopyableFootprints +// is that this one loses a lot of error checking by assuming the arguments are correct +inline bool D3DX12GetCopyableFootprints( + _In_ const D3D12_RESOURCE_DESC1& ResourceDesc, + _In_range_(0, D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0, D3D12_REQ_SUBRESOURCES - FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts, + _Out_writes_opt_(NumSubresources) UINT* pNumRows, + _Out_writes_opt_(NumSubresources) UINT64* pRowSizeInBytes, + _Out_opt_ UINT64* pTotalBytes) +{ + constexpr UINT64 uint64_max = ~0ull; + UINT64 TotalBytes = uint64_max; + UINT uSubRes = 0; + + bool bResourceOverflow = false; + TotalBytes = 0; + + const DXGI_FORMAT Format = ResourceDesc.Format; + + CD3DX12_RESOURCE_DESC1 LresourceDesc; + const CD3DX12_RESOURCE_DESC1& resourceDesc = *D3DX12ConditionallyExpandAPIDesc(LresourceDesc, &ResourceDesc); + + // Check if its a valid format + D3DX12_ASSERT(D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FormatExists(Format)); + + const UINT WidthAlignment = D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetWidthAlignment( Format ); + const UINT HeightAlignment = D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetHeightAlignment( Format ); + const UINT16 DepthAlignment = UINT16( D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetDepthAlignment( Format ) ); + + for (; uSubRes < NumSubresources; ++uSubRes) + { + bool bOverflow = false; + UINT Subresource = FirstSubresource + uSubRes; + + D3DX12_ASSERT(resourceDesc.MipLevels != 0); + UINT subresourceCount = resourceDesc.MipLevels * resourceDesc.ArraySize() * D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetPlaneCount(resourceDesc.Format); + + if (Subresource > subresourceCount) + { + break; + } + + TotalBytes = D3DX12Align< UINT64 >( TotalBytes, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT ); + + UINT MipLevel, ArraySlice, PlaneSlice; + D3D12DecomposeSubresource(Subresource, resourceDesc.MipLevels, resourceDesc.ArraySize(), /*_Out_*/MipLevel, /*_Out_*/ArraySlice, /*_Out_*/PlaneSlice); + + const UINT64 Width = D3DX12AlignAtLeast(resourceDesc.Width >> MipLevel, WidthAlignment); + const UINT Height = D3DX12AlignAtLeast(resourceDesc.Height >> MipLevel, HeightAlignment); + const UINT16 Depth = D3DX12AlignAtLeast(resourceDesc.Depth() >> MipLevel, DepthAlignment); + + // Adjust for the current PlaneSlice. Most formats have only one plane. + DXGI_FORMAT PlaneFormat; + UINT32 MinPlanePitchWidth, PlaneWidth, PlaneHeight; + D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetPlaneSubsampledSizeAndFormatForCopyableLayout(PlaneSlice, Format, (UINT)Width, Height, /*_Out_*/ PlaneFormat, /*_Out_*/ MinPlanePitchWidth, /* _Out_ */ PlaneWidth, /*_Out_*/ PlaneHeight); + + D3D12_SUBRESOURCE_FOOTPRINT LocalPlacement; + auto& Placement = pLayouts ? pLayouts[uSubRes].Footprint : LocalPlacement; + Placement.Format = PlaneFormat; + Placement.Width = PlaneWidth; + Placement.Height = PlaneHeight; + Placement.Depth = Depth; + + // Calculate row pitch + UINT MinPlaneRowPitch = 0; + D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::CalculateMinimumRowMajorRowPitch(PlaneFormat, MinPlanePitchWidth, MinPlaneRowPitch); + + // Formats with more than one plane choose a larger pitch alignment to ensure that each plane begins on the row + // immediately following the previous plane while still adhering to subresource alignment restrictions. + static_assert( D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT >= D3D12_TEXTURE_DATA_PITCH_ALIGNMENT + && ((D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT % D3D12_TEXTURE_DATA_PITCH_ALIGNMENT) == 0), + "D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT must be >= and evenly divisible by D3D12_TEXTURE_DATA_PITCH_ALIGNMENT." ); + + Placement.RowPitch = D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::Planar(Format) + ? D3DX12Align< UINT >( MinPlaneRowPitch, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT ) + : D3DX12Align< UINT >( MinPlaneRowPitch, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT ); + + if (pRowSizeInBytes) + { + UINT PlaneRowSize = 0; + D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::CalculateMinimumRowMajorRowPitch(PlaneFormat, PlaneWidth, PlaneRowSize); + + pRowSizeInBytes[uSubRes] = PlaneRowSize; + } + + // Number of rows (accounting for block compression and additional planes) + UINT NumRows = 0; + if (D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::Planar(Format)) + { + NumRows = PlaneHeight; + } + else + { + D3DX12_ASSERT(Height % HeightAlignment == 0); + NumRows = Height / HeightAlignment; + } + + if (pNumRows) + { + pNumRows[uSubRes] = NumRows; + } + + // Offsetting + if (pLayouts) + { + pLayouts[uSubRes].Offset = (bOverflow ? uint64_max : TotalBytes + BaseOffset); + } + + const UINT16 NumSlices = Depth; + const UINT64 SubresourceSize = (NumRows * NumSlices - 1) * Placement.RowPitch + MinPlaneRowPitch; + + // uint64 addition with overflow checking + TotalBytes = TotalBytes + SubresourceSize; + if(TotalBytes < SubresourceSize) + { + TotalBytes = uint64_max; + } + bResourceOverflow = bResourceOverflow || bOverflow; + } + + // Overflow error + if (bResourceOverflow) + { + TotalBytes = uint64_max; + } + + + if (pLayouts) + { + memset( pLayouts + uSubRes, -1, sizeof( *pLayouts ) * (NumSubresources - uSubRes) ); + } + if (pNumRows) + { + memset(pNumRows + uSubRes, -1, sizeof(*pNumRows) * (NumSubresources - uSubRes)); + } + if (pRowSizeInBytes) + { + memset(pRowSizeInBytes + uSubRes, -1, sizeof(*pRowSizeInBytes) * (NumSubresources - uSubRes)); + } + if (pTotalBytes) + { + *pTotalBytes = TotalBytes; + } + if(TotalBytes == uint64_max) + { + return false; + } + return true; +} + +//------------------------------------------------------------------------------------------------ +inline D3D12_RESOURCE_DESC1 D3DX12ResourceDesc0ToDesc1(D3D12_RESOURCE_DESC const& desc0) +{ + D3D12_RESOURCE_DESC1 desc1; + desc1.Dimension = desc0.Dimension; + desc1.Alignment = desc0.Alignment; + desc1.Width = desc0.Width; + desc1.Height = desc0.Height; + desc1.DepthOrArraySize = desc0.DepthOrArraySize; + desc1.MipLevels = desc0.MipLevels; + desc1.Format = desc0.Format; + desc1.SampleDesc.Count = desc0.SampleDesc.Count; + desc1.SampleDesc.Quality = desc0.SampleDesc.Quality; + desc1.Layout = desc0.Layout; + desc1.Flags = desc0.Flags; + desc1.SamplerFeedbackMipRegion.Width = 0; + desc1.SamplerFeedbackMipRegion.Height = 0; + desc1.SamplerFeedbackMipRegion.Depth = 0; + return desc1; +} + +//------------------------------------------------------------------------------------------------ +inline bool D3DX12GetCopyableFootprints( + _In_ const D3D12_RESOURCE_DESC& pResourceDesc, + _In_range_(0, D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0, D3D12_REQ_SUBRESOURCES - FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts, + _Out_writes_opt_(NumSubresources) UINT* pNumRows, + _Out_writes_opt_(NumSubresources) UINT64* pRowSizeInBytes, + _Out_opt_ UINT64* pTotalBytes) +{ + // From D3D12_RESOURCE_DESC to D3D12_RESOURCE_DESC1 + D3D12_RESOURCE_DESC1 desc = D3DX12ResourceDesc0ToDesc1(pResourceDesc); + return D3DX12GetCopyableFootprints( + *static_cast(&desc),// From D3D12_RESOURCE_DESC1 to CD3DX12_RESOURCE_DESC1 + FirstSubresource, + NumSubresources, + BaseOffset, + pLayouts, + pNumRows, + pRowSizeInBytes, + pTotalBytes); +} + +#endif // D3D12_SDK_VERSION >= 606 diff --git a/deps/DirectX-Headers/include/directx/d3dx12_root_signature.h b/deps/DirectX-Headers/include/directx/d3dx12_root_signature.h index 9d35897..e194d30 100644 --- a/deps/DirectX-Headers/include/directx/d3dx12_root_signature.h +++ b/deps/DirectX-Headers/include/directx/d3dx12_root_signature.h @@ -361,6 +361,120 @@ struct CD3DX12_STATIC_SAMPLER_DESC : public D3D12_STATIC_SAMPLER_DESC } }; +//------------------------------------------------------------------------------------------------ +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) +struct CD3DX12_STATIC_SAMPLER_DESC1 : public D3D12_STATIC_SAMPLER_DESC1 +{ + CD3DX12_STATIC_SAMPLER_DESC1() = default; + explicit CD3DX12_STATIC_SAMPLER_DESC1(const D3D12_STATIC_SAMPLER_DESC &o) noexcept + { + memcpy(this, &o, sizeof(D3D12_STATIC_SAMPLER_DESC)); + Flags = D3D12_SAMPLER_FLAGS::D3D12_SAMPLER_FLAG_NONE; + } + explicit CD3DX12_STATIC_SAMPLER_DESC1(const D3D12_STATIC_SAMPLER_DESC1 & o) noexcept : + D3D12_STATIC_SAMPLER_DESC1(o) + {} + CD3DX12_STATIC_SAMPLER_DESC1( + UINT shaderRegister, + D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC, + D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + FLOAT mipLODBias = 0, + UINT maxAnisotropy = 16, + D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, + FLOAT minLOD = 0.f, + FLOAT maxLOD = D3D12_FLOAT32_MAX, + D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, + UINT registerSpace = 0, + D3D12_SAMPLER_FLAGS flags = D3D12_SAMPLER_FLAGS::D3D12_SAMPLER_FLAG_NONE) noexcept + { + Init( + shaderRegister, + filter, + addressU, + addressV, + addressW, + mipLODBias, + maxAnisotropy, + comparisonFunc, + borderColor, + minLOD, + maxLOD, + shaderVisibility, + registerSpace, + flags); + } + + static inline void Init( + _Out_ D3D12_STATIC_SAMPLER_DESC1 &samplerDesc, + UINT shaderRegister, + D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC, + D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + FLOAT mipLODBias = 0, + UINT maxAnisotropy = 16, + D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, + FLOAT minLOD = 0.f, + FLOAT maxLOD = D3D12_FLOAT32_MAX, + D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, + UINT registerSpace = 0, + D3D12_SAMPLER_FLAGS flags = D3D12_SAMPLER_FLAGS::D3D12_SAMPLER_FLAG_NONE) noexcept + { + samplerDesc.ShaderRegister = shaderRegister; + samplerDesc.Filter = filter; + samplerDesc.AddressU = addressU; + samplerDesc.AddressV = addressV; + samplerDesc.AddressW = addressW; + samplerDesc.MipLODBias = mipLODBias; + samplerDesc.MaxAnisotropy = maxAnisotropy; + samplerDesc.ComparisonFunc = comparisonFunc; + samplerDesc.BorderColor = borderColor; + samplerDesc.MinLOD = minLOD; + samplerDesc.MaxLOD = maxLOD; + samplerDesc.ShaderVisibility = shaderVisibility; + samplerDesc.RegisterSpace = registerSpace; + samplerDesc.Flags = flags; + } + inline void Init( + UINT shaderRegister, + D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC, + D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + FLOAT mipLODBias = 0, + UINT maxAnisotropy = 16, + D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, + FLOAT minLOD = 0.f, + FLOAT maxLOD = D3D12_FLOAT32_MAX, + D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, + UINT registerSpace = 0, + D3D12_SAMPLER_FLAGS flags = D3D12_SAMPLER_FLAGS::D3D12_SAMPLER_FLAG_NONE) noexcept + { + Init( + *this, + shaderRegister, + filter, + addressU, + addressV, + addressW, + mipLODBias, + maxAnisotropy, + comparisonFunc, + borderColor, + minLOD, + maxLOD, + shaderVisibility, + registerSpace, + flags); + } +}; +#endif // D3D12_SDK_VERSION >= 609 + //------------------------------------------------------------------------------------------------ struct CD3DX12_ROOT_SIGNATURE_DESC : public D3D12_ROOT_SIGNATURE_DESC { @@ -653,6 +767,13 @@ struct CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC : public D3D12_VERSIONED_ROOT_SIGNA Version = D3D_ROOT_SIGNATURE_VERSION_1_1; Desc_1_1 = o; } +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC2& o) noexcept + { + Version = D3D_ROOT_SIGNATURE_VERSION_1_2; + Desc_1_2 = o; + } +#endif CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC( UINT numParameters, _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, @@ -727,6 +848,24 @@ struct CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC : public D3D12_VERSIONED_ROOT_SIGNA desc.Desc_1_1.pStaticSamplers = _pStaticSamplers; desc.Desc_1_1.Flags = flags; } + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + static inline void Init_1_2( + _Out_ D3D12_VERSIONED_ROOT_SIGNATURE_DESC& desc, + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC1* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_2; + desc.Desc_1_2.NumParameters = numParameters; + desc.Desc_1_2.pParameters = _pParameters; + desc.Desc_1_2.NumStaticSamplers = numStaticSamplers; + desc.Desc_1_2.pStaticSamplers = _pStaticSamplers; + desc.Desc_1_2.Flags = flags; + } +#endif }; //------------------------------------------------------------------------------------------------ @@ -856,6 +995,11 @@ struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE // To help enable root signature 1.1 features when they are available and not require maintaining // two code paths for building root signatures, this helper method reconstructs a 1.0 signature when // 1.1 is not supported. +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcovered-switch-default" +#endif + inline HRESULT D3DX12SerializeVersionedRootSignature( _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignatureDesc, D3D_ROOT_SIGNATURE_VERSION MaxVersion, @@ -876,6 +1020,9 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( return D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); case D3D_ROOT_SIGNATURE_VERSION_1_1: +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + case D3D_ROOT_SIGNATURE_VERSION_1_2: +#endif { HRESULT hr = S_OK; const D3D12_ROOT_SIGNATURE_DESC1& desc_1_1 = pRootSignatureDesc->Desc_1_1; @@ -912,39 +1059,72 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( break; case D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE: - const D3D12_ROOT_DESCRIPTOR_TABLE1& table_1_1 = desc_1_1.pParameters[n].DescriptorTable; - - const SIZE_T DescriptorRangesSize = sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges; - void* pDescriptorRanges = (DescriptorRangesSize > 0 && SUCCEEDED(hr)) ? HeapAlloc(GetProcessHeap(), 0, DescriptorRangesSize) : nullptr; - if (DescriptorRangesSize > 0 && pDescriptorRanges == nullptr) { - hr = E_OUTOFMEMORY; - } - auto pDescriptorRanges_1_0 = static_cast(pDescriptorRanges); + const D3D12_ROOT_DESCRIPTOR_TABLE1& table_1_1 = desc_1_1.pParameters[n].DescriptorTable; - if (SUCCEEDED(hr)) - { - for (UINT x = 0; x < table_1_1.NumDescriptorRanges; x++) + const SIZE_T DescriptorRangesSize = sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges; + void* pDescriptorRanges = (DescriptorRangesSize > 0 && SUCCEEDED(hr)) ? HeapAlloc(GetProcessHeap(), 0, DescriptorRangesSize) : nullptr; + if (DescriptorRangesSize > 0 && pDescriptorRanges == nullptr) { - __analysis_assume(DescriptorRangesSize == sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges); - pDescriptorRanges_1_0[x].BaseShaderRegister = table_1_1.pDescriptorRanges[x].BaseShaderRegister; - pDescriptorRanges_1_0[x].NumDescriptors = table_1_1.pDescriptorRanges[x].NumDescriptors; - pDescriptorRanges_1_0[x].OffsetInDescriptorsFromTableStart = table_1_1.pDescriptorRanges[x].OffsetInDescriptorsFromTableStart; - pDescriptorRanges_1_0[x].RangeType = table_1_1.pDescriptorRanges[x].RangeType; - pDescriptorRanges_1_0[x].RegisterSpace = table_1_1.pDescriptorRanges[x].RegisterSpace; + hr = E_OUTOFMEMORY; } + auto pDescriptorRanges_1_0 = static_cast(pDescriptorRanges); + + if (SUCCEEDED(hr)) + { + for (UINT x = 0; x < table_1_1.NumDescriptorRanges; x++) + { + __analysis_assume(DescriptorRangesSize == sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges); + pDescriptorRanges_1_0[x].BaseShaderRegister = table_1_1.pDescriptorRanges[x].BaseShaderRegister; + pDescriptorRanges_1_0[x].NumDescriptors = table_1_1.pDescriptorRanges[x].NumDescriptors; + pDescriptorRanges_1_0[x].OffsetInDescriptorsFromTableStart = table_1_1.pDescriptorRanges[x].OffsetInDescriptorsFromTableStart; + pDescriptorRanges_1_0[x].RangeType = table_1_1.pDescriptorRanges[x].RangeType; + pDescriptorRanges_1_0[x].RegisterSpace = table_1_1.pDescriptorRanges[x].RegisterSpace; + } + } + + D3D12_ROOT_DESCRIPTOR_TABLE& table_1_0 = pParameters_1_0[n].DescriptorTable; + table_1_0.NumDescriptorRanges = table_1_1.NumDescriptorRanges; + table_1_0.pDescriptorRanges = pDescriptorRanges_1_0; } + break; - D3D12_ROOT_DESCRIPTOR_TABLE& table_1_0 = pParameters_1_0[n].DescriptorTable; - table_1_0.NumDescriptorRanges = table_1_1.NumDescriptorRanges; - table_1_0.pDescriptorRanges = pDescriptorRanges_1_0; + default: + break; } } } + D3D12_STATIC_SAMPLER_DESC* pStaticSamplers = nullptr; +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + if (desc_1_1.NumStaticSamplers > 0 && pRootSignatureDesc->Version == D3D_ROOT_SIGNATURE_VERSION_1_2) + { + const SIZE_T SamplersSize = sizeof(D3D12_STATIC_SAMPLER_DESC) * desc_1_1.NumStaticSamplers; + pStaticSamplers = static_cast(HeapAlloc(GetProcessHeap(), 0, SamplersSize)); + + if (pStaticSamplers == nullptr) + { + hr = E_OUTOFMEMORY; + } + else + { + const D3D12_ROOT_SIGNATURE_DESC2& desc_1_2 = pRootSignatureDesc->Desc_1_2; + for (UINT n = 0; n < desc_1_1.NumStaticSamplers; ++n) + { + if ((desc_1_2.pStaticSamplers[n].Flags & ~D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR) != 0) + { + hr = E_INVALIDARG; + break; + } + memcpy(pStaticSamplers + n, desc_1_2.pStaticSamplers + n, sizeof(D3D12_STATIC_SAMPLER_DESC)); + } + } + } +#endif + if (SUCCEEDED(hr)) { - const CD3DX12_ROOT_SIGNATURE_DESC desc_1_0(desc_1_1.NumParameters, pParameters_1_0, desc_1_1.NumStaticSamplers, desc_1_1.pStaticSamplers, desc_1_1.Flags); + const CD3DX12_ROOT_SIGNATURE_DESC desc_1_0(desc_1_1.NumParameters, pParameters_1_0, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : pStaticSamplers, desc_1_1.Flags); hr = D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); } @@ -960,14 +1140,88 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( } HeapFree(GetProcessHeap(), 0, pParameters); } + + if (pStaticSamplers) + { + HeapFree(GetProcessHeap(), 0, pStaticSamplers); + } + return hr; } + + default: + break; } break; case D3D_ROOT_SIGNATURE_VERSION_1_1: + switch (pRootSignatureDesc->Version) + { + case D3D_ROOT_SIGNATURE_VERSION_1_0: + case D3D_ROOT_SIGNATURE_VERSION_1_1: + return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + case D3D_ROOT_SIGNATURE_VERSION_1_2: + { + HRESULT hr = S_OK; + const D3D12_ROOT_SIGNATURE_DESC1& desc_1_1 = pRootSignatureDesc->Desc_1_1; + + D3D12_STATIC_SAMPLER_DESC* pStaticSamplers = nullptr; + if (desc_1_1.NumStaticSamplers > 0) + { + const SIZE_T SamplersSize = sizeof(D3D12_STATIC_SAMPLER_DESC) * desc_1_1.NumStaticSamplers; + pStaticSamplers = static_cast(HeapAlloc(GetProcessHeap(), 0, SamplersSize)); + + if (pStaticSamplers == nullptr) + { + hr = E_OUTOFMEMORY; + } + else + { + const D3D12_ROOT_SIGNATURE_DESC2& desc_1_2 = pRootSignatureDesc->Desc_1_2; + for (UINT n = 0; n < desc_1_1.NumStaticSamplers; ++n) + { + if ((desc_1_2.pStaticSamplers[n].Flags & ~D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR) != 0) + { + hr = E_INVALIDARG; + break; + } + memcpy(pStaticSamplers + n, desc_1_2.pStaticSamplers + n, sizeof(D3D12_STATIC_SAMPLER_DESC)); + } + } + } + + if (SUCCEEDED(hr)) + { + const CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC desc(desc_1_1.NumParameters, desc_1_1.pParameters, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : pStaticSamplers, desc_1_1.Flags); + hr = D3D12SerializeVersionedRootSignature(&desc, ppBlob, ppErrorBlob); + } + + if (pStaticSamplers) + { + HeapFree(GetProcessHeap(), 0, pStaticSamplers); + } + + return hr; + } +#endif + + default: + break; + } + break; + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) + case D3D_ROOT_SIGNATURE_VERSION_1_2: +#endif + default: return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); } return E_INVALIDARG; } + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif diff --git a/deps/DirectX-Headers/include/directx/d3dx12_state_object.h b/deps/DirectX-Headers/include/directx/d3dx12_state_object.h index 74dc6ca..b460c76 100644 --- a/deps/DirectX-Headers/include/directx/d3dx12_state_object.h +++ b/deps/DirectX-Headers/include/directx/d3dx12_state_object.h @@ -11,7 +11,9 @@ #error D3DX12 requires C++ #endif +#include "d3dx12_default.h" #include "d3d12.h" +#include "d3dx12_core.h" //================================================================================================ // D3DX12 State Object Creation Helpers @@ -27,6 +29,8 @@ // //================================================================================================ #include +#include +#include #include #include #include @@ -55,9 +59,22 @@ class CD3DX12_STATE_OBJECT_DESC Init(Type); } void SetStateObjectType(D3D12_STATE_OBJECT_TYPE Type) noexcept { m_Desc.Type = Type; } - operator const D3D12_STATE_OBJECT_DESC&() + CD3DX12_STATE_OBJECT_DESC(const CD3DX12_STATE_OBJECT_DESC& other) = delete; + CD3DX12_STATE_OBJECT_DESC& operator=(const CD3DX12_STATE_OBJECT_DESC& other) = delete; + CD3DX12_STATE_OBJECT_DESC(CD3DX12_STATE_OBJECT_DESC&& other) = default; + CD3DX12_STATE_OBJECT_DESC& operator=(CD3DX12_STATE_OBJECT_DESC&& other) = default; + operator const D3D12_STATE_OBJECT_DESC& () { // Do final preparation work + for (auto& ownedSubobject : m_OwnedSubobjectHelpers) + { + ownedSubobject->Finalize(); + } + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) + m_RepointedSubobjectVectors.clear(); + m_RepointedPrograms.clear(); +#endif m_RepointedAssociations.clear(); m_SubobjectArray.clear(); m_SubobjectArray.reserve(m_Desc.NumSubobjects); @@ -85,12 +102,36 @@ class CD3DX12_STATE_OBJECT_DESC m_RepointedAssociations.push_back(Repointed); m_SubobjectArray[i].pDesc = &m_RepointedAssociations.back(); } +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) + else if (m_SubobjectArray[i].Type == D3D12_STATE_SUBOBJECT_TYPE_GENERIC_PROGRAM) + { + auto originalGenericProgramDesc = + static_cast(m_SubobjectArray[i].pDesc); + D3D12_GENERIC_PROGRAM_DESC Repointed = *originalGenericProgramDesc; + if (originalGenericProgramDesc->NumSubobjects > 0) + { + m_RepointedSubobjectVectors.emplace_back(std::vector()); + std::vector& repointedGenericProgramSubobjects = m_RepointedSubobjectVectors.back(); + repointedGenericProgramSubobjects.resize(originalGenericProgramDesc->NumSubobjects); + for (UINT s = 0; s < originalGenericProgramDesc->NumSubobjects; s++) + { + auto pWrapper = + static_cast(originalGenericProgramDesc->ppSubobjects[s]); + repointedGenericProgramSubobjects[s] = pWrapper->pSubobjectArrayLocation; + } + // Below: using ugly way to get pointer in case .data() is not defined + Repointed.ppSubobjects = &repointedGenericProgramSubobjects[0]; + } + m_RepointedPrograms.push_back(Repointed); + m_SubobjectArray[i].pDesc = &m_RepointedPrograms.back(); + } +#endif } // Below: using ugly way to get pointer in case .data() is not defined m_Desc.pSubobjects = m_Desc.NumSubobjects ? &m_SubobjectArray[0] : nullptr; return m_Desc; } - operator const D3D12_STATE_OBJECT_DESC*() + operator const D3D12_STATE_OBJECT_DESC* () { // Cast calls the above final preparation work return &static_cast(*this); @@ -148,6 +189,10 @@ class CD3DX12_STATE_OBJECT_DESC m_SubobjectList.clear(); m_SubobjectArray.clear(); m_RepointedAssociations.clear(); +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) + m_RepointedSubobjectVectors.clear(); + m_RepointedPrograms.clear(); +#endif } typedef struct SUBOBJECT_WRAPPER : public D3D12_STATE_SUBOBJECT { @@ -160,13 +205,21 @@ class CD3DX12_STATE_OBJECT_DESC std::vector m_SubobjectArray; // Built at the end, copying list contents std::list - m_RepointedAssociations; // subobject type that contains pointers to other subobjects, - // repointed to flattened array + m_RepointedAssociations; // subobject type that contains pointers to other subobjects, + // repointed to flattened array + +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) + std::list> + m_RepointedSubobjectVectors; + std::list + m_RepointedPrograms; +#endif + template class StringContainer { public: - LPCWSTR LocalCopy(LPCWSTR string, bool bSingleString = false) + CStr LocalCopy(CStr string, bool bSingleString = false) { if (string) { @@ -188,38 +241,34 @@ class CD3DX12_STATE_OBJECT_DESC } void clear() noexcept { m_Strings.clear(); } private: - std::list m_Strings; + std::list m_Strings; }; +public: class SUBOBJECT_HELPER_BASE { public: SUBOBJECT_HELPER_BASE() noexcept { Init(); } virtual ~SUBOBJECT_HELPER_BASE() = default; virtual D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept = 0; + SUBOBJECT_HELPER_BASE(const SUBOBJECT_HELPER_BASE& other) = delete; + SUBOBJECT_HELPER_BASE& operator=(const SUBOBJECT_HELPER_BASE& other) = delete; + SUBOBJECT_HELPER_BASE(SUBOBJECT_HELPER_BASE&& other) = default; + SUBOBJECT_HELPER_BASE& operator=(SUBOBJECT_HELPER_BASE&& other) = default; void AddToStateObject(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) { m_pSubobject = ContainingStateObject.TrackSubobject(Type(), Data()); } + virtual void Finalize() {}; + operator const D3D12_STATE_SUBOBJECT& () const noexcept { return *m_pSubobject; } protected: virtual void* Data() noexcept = 0; void Init() noexcept { m_pSubobject = nullptr; } D3D12_STATE_SUBOBJECT* m_pSubobject; }; -#if(__cplusplus >= 201103L) - std::list> m_OwnedSubobjectHelpers; -#else - class OWNED_HELPER - { - public: - OWNED_HELPER(const SUBOBJECT_HELPER_BASE* pHelper) noexcept { m_pHelper = pHelper; } - ~OWNED_HELPER() { delete m_pHelper; } - const SUBOBJECT_HELPER_BASE* m_pHelper; - }; - - std::list m_OwnedSubobjectHelpers; -#endif +private: + std::list> m_OwnedSubobjectHelpers; friend class CD3DX12_DXIL_LIBRARY_SUBOBJECT; friend class CD3DX12_EXISTING_COLLECTION_SUBOBJECT; @@ -233,6 +282,33 @@ class CD3DX12_STATE_OBJECT_DESC friend class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT; friend class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT; friend class CD3DX12_NODE_MASK_SUBOBJECT; + //TODO: SDK Version check should include all the newly added subobject type for the public release. + // The SDK version check will be changed based on when we release state objects. +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) + friend class CD3DX12_GENERIC_PROGRAM_SUBOBJECT; + friend class CD3DX12_WORK_GRAPH_SUBOBJECT; + friend class CD3DX12_STREAM_OUTPUT_SUBOBJECT; + friend class CD3DX12_BLEND_SUBOBJECT; + friend class CD3DX12_RASTERIZER_SUBOBJECT; + friend class CD3DX12_DEPTH_STENCIL2_SUBOBJECT; + friend class CD3DX12_INPUT_LAYOUT_SUBOBJECT; + friend class CD3DX12_IB_STRIP_CUT_VALUE_SUBOBJECT; + friend class CD3DX12_PRIMITIVE_TOPOLOGY_SUBOBJECT; + friend class CD3DX12_RENDER_TARGET_FORMATS_SUBOBJECT; + friend class CD3DX12_DEPTH_STENCIL_FORMAT_SUBOBJECT; + friend class CD3DX12_SAMPLE_DESC_SUBOBJECT; + friend class CD3DX12_FLAGS_SUBOBJECT; + friend class CD3DX12_VIEW_INSTANCING_SUBOBJECT; + friend class CD3DX12_DEPTH_STENCIL_SUBOBJECT; + friend class CD3DX12_DEPTH_STENCIL1_SUBOBJECT; + friend class CD3DX12_SAMPLE_MASK_SUBOBJECT; + friend class CD3DX12_NODE_OUTPUT_OVERRIDES; + friend class CD3DX12_SHADER_NODE; + friend class CD3DX12_BROADCASTING_LAUNCH_NODE_OVERRIDES; + friend class CD3DX12_COALESCING_LAUNCH_NODE_OVERRIDES; + friend class CD3DX12_THREAD_LAUNCH_NODE_OVERRIDES; + friend class CD3DX12_COMMON_COMPUTE_NODE_OVERRIDES; +#endif // D3D12_SDK_VERSION >= 612 }; //------------------------------------------------------------------------------------------------ @@ -249,6 +325,10 @@ class CD3DX12_DXIL_LIBRARY_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_DXIL_LIBRARY_SUBOBJECT(const CD3DX12_DXIL_LIBRARY_SUBOBJECT& other) = delete; + CD3DX12_DXIL_LIBRARY_SUBOBJECT& operator=(const CD3DX12_DXIL_LIBRARY_SUBOBJECT& other) = delete; + CD3DX12_DXIL_LIBRARY_SUBOBJECT(CD3DX12_DXIL_LIBRARY_SUBOBJECT&& other) = default; + CD3DX12_DXIL_LIBRARY_SUBOBJECT& operator=(CD3DX12_DXIL_LIBRARY_SUBOBJECT&& other) = default; void SetDXILLibrary(const D3D12_SHADER_BYTECODE* pCode) noexcept { static const D3D12_SHADER_BYTECODE Default = {}; @@ -286,7 +366,6 @@ class CD3DX12_DXIL_LIBRARY_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_DXIL_LIBRARY_DESC&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -298,7 +377,7 @@ class CD3DX12_DXIL_LIBRARY_SUBOBJECT } void* Data() noexcept override { return &m_Desc; } D3D12_DXIL_LIBRARY_DESC m_Desc; - CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; std::vector m_Exports; }; @@ -316,6 +395,10 @@ class CD3DX12_EXISTING_COLLECTION_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_EXISTING_COLLECTION_SUBOBJECT(const CD3DX12_EXISTING_COLLECTION_SUBOBJECT& other) = delete; + CD3DX12_EXISTING_COLLECTION_SUBOBJECT& operator=(const CD3DX12_EXISTING_COLLECTION_SUBOBJECT& other) = delete; + CD3DX12_EXISTING_COLLECTION_SUBOBJECT(CD3DX12_EXISTING_COLLECTION_SUBOBJECT&& other) = default; + CD3DX12_EXISTING_COLLECTION_SUBOBJECT& operator=(CD3DX12_EXISTING_COLLECTION_SUBOBJECT&& other) = default; void SetExistingCollection(ID3D12StateObject*pExistingCollection) noexcept { m_Desc.pExistingCollection = pExistingCollection; @@ -353,7 +436,6 @@ class CD3DX12_EXISTING_COLLECTION_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_EXISTING_COLLECTION_DESC&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -367,7 +449,7 @@ class CD3DX12_EXISTING_COLLECTION_SUBOBJECT void* Data() noexcept override { return &m_Desc; } D3D12_EXISTING_COLLECTION_DESC m_Desc; D3DX12_COM_PTR m_CollectionRef; - CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; std::vector m_Exports; }; @@ -385,6 +467,10 @@ class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT(const CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT& other) = delete; + CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT& operator=(const CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT& other) = delete; + CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT(CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT&& other) = default; + CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT& operator=(CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT&& other) = default; void SetSubobjectToAssociate(const D3D12_STATE_SUBOBJECT& SubobjectToAssociate) noexcept { m_Desc.pSubobjectToAssociate = &SubobjectToAssociate; @@ -414,7 +500,6 @@ class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -426,7 +511,7 @@ class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT } void* Data() noexcept override { return &m_Desc; } D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc; - CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; std::vector m_Exports; }; @@ -444,6 +529,10 @@ class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION(const CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION& other) = delete; + CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION& operator=(const CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION& other) = delete; + CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION(CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION&& other) = default; + CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION& operator=(CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION&& other) = default; void SetSubobjectNameToAssociate(LPCWSTR SubobjectToAssociate) { m_Desc.SubobjectToAssociate = m_SubobjectName.LocalCopy(SubobjectToAssociate, true); @@ -473,7 +562,6 @@ class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION { return D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -486,8 +574,8 @@ class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION } void* Data() noexcept override { return &m_Desc; } D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc; - CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; - CD3DX12_STATE_OBJECT_DESC::StringContainer m_SubobjectName; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_SubobjectName; std::vector m_Exports; }; @@ -505,6 +593,10 @@ class CD3DX12_HIT_GROUP_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_HIT_GROUP_SUBOBJECT(const CD3DX12_HIT_GROUP_SUBOBJECT& other) = delete; + CD3DX12_HIT_GROUP_SUBOBJECT& operator=(const CD3DX12_HIT_GROUP_SUBOBJECT& other) = delete; + CD3DX12_HIT_GROUP_SUBOBJECT(CD3DX12_HIT_GROUP_SUBOBJECT&& other) = default; + CD3DX12_HIT_GROUP_SUBOBJECT& operator=(CD3DX12_HIT_GROUP_SUBOBJECT&& other) = default; void SetHitGroupExport(LPCWSTR exportName) { m_Desc.HitGroupExport = m_Strings[0].LocalCopy(exportName, true); @@ -526,7 +618,6 @@ class CD3DX12_HIT_GROUP_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_HIT_GROUP_DESC&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -541,7 +632,7 @@ class CD3DX12_HIT_GROUP_SUBOBJECT void* Data() noexcept override { return &m_Desc; } D3D12_HIT_GROUP_DESC m_Desc; static constexpr UINT m_NumStrings = 4; - CD3DX12_STATE_OBJECT_DESC::StringContainer + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings[m_NumStrings]; // one string for every entrypoint name }; @@ -559,6 +650,10 @@ class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT(const CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT& other) = delete; + CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT& operator=(const CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT& other) = delete; + CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT(CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT&& other) = default; + CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT& operator=(CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT&& other) = default; void Config(UINT MaxPayloadSizeInBytes, UINT MaxAttributeSizeInBytes) noexcept { m_Desc.MaxPayloadSizeInBytes = MaxPayloadSizeInBytes; @@ -568,7 +663,6 @@ class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_RAYTRACING_SHADER_CONFIG&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -594,6 +688,10 @@ class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT(const CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT& other) = delete; + CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT& operator=(const CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT& other) = delete; + CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT(CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT&& other) = default; + CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT& operator=(CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT&& other) = default; void Config(UINT MaxTraceRecursionDepth) noexcept { m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth; @@ -602,7 +700,6 @@ class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_RAYTRACING_PIPELINE_CONFIG&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -628,6 +725,10 @@ class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT(const CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT& other) = delete; + CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT& operator=(const CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT& other) = delete; + CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT(CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT&& other) = default; + CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT& operator=(CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT&& other) = default; void Config(UINT MaxTraceRecursionDepth, D3D12_RAYTRACING_PIPELINE_FLAGS Flags) noexcept { m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth; @@ -637,7 +738,6 @@ class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_RAYTRACING_PIPELINE_CONFIG1&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -663,6 +763,10 @@ class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT(const CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT& other) = delete; + CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT& operator=(const CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT& other) = delete; + CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT&& other) = default; + CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT& operator=(CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT&& other) = default; void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept { m_pRootSig = pRootSig; @@ -671,7 +775,6 @@ class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); } private: void Init() noexcept @@ -697,6 +800,10 @@ class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT(const CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT& other) = delete; + CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT& operator=(const CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT& other) = delete; + CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT&& other) = default; + CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT& operator=(CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT&& other) = default; void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept { m_pRootSig = pRootSig; @@ -705,7 +812,6 @@ class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); } private: void Init() noexcept @@ -731,6 +837,10 @@ class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT(const CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT& other) = delete; + CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT& operator=(const CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT& other) = delete; + CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT&& other) = default; + CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT& operator=(CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT&& other) = default; void SetFlags(D3D12_STATE_OBJECT_FLAGS Flags) noexcept { m_Desc.Flags = Flags; @@ -739,7 +849,6 @@ class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_STATE_OBJECT_CONFIG&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -765,6 +874,10 @@ class CD3DX12_NODE_MASK_SUBOBJECT Init(); AddToStateObject(ContainingStateObject); } + CD3DX12_NODE_MASK_SUBOBJECT(const CD3DX12_NODE_MASK_SUBOBJECT& other) = delete; + CD3DX12_NODE_MASK_SUBOBJECT& operator=(const CD3DX12_NODE_MASK_SUBOBJECT& other) = delete; + CD3DX12_NODE_MASK_SUBOBJECT(CD3DX12_NODE_MASK_SUBOBJECT&& other) = default; + CD3DX12_NODE_MASK_SUBOBJECT& operator=(CD3DX12_NODE_MASK_SUBOBJECT&& other) = default; void SetNodeMask(UINT NodeMask) noexcept { m_Desc.NodeMask = NodeMask; @@ -773,7 +886,6 @@ class CD3DX12_NODE_MASK_SUBOBJECT { return D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK; } - operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } operator const D3D12_NODE_MASK&() const noexcept { return m_Desc; } private: void Init() noexcept @@ -785,6 +897,1314 @@ class CD3DX12_NODE_MASK_SUBOBJECT D3D12_NODE_MASK m_Desc; }; -#undef D3DX12_COM_PTR -#undef D3DX12_COM_PTR_GET -#undef D3DX12_COM_PTR_ADDRESSOF +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 612) +//------------------------------------------------------------------------------------------------ +class CD3DX12_STREAM_OUTPUT_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_STREAM_OUTPUT_SUBOBJECT() + { + Init(); + } + CD3DX12_STREAM_OUTPUT_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetSODeclEntries(const D3D12_SO_DECLARATION_ENTRY* soDeclEntries, UINT numEntries) + { + m_soDecalEntries.resize(numEntries); + for (UINT i = 0; i < numEntries; i++) + { + m_soDecalEntries[i] = D3D12_SO_DECLARATION_ENTRY{ + soDeclEntries[i].Stream, + m_Strings.LocalCopy(soDeclEntries[i].SemanticName), + soDeclEntries[i].SemanticIndex, + soDeclEntries[i].StartComponent, + soDeclEntries[i].ComponentCount, + soDeclEntries[i].OutputSlot + }; + } + // Below: using ugly way to get pointer in case .data() is not defined + m_Desc.pSODeclaration = &m_soDecalEntries[0]; + m_Desc.NumEntries = numEntries; + } + void SetBufferStrides(const UINT* bufferStrides, UINT numStrides) + { + m_Desc.pBufferStrides = bufferStrides; + m_Desc.NumStrides = numStrides; + } + void SetRasterizedStream(UINT rasterizedStream) + { + m_Desc.RasterizedStream = rasterizedStream; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT; + } + operator const D3D12_STREAM_OUTPUT_DESC& () const noexcept { return m_Desc; } + +private: + void Init() + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_STREAM_OUTPUT_DESC m_Desc; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::vector m_soDecalEntries; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_BLEND_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_BLEND_SUBOBJECT() + { + Init(); + } + CD3DX12_BLEND_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetAlphaToCoverageEnable(bool alphaToCoverageEnable) + { + m_Desc.AlphaToCoverageEnable = alphaToCoverageEnable; + } + void SetIndependentBlendEnable(bool independentBlendEnable) + { + m_Desc.IndependentBlendEnable = independentBlendEnable; + } + void SetRenderTarget(UINT renderTargetIndex, const D3D12_RENDER_TARGET_BLEND_DESC& renderTargetBlendDesc) + { + m_Desc.RenderTarget[renderTargetIndex].BlendEnable = renderTargetBlendDesc.BlendEnable; + m_Desc.RenderTarget[renderTargetIndex].BlendOp = renderTargetBlendDesc.BlendOp; + m_Desc.RenderTarget[renderTargetIndex].BlendOpAlpha = renderTargetBlendDesc.BlendOpAlpha; + m_Desc.RenderTarget[renderTargetIndex].DestBlend = renderTargetBlendDesc.DestBlend; + m_Desc.RenderTarget[renderTargetIndex].DestBlendAlpha = renderTargetBlendDesc.DestBlendAlpha; + m_Desc.RenderTarget[renderTargetIndex].LogicOp = renderTargetBlendDesc.LogicOp; + m_Desc.RenderTarget[renderTargetIndex].LogicOpEnable = renderTargetBlendDesc.LogicOpEnable; + m_Desc.RenderTarget[renderTargetIndex].RenderTargetWriteMask = renderTargetBlendDesc.RenderTargetWriteMask; + m_Desc.RenderTarget[renderTargetIndex].SrcBlend = renderTargetBlendDesc.SrcBlend; + m_Desc.RenderTarget[renderTargetIndex].SrcBlendAlpha = renderTargetBlendDesc.SrcBlendAlpha; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_BLEND; + } + operator const D3D12_BLEND_DESC& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = CD3DX12_BLEND_DESC(D3D12_DEFAULT); + } + void* Data() noexcept override { return &m_Desc; } + CD3DX12_BLEND_DESC m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_RASTERIZER_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_RASTERIZER_SUBOBJECT() + { + Init(); + } + CD3DX12_RASTERIZER_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetFillMode(D3D12_FILL_MODE fillMode) + { + m_Desc.FillMode = fillMode; + } + void SetCullMode(D3D12_CULL_MODE cullMode) + { + m_Desc.CullMode = cullMode; + } + void SetFrontCounterClockwise(BOOL frontCounterClockwise) + { + m_Desc.FrontCounterClockwise = frontCounterClockwise; + } + void SetDepthBias(FLOAT depthBias) + { + m_Desc.DepthBias = depthBias; + } + void SetDepthBiasClamp(FLOAT depthBiasClamp) + { + m_Desc.DepthBiasClamp = depthBiasClamp; + } + void SetSlopeScaledDepthBias(FLOAT slopeScaledDepthBias) + { + m_Desc.SlopeScaledDepthBias = slopeScaledDepthBias; + } + void SetDepthClipEnable(BOOL depthClipEnable) + { + m_Desc.DepthClipEnable = depthClipEnable; + } + void SetLineRasterizationMode(D3D12_LINE_RASTERIZATION_MODE lineRasterizationMode) + { + m_Desc.LineRasterizationMode = lineRasterizationMode; + } + void SetForcedSampleCount(UINT forcedSampleCount) + { + m_Desc.ForcedSampleCount = forcedSampleCount; + } + void SetConservativeRaster(D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster) + { + m_Desc.ConservativeRaster = conservativeRaster; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_RASTERIZER; + } + operator const D3D12_RASTERIZER_DESC2& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = CD3DX12_RASTERIZER_DESC2(D3D12_DEFAULT); + } + void* Data() noexcept override { return &m_Desc; } + CD3DX12_RASTERIZER_DESC2 m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_DEPTH_STENCIL2_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_DEPTH_STENCIL2_SUBOBJECT() + { + Init(); + } + CD3DX12_DEPTH_STENCIL2_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetDepthEnable(BOOL depthEnable) + { + m_Desc.DepthEnable = depthEnable; + } + void SetDepthWriteMask(D3D12_DEPTH_WRITE_MASK depthWriteMask) + { + m_Desc.DepthWriteMask = depthWriteMask; + } + void SetDepthFunc(D3D12_COMPARISON_FUNC depthFunc) + { + m_Desc.DepthFunc = depthFunc; + } + void SetStencilEnable(BOOL stencilEnable) + { + m_Desc.StencilEnable = stencilEnable; + } + void SetFrontFace(D3D12_DEPTH_STENCILOP_DESC1 frontFace) + { + m_Desc.FrontFace = { + frontFace.StencilFailOp, + frontFace.StencilDepthFailOp, + frontFace.StencilPassOp, + frontFace.StencilFunc, + frontFace.StencilReadMask, + frontFace.StencilWriteMask + }; + } + void SetBackFace(D3D12_DEPTH_STENCILOP_DESC1 backFace) + { + m_Desc.BackFace = { + backFace.StencilFailOp, + backFace.StencilDepthFailOp, + backFace.StencilPassOp, + backFace.StencilFunc, + backFace.StencilReadMask, + backFace.StencilWriteMask + }; + } + void SetDepthBoundsTestEnable(BOOL depthBoundsTestEnable) + { + m_Desc.DepthBoundsTestEnable = depthBoundsTestEnable; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2; + } + operator const D3D12_DEPTH_STENCIL_DESC2& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = CD3DX12_DEPTH_STENCIL_DESC2(D3D12_DEFAULT); + } + void* Data() noexcept override { return &m_Desc; } + CD3DX12_DEPTH_STENCIL_DESC2 m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_INPUT_LAYOUT_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_INPUT_LAYOUT_SUBOBJECT() + { + Init(); + } + CD3DX12_INPUT_LAYOUT_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void AddInputLayoutElementDesc(D3D12_INPUT_ELEMENT_DESC inputLayoutElementDesc) + { + m_inputLayoutElements.emplace_back( + D3D12_INPUT_ELEMENT_DESC{ + m_Strings.LocalCopy(inputLayoutElementDesc.SemanticName), + inputLayoutElementDesc.SemanticIndex, + inputLayoutElementDesc.Format, + inputLayoutElementDesc.InputSlot, + inputLayoutElementDesc.AlignedByteOffset, + inputLayoutElementDesc.InputSlotClass, + inputLayoutElementDesc.InstanceDataStepRate + }); + ++m_numElements; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT; + } + operator const D3D12_INPUT_LAYOUT_DESC& () const noexcept { return m_Desc; } + virtual void Finalize() override + { + if (m_numElements > 0) + { + std::list::iterator inputLayoutIt = m_inputLayoutElements.begin(); + m_inputLayoutElementsVector.resize(m_numElements); + for (UINT i = 0; inputLayoutIt != m_inputLayoutElements.end(); i++, inputLayoutIt++) + { + m_inputLayoutElementsVector[i] = *inputLayoutIt; + } + // Below: using ugly way to get pointer in case .data() is not defined + m_Desc.pInputElementDescs = &m_inputLayoutElementsVector[0]; + } + m_Desc.NumElements = m_numElements; + } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_Desc.pInputElementDescs = nullptr; + m_numElements = 0; + m_inputLayoutElements.clear(); + m_inputLayoutElementsVector.clear(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_INPUT_LAYOUT_DESC m_Desc; + std::list m_inputLayoutElements; + std::vector m_inputLayoutElementsVector; + UINT m_numElements; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_IB_STRIP_CUT_VALUE_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_IB_STRIP_CUT_VALUE_SUBOBJECT() + { + Init(); + } + CD3DX12_IB_STRIP_CUT_VALUE_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetIBStripCutValue(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE ibStripCutValue) + { + m_Desc = ibStripCutValue; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE; + } + operator const D3D12_INDEX_BUFFER_STRIP_CUT_VALUE& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_PRIMITIVE_TOPOLOGY_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_PRIMITIVE_TOPOLOGY_SUBOBJECT() + { + Init(); + } + CD3DX12_PRIMITIVE_TOPOLOGY_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetPrimitiveTopologyType(D3D12_PRIMITIVE_TOPOLOGY_TYPE primitiveTopologytype) + { + m_Desc = primitiveTopologytype; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY; + } + operator const D3D12_PRIMITIVE_TOPOLOGY_TYPE& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_PRIMITIVE_TOPOLOGY_TYPE m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_RENDER_TARGET_FORMATS_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_RENDER_TARGET_FORMATS_SUBOBJECT() + { + Init(); + } + CD3DX12_RENDER_TARGET_FORMATS_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetNumRenderTargets(UINT numRenderTargets) + { + m_Desc.NumRenderTargets = numRenderTargets; + } + void SetRenderTargetFormat(UINT renderTarget, DXGI_FORMAT renderTargetFormat) + { + m_Desc.RTFormats[renderTarget] = renderTargetFormat; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS; + } + operator const D3D12_RT_FORMAT_ARRAY& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_RT_FORMAT_ARRAY m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_DEPTH_STENCIL_FORMAT_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_DEPTH_STENCIL_FORMAT_SUBOBJECT() + { + Init(); + } + CD3DX12_DEPTH_STENCIL_FORMAT_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetDepthStencilFormat(DXGI_FORMAT depthStencilFormat) + { + m_Desc = depthStencilFormat; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT; + } + operator const DXGI_FORMAT& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + } + void* Data() noexcept override { return &m_Desc; } + DXGI_FORMAT m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_SAMPLE_DESC_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_SAMPLE_DESC_SUBOBJECT() + { + Init(); + } + CD3DX12_SAMPLE_DESC_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetCount(UINT count) + { + m_Desc.Count = count; + } + void SetQuality(UINT quality) + { + m_Desc.Quality = quality; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_SAMPLE_DESC; + } + operator const DXGI_SAMPLE_DESC& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + DXGI_SAMPLE_DESC m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_FLAGS_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_FLAGS_SUBOBJECT() + { + Init(); + } + CD3DX12_FLAGS_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetFlags(D3D12_PIPELINE_STATE_FLAGS flags) + { + m_Desc = flags; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_FLAGS; + } + operator const D3D12_PIPELINE_STATE_FLAGS& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_PIPELINE_STATE_FLAGS m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_VIEW_INSTANCING_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_VIEW_INSTANCING_SUBOBJECT() + { + Init(); + } + CD3DX12_VIEW_INSTANCING_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void AddViewInstanceLocation(D3D12_VIEW_INSTANCE_LOCATION viewInstanceLocation) + { + m_viewInstanceCount++; + m_viewInstanceLocations.emplace_back( + D3D12_VIEW_INSTANCE_LOCATION + { + viewInstanceLocation.ViewportArrayIndex, + viewInstanceLocation.RenderTargetArrayIndex + } + ); + } + void SetFlags(D3D12_VIEW_INSTANCING_FLAGS flags) + { + m_Desc.Flags = flags; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING; + } + operator const D3D12_VIEW_INSTANCING_DESC& () const noexcept { return m_Desc; } + virtual void Finalize() override + { + if (m_viewInstanceCount > 0) + { + m_viewInstanceLocationsVector.resize(m_viewInstanceCount); + std::list::iterator viewInstancingLocationIt = m_viewInstanceLocations.begin(); + for (UINT i = 0; viewInstancingLocationIt != m_viewInstanceLocations.end(); i++, viewInstancingLocationIt++) + { + m_viewInstanceLocationsVector[i] = *viewInstancingLocationIt; + } + // Below: using ugly way to get pointer in case .data() is not defined + m_Desc.pViewInstanceLocations = &m_viewInstanceLocationsVector[0]; + } + m_Desc.ViewInstanceCount = m_viewInstanceCount; + } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = CD3DX12_VIEW_INSTANCING_DESC(D3D12_DEFAULT); + m_viewInstanceCount = 0; + m_viewInstanceLocations.clear(); + m_viewInstanceLocationsVector.clear(); + } + void* Data() noexcept override { return &m_Desc; } + CD3DX12_VIEW_INSTANCING_DESC m_Desc; + UINT m_viewInstanceCount; + std::list m_viewInstanceLocations; + std::vector m_viewInstanceLocationsVector; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_DEPTH_STENCIL_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_DEPTH_STENCIL_SUBOBJECT() + { + Init(); + } + CD3DX12_DEPTH_STENCIL_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetDepthEnable(BOOL depthEnable) + { + m_Desc.DepthEnable = depthEnable; + } + void SetDepthWriteMask(D3D12_DEPTH_WRITE_MASK depthWriteMask) + { + m_Desc.DepthWriteMask = depthWriteMask; + } + void SetDepthFunc(D3D12_COMPARISON_FUNC depthFunc) + { + m_Desc.DepthFunc = depthFunc; + } + void SetStencilEnable(BOOL stencilEnable) + { + m_Desc.StencilEnable = stencilEnable; + } + void SetStencilReadMask(UINT8 stencilReadMask) + { + m_Desc.StencilReadMask = stencilReadMask; + } + void SetStencilWriteMask(UINT8 stencilWriteMask) + { + m_Desc.StencilWriteMask = stencilWriteMask; + } + void SetFrontFace(D3D12_DEPTH_STENCILOP_DESC frontFace) + { + m_Desc.FrontFace = { + frontFace.StencilFailOp, + frontFace.StencilDepthFailOp, + frontFace.StencilPassOp, + frontFace.StencilFunc + }; + } + void SetBackFace(D3D12_DEPTH_STENCILOP_DESC backFace) + { + m_Desc.BackFace = { + backFace.StencilFailOp, + backFace.StencilDepthFailOp, + backFace.StencilPassOp, + backFace.StencilFunc + }; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL; + } + operator const D3D12_DEPTH_STENCIL_DESC& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = CD3DX12_DEPTH_STENCIL_DESC(D3D12_DEFAULT); + } + void* Data() noexcept override { return &m_Desc; } + CD3DX12_DEPTH_STENCIL_DESC m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_DEPTH_STENCIL1_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_DEPTH_STENCIL1_SUBOBJECT() + { + Init(); + } + CD3DX12_DEPTH_STENCIL1_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetDepthEnable(BOOL depthEnable) + { + m_Desc.DepthEnable = depthEnable; + } + void SetDepthWriteMask(D3D12_DEPTH_WRITE_MASK depthWriteMask) + { + m_Desc.DepthWriteMask = depthWriteMask; + } + void SetDepthFunc(D3D12_COMPARISON_FUNC depthFunc) + { + m_Desc.DepthFunc = depthFunc; + } + void SetStencilEnable(BOOL stencilEnable) + { + m_Desc.StencilEnable = stencilEnable; + } + void SetStencilReadMask(UINT8 stencilReadMask) + { + m_Desc.StencilReadMask = stencilReadMask; + } + void SetStencilWriteMask(UINT8 stencilWriteMask) + { + m_Desc.StencilWriteMask = stencilWriteMask; + } + void SetFrontFace(D3D12_DEPTH_STENCILOP_DESC frontFace) + { + m_Desc.FrontFace = { + frontFace.StencilFailOp, + frontFace.StencilDepthFailOp, + frontFace.StencilPassOp, + frontFace.StencilFunc + }; + } + void SetBackFace(D3D12_DEPTH_STENCILOP_DESC backFace) + { + m_Desc.BackFace = { + backFace.StencilFailOp, + backFace.StencilDepthFailOp, + backFace.StencilPassOp, + backFace.StencilFunc + }; + } + void SetDepthBoundsTestEnable(BOOL depthBoundsTestEnable) + { + m_Desc.DepthBoundsTestEnable = depthBoundsTestEnable; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1; + } + operator const D3D12_DEPTH_STENCIL_DESC1& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEFAULT); + } + void* Data() noexcept override { return &m_Desc; } + CD3DX12_DEPTH_STENCIL_DESC1 m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_SAMPLE_MASK_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_SAMPLE_MASK_SUBOBJECT() + { + Init(); + } + CD3DX12_SAMPLE_MASK_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetSampleMask(UINT sampleMask) + { + m_Desc = sampleMask; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_SAMPLE_MASK; + } + operator const UINT& () const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + } + void* Data() noexcept override { return &m_Desc; } + UINT m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_GENERIC_PROGRAM_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_GENERIC_PROGRAM_SUBOBJECT() + { + Init(); + } + CD3DX12_GENERIC_PROGRAM_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetProgramName(LPCWSTR ProgramName) + { + m_Desc.ProgramName = m_Strings.LocalCopy(ProgramName); + } + void AddExport(LPCWSTR exportName) + { + m_Exports.emplace_back(m_Strings.LocalCopy(exportName)); + m_numExports++; + } + void AddSubobject(const D3D12_STATE_SUBOBJECT& subobject) + { + m_Subobjects.emplace_back(&subobject); + m_numSubobjects++; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_GENERIC_PROGRAM; + } + operator const D3D12_GENERIC_PROGRAM_DESC& () const noexcept { return m_Desc; } + virtual void Finalize() override + { + // Set exports + if (m_numExports > 0) + { + m_ExportsVector.resize(m_numExports); + std::list::iterator exportIt = m_Exports.begin(); + for (UINT i = 0; exportIt != m_Exports.end(); i++, exportIt++) + { + m_ExportsVector[i] = *exportIt; + } + // Below: using ugly way to get pointer in case .data() is not defined + m_Desc.pExports = &m_ExportsVector[0]; + } + else + { + m_Desc.pExports = nullptr; + } + m_Desc.NumExports = m_numExports; + + // Set subobjects + if (m_numSubobjects > 0) + { + m_SubobjectsVector.resize(m_numSubobjects); + std::list::iterator subobjectIt = m_Subobjects.begin(); + for (UINT i = 0; subobjectIt != m_Subobjects.end(); i++, subobjectIt++) + { + m_SubobjectsVector[i] = *subobjectIt; + } + // Below: using ugly way to get pointer in case .data() is not defined + m_Desc.ppSubobjects = &m_SubobjectsVector[0]; + } + else + { + m_Desc.ppSubobjects = nullptr; + } + m_Desc.NumSubobjects = m_numSubobjects; + } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_numExports = 0; + m_numSubobjects = 0; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_GENERIC_PROGRAM_DESC m_Desc; + std::list m_Exports; + std::vector m_ExportsVector; + UINT m_numExports; + std::list m_Subobjects; + std::vector m_SubobjectsVector; + UINT m_numSubobjects; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_NODE_OUTPUT_OVERRIDES +{ +public: + CD3DX12_NODE_OUTPUT_OVERRIDES(const D3D12_NODE_OUTPUT_OVERRIDES** ppOwner, UINT* pNumOutputOverrides) noexcept + { + m_Desc.clear(); + m_ppOwner = ppOwner; + *m_ppOwner = nullptr; + m_pNumOutputOverrides = pNumOutputOverrides; + *m_pNumOutputOverrides = 0; + } + void NewOutputOverride() + { + m_Desc.emplace_back(D3D12_NODE_OUTPUT_OVERRIDES{}); + *m_ppOwner = m_Desc.data(); + (*m_pNumOutputOverrides)++; + } + void OutputIndex(UINT index) + { + m_Desc.back().OutputIndex = index; + } + void NewName(LPCWSTR Name, UINT ArrayIndex = 0) + { + m_NodeIDs.emplace_front(D3D12_NODE_ID{ m_Strings.LocalCopy(Name),ArrayIndex }); + m_Desc.back().pNewName = &m_NodeIDs.front(); + } + void AllowSparseNodes(BOOL bAllow) + { + m_UINTs.emplace_front((UINT)bAllow); + m_Desc.back().pAllowSparseNodes = (BOOL*)&m_UINTs.front(); + } + void MaxOutputRecords(UINT maxOutputRecords) noexcept + { + m_UINTs.emplace_front(maxOutputRecords); + m_Desc.back().pMaxRecords = &m_UINTs.front(); + } + void MaxOutputRecordsSharedWith(UINT outputIndex) noexcept + { + m_UINTs.emplace_front(outputIndex); + m_Desc.back().pMaxRecordsSharedWithOutputIndex = &m_UINTs.front(); + } +private: + std::vector m_Desc; + // Cached parameters + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::forward_list m_UINTs; + std::forward_list m_NodeIDs; + const D3D12_NODE_OUTPUT_OVERRIDES** m_ppOwner; + UINT* m_pNumOutputOverrides; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_NODE_HELPER_BASE +{ +public: + virtual ~CD3DX12_NODE_HELPER_BASE() = default; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_SHADER_NODE // Not specifying launch mode. + // Don't need to distinguish if no parameter overriding is happening + : public CD3DX12_NODE_HELPER_BASE +{ +public: + CD3DX12_SHADER_NODE( + D3D12_NODE* pNode, + LPCWSTR _Shader = nullptr) + { + m_pDesc = pNode; + m_pDesc->NodeType = D3D12_NODE_TYPE_SHADER; + Shader(_Shader); + } + void Shader(LPCWSTR _Shader) + { + m_pDesc->Shader.Shader = m_Strings.LocalCopy(_Shader); + } + D3D12_NODE* m_pDesc; +private: + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; +}; + +//------------------------------------------------------------------------------------------------ +// Use this class when defining a broadcasting launch node where configuration parameters +// need to be overridden. If overrides are not needed, just use CD3DX12_COMPUTE_SHADER_NODE +class CD3DX12_BROADCASTING_LAUNCH_NODE_OVERRIDES + : public CD3DX12_NODE_HELPER_BASE +{ +public: + CD3DX12_BROADCASTING_LAUNCH_NODE_OVERRIDES( + D3D12_NODE* pNode, + LPCWSTR _Shader = nullptr) : + m_NodeOutputOverrides(&Overrides.pOutputOverrides, &Overrides.NumOutputOverrides) + { + Overrides = {}; + m_pDesc = pNode; + m_pDesc->NodeType = D3D12_NODE_TYPE_SHADER; + m_pDesc->Shader.OverridesType = D3D12_NODE_OVERRIDES_TYPE_BROADCASTING_LAUNCH; + m_pDesc->Shader.pBroadcastingLaunchOverrides = &Overrides; + Shader(_Shader); + } + void Shader(LPCWSTR _Shader) + { + m_pDesc->Shader.Shader = m_Strings.LocalCopy(_Shader); + } + void LocalRootArgumentsTableIndex(UINT index) + { + m_UINTs.emplace_front(index); + Overrides.pLocalRootArgumentsTableIndex = &m_UINTs.front(); + } + void ProgramEntry(BOOL bIsProgramEntry) + { + m_UINTs.emplace_front(bIsProgramEntry); + Overrides.pProgramEntry = (BOOL*)&m_UINTs.front(); + } + void NewName(D3D12_NODE_ID NodeID) + { + m_NodeIDs.emplace_front(D3D12_NODE_ID{ m_Strings.LocalCopy(NodeID.Name),NodeID.ArrayIndex }); + Overrides.pNewName = &m_NodeIDs.front(); + } + void ShareInputOf(D3D12_NODE_ID NodeID) + { + m_NodeIDs.emplace_front(D3D12_NODE_ID{ m_Strings.LocalCopy(NodeID.Name),NodeID.ArrayIndex }); + Overrides.pShareInputOf = &m_NodeIDs.front(); + } + void DispatchGrid(UINT x, UINT y, UINT z) + { + m_UINT3s.emplace_front(UINT3{ x,y,z }); + Overrides.pDispatchGrid = (UINT*)&m_UINT3s.front(); + } + void MaxDispatchGrid(UINT x, UINT y, UINT z) + { + m_UINT3s.emplace_front(UINT3{x,y,z}); + Overrides.pMaxDispatchGrid = (UINT*)&m_UINT3s.front(); + } + CD3DX12_NODE_OUTPUT_OVERRIDES& NodeOutputOverrides() + { + return m_NodeOutputOverrides; + } + D3D12_BROADCASTING_LAUNCH_OVERRIDES Overrides; + D3D12_NODE* m_pDesc; +private: + // Cached parameters + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::forward_list m_UINTs; + struct UINT3 + { + UINT x; + UINT y; + UINT z; + }; + std::forward_list m_UINT3s; + std::forward_list m_NodeIDs; + CD3DX12_NODE_OUTPUT_OVERRIDES m_NodeOutputOverrides; +}; + +//------------------------------------------------------------------------------------------------ +// Use this class when defining a coalescing launch node where configuration parameters +// need to be overridden. If overrides are not needed, just use CD3DX12_COMPUTE_SHADER_NODE +class CD3DX12_COALESCING_LAUNCH_NODE_OVERRIDES + : public CD3DX12_NODE_HELPER_BASE +{ +public: + CD3DX12_COALESCING_LAUNCH_NODE_OVERRIDES( + D3D12_NODE* pNode, + LPCWSTR _Shader = nullptr) : + m_NodeOutputOverrides(&Overrides.pOutputOverrides, &Overrides.NumOutputOverrides) + { + Overrides = {}; + m_pDesc = pNode; + m_pDesc->NodeType = D3D12_NODE_TYPE_SHADER; + m_pDesc->Shader.OverridesType = D3D12_NODE_OVERRIDES_TYPE_COALESCING_LAUNCH; + m_pDesc->Shader.pCoalescingLaunchOverrides = &Overrides; + Shader(_Shader); + } + void Shader(LPCWSTR _Shader) + { + m_pDesc->Shader.Shader = m_Strings.LocalCopy(_Shader); + } + void LocalRootArgumentsTableIndex(UINT index) + { + m_UINTs.emplace_front(index); + Overrides.pLocalRootArgumentsTableIndex = &m_UINTs.front(); + } + void ProgramEntry(BOOL bIsProgramEntry) + { + m_UINTs.emplace_front(bIsProgramEntry); + Overrides.pProgramEntry = (BOOL*)&m_UINTs.front(); + } + void NewName(D3D12_NODE_ID NodeID) + { + m_NodeIDs.emplace_front(D3D12_NODE_ID{ m_Strings.LocalCopy(NodeID.Name),NodeID.ArrayIndex }); + Overrides.pNewName = &m_NodeIDs.front(); + } + void ShareInputOf(D3D12_NODE_ID NodeID) + { + m_NodeIDs.emplace_front(D3D12_NODE_ID{ m_Strings.LocalCopy(NodeID.Name),NodeID.ArrayIndex }); + Overrides.pShareInputOf = &m_NodeIDs.front(); + } + CD3DX12_NODE_OUTPUT_OVERRIDES& NodeOutputOverrides() + { + return m_NodeOutputOverrides; + } + D3D12_COALESCING_LAUNCH_OVERRIDES Overrides; + D3D12_NODE* m_pDesc; +private: + // Cached parameters + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::forward_list m_UINTs; + struct UINT3 + { + UINT x; + UINT y; + UINT z; + }; + std::forward_list m_UINT3s; + std::forward_list m_NodeIDs; + CD3DX12_NODE_OUTPUT_OVERRIDES m_NodeOutputOverrides; +}; + +//------------------------------------------------------------------------------------------------ +// Use this class when defining a thread launch node where configuration parameters +// need to be overridden. If overrides are not needed, just use CD3DX12_COMPUTE_SHADER_NODE +class CD3DX12_THREAD_LAUNCH_NODE_OVERRIDES + : public CD3DX12_NODE_HELPER_BASE +{ +public: + CD3DX12_THREAD_LAUNCH_NODE_OVERRIDES( + D3D12_NODE* pNode, + LPCWSTR _Shader = nullptr) : + m_NodeOutputOverrides(&Overrides.pOutputOverrides, &Overrides.NumOutputOverrides) + { + Overrides = {}; + m_pDesc = pNode; + m_pDesc->NodeType = D3D12_NODE_TYPE_SHADER; + m_pDesc->Shader.OverridesType = D3D12_NODE_OVERRIDES_TYPE_THREAD_LAUNCH; + m_pDesc->Shader.pThreadLaunchOverrides = &Overrides; + Shader(_Shader); + } + void Shader(LPCWSTR _Shader) + { + m_pDesc->Shader.Shader = m_Strings.LocalCopy(_Shader); + } + void LocalRootArgumentsTableIndex(UINT index) + { + m_UINTs.emplace_front(index); + Overrides.pLocalRootArgumentsTableIndex = &m_UINTs.front(); + } + void ProgramEntry(BOOL bIsProgramEntry) + { + m_UINTs.emplace_front(bIsProgramEntry); + Overrides.pProgramEntry = (BOOL*)&m_UINTs.front(); + } + void NewName(D3D12_NODE_ID NodeID) + { + m_NodeIDs.emplace_front(D3D12_NODE_ID{ m_Strings.LocalCopy(NodeID.Name),NodeID.ArrayIndex }); + Overrides.pNewName = &m_NodeIDs.front(); + } + void ShareInputOf(D3D12_NODE_ID NodeID) + { + m_NodeIDs.emplace_front(D3D12_NODE_ID{ m_Strings.LocalCopy(NodeID.Name),NodeID.ArrayIndex }); + Overrides.pShareInputOf = &m_NodeIDs.front(); + } + CD3DX12_NODE_OUTPUT_OVERRIDES& NodeOutputOverrides() + { + return m_NodeOutputOverrides; + } + D3D12_THREAD_LAUNCH_OVERRIDES Overrides; + D3D12_NODE* m_pDesc; +private: + // Cached parameters + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::forward_list m_UINTs; + std::forward_list m_NodeIDs; + CD3DX12_NODE_OUTPUT_OVERRIDES m_NodeOutputOverrides; +}; + +//------------------------------------------------------------------------------------------------ +// Use this class when defining a node where configuration parameters +// need to be overridden for parameters that are common to all launch node types. +// This option is a convenience if you don't want to determine what the launch mode is +// and just want to override a setting that isn't specific to launch mode. +// If overrides are not needed, just use CD3DX12_COMPUTE_SHADER_NODE +class CD3DX12_COMMON_COMPUTE_NODE_OVERRIDES + : public CD3DX12_NODE_HELPER_BASE +{ +public: + CD3DX12_COMMON_COMPUTE_NODE_OVERRIDES( + D3D12_NODE* pNode, + LPCWSTR _Shader = nullptr) : + m_NodeOutputOverrides(&Overrides.pOutputOverrides, &Overrides.NumOutputOverrides) + { + Overrides = {}; + m_pDesc = pNode; + m_pDesc->NodeType = D3D12_NODE_TYPE_SHADER; + m_pDesc->Shader.OverridesType = D3D12_NODE_OVERRIDES_TYPE_COMMON_COMPUTE; + m_pDesc->Shader.pThreadLaunchOverrides = &Overrides; + Shader(_Shader); + } + void Shader(LPCWSTR _Shader) + { + m_pDesc->Shader.Shader = m_Strings.LocalCopy(_Shader); + } + void LocalRootArgumentsTableIndex(UINT index) + { + m_UINTs.emplace_front(index); + Overrides.pLocalRootArgumentsTableIndex = &m_UINTs.front(); + } + void ProgramEntry(BOOL bIsProgramEntry) + { + m_UINTs.emplace_front(bIsProgramEntry); + Overrides.pProgramEntry = (BOOL*)&m_UINTs.front(); + } + void NewName(D3D12_NODE_ID NodeID) + { + m_NodeIDs.emplace_front(D3D12_NODE_ID{ m_Strings.LocalCopy(NodeID.Name),NodeID.ArrayIndex }); + Overrides.pNewName = &m_NodeIDs.front(); + } + void ShareInputOf(D3D12_NODE_ID NodeID) + { + m_NodeIDs.emplace_front(D3D12_NODE_ID{ m_Strings.LocalCopy(NodeID.Name),NodeID.ArrayIndex }); + Overrides.pShareInputOf = &m_NodeIDs.front(); + } + CD3DX12_NODE_OUTPUT_OVERRIDES& NodeOutputOverrides() + { + return m_NodeOutputOverrides; + } + D3D12_THREAD_LAUNCH_OVERRIDES Overrides; + D3D12_NODE* m_pDesc; +private: + // Cached parameters + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::forward_list m_UINTs; + std::forward_list m_NodeIDs; + CD3DX12_NODE_OUTPUT_OVERRIDES m_NodeOutputOverrides; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_WORK_GRAPH_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_WORK_GRAPH_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_WORK_GRAPH_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_WORK_GRAPH; + } + void IncludeAllAvailableNodes() + { + m_Desc.Flags |= D3D12_WORK_GRAPH_FLAG_INCLUDE_ALL_AVAILABLE_NODES; + } + void SetProgramName(LPCWSTR ProgramName) + { + m_Desc.ProgramName = m_Strings.LocalCopy(ProgramName); + } + void AddEntrypoint(D3D12_NODE_ID Entrypoint) + { + m_Entrypoints.emplace_back(D3D12_NODE_ID{ m_Strings.LocalCopy(Entrypoint.Name),Entrypoint.ArrayIndex }); + m_NumEntrypoints++; + } + + template + T* CreateNode() + { + m_NodeDescs.push_back({}); + m_NumNodes++; + T* pNodeHelper = new T(&m_NodeDescs.back()); + m_OwnedNodeHelpers.emplace_back(pNodeHelper); + return pNodeHelper; + } + CD3DX12_SHADER_NODE* CreateShaderNode(LPCWSTR Shader = nullptr) + { + auto pNode = CreateNode(); + pNode->Shader(Shader); + return pNode; + } + CD3DX12_BROADCASTING_LAUNCH_NODE_OVERRIDES* CreateBroadcastingLaunchNodeOverrides(LPCWSTR Shader = nullptr) + { + auto pNode = CreateNode(); + pNode->Shader(Shader); + return pNode; + } + CD3DX12_COALESCING_LAUNCH_NODE_OVERRIDES* CreateCoalescingLaunchNodeOverrides(LPCWSTR Shader = nullptr) + { + auto pNode = CreateNode(); + pNode->Shader(Shader); + return pNode; + } + CD3DX12_THREAD_LAUNCH_NODE_OVERRIDES* CreateThreadLaunchNodeOverrides(LPCWSTR Shader = nullptr) + { + auto pNode = CreateNode(); + pNode->Shader(Shader); + return pNode; + } + CD3DX12_COMMON_COMPUTE_NODE_OVERRIDES* CreateCommonComputeNodeOverrides(LPCWSTR Shader = nullptr) + { + auto pNode = CreateNode(); + pNode->Shader(Shader); + return pNode; + } + operator const D3D12_WORK_GRAPH_DESC& () noexcept + { + return m_Desc; + } + virtual void Finalize() override + { + m_EntrypointsVector.resize(m_NumEntrypoints); + std::list::iterator entryIt = m_Entrypoints.begin(); + for (UINT n = 0; n < m_NumEntrypoints; n++, entryIt++) + { + m_EntrypointsVector[n] = *entryIt; + } + m_Desc.NumEntrypoints = m_NumEntrypoints; + m_Desc.pEntrypoints = m_EntrypointsVector.data(); + + m_NodeDescsVector.resize(m_NumNodes); + std::list::iterator nodeIt = m_NodeDescs.begin(); + for (UINT n = 0; n < m_NumNodes; n++, nodeIt++) + { + m_NodeDescsVector[n] = *nodeIt; + } + m_Desc.NumExplicitlyDefinedNodes = m_NumNodes; + m_Desc.pExplicitlyDefinedNodes = m_NodeDescsVector.data(); + } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_NodeDescs.clear(); + m_NodeDescsVector.clear(); + m_NumNodes = 0; + m_NumEntrypoints = 0; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_WORK_GRAPH_DESC m_Desc; + std::list m_Entrypoints; + UINT m_NumEntrypoints; + std::vector m_EntrypointsVector; + std::list m_NodeDescs; + UINT m_NumNodes; + std::vector m_NodeDescsVector; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::list> m_OwnedNodeHelpers; +}; +#endif // D3D12_SDK_VERSION >= 612 + +#undef D3DX12_COM_PTR +#undef D3DX12_COM_PTR_GET +#undef D3DX12_COM_PTR_ADDRESSOF + diff --git a/deps/DirectX-Headers/include/directx/dxcore_interface.h b/deps/DirectX-Headers/include/directx/dxcore_interface.h index f01d203..aca8518 100644 --- a/deps/DirectX-Headers/include/directx/dxcore_interface.h +++ b/deps/DirectX-Headers/include/directx/dxcore_interface.h @@ -35,13 +35,25 @@ enum class DXCoreAdapterProperty : uint32_t IsHardware = 11, IsIntegrated = 12, IsDetachable = 13, - HardwareIDParts = 14 + HardwareIDParts = 14, + PhysicalAdapterCount = 15, + AdapterEngineCount = 16, + AdapterEngineName = 17, }; enum class DXCoreAdapterState : uint32_t { IsDriverUpdateInProgress = 0, - AdapterMemoryBudget = 1 + AdapterMemoryBudget = 1, + AdapterMemoryUsageBytes = 2, + AdapterMemoryUsageByProcessBytes = 3, + AdapterEngineRunningTimeMicroseconds = 4, + AdapterEngineRunningTimeByProcessMicroseconds = 5, + AdapterTemperatureCelsius = 6, + AdapterInUseProcessCount = 7, + AdapterInUseProcessSet = 8, + AdapterEngineFrequencyHertz = 9, + AdapterMemoryFrequencyHertz = 10 }; enum class DXCoreSegmentGroup : uint32_t @@ -65,6 +77,34 @@ enum class DXCoreAdapterPreference : uint32_t HighPerformance = 2 }; +enum class DXCoreWorkload : uint32_t +{ + Graphics = 0, + Compute = 1, + Media = 2, + MachineLearning = 3, +}; + +enum class DXCoreRuntimeFilterFlags : uint32_t +{ + None = 0x0, + D3D11 = 0x1, + D3D12 = 0x2 +}; + +DEFINE_ENUM_FLAG_OPERATORS(DXCoreRuntimeFilterFlags) + +enum class DXCoreHardwareTypeFilterFlags : uint32_t +{ + None = 0x0, + GPU = 0x1, + ComputeAccelerator = 0x2, + NPU = 0x4, + MediaAccelerator = 0x8 +}; + +DEFINE_ENUM_FLAG_OPERATORS(DXCoreHardwareTypeFilterFlags) + struct DXCoreHardwareID { uint32_t vendorID; @@ -96,6 +136,86 @@ struct DXCoreAdapterMemoryBudget uint64_t currentReservation; }; +struct DXCoreAdapterEngineIndex +{ + uint32_t physicalAdapterIndex; + uint32_t engineIndex; +}; + +struct DXCoreEngineQueryInput +{ + DXCoreAdapterEngineIndex adapterEngineIndex; + uint32_t processId; +}; + +struct DXCoreEngineQueryOutput +{ + uint64_t runningTime; + bool processQuerySucceeded; +}; + +enum class DXCoreMemoryType : uint32_t +{ + Dedicated = 0, + Shared = 1 +}; + +struct DXCoreMemoryUsage +{ + uint64_t committed; + uint64_t resident; +}; + +struct DXCoreMemoryQueryInput +{ + uint32_t physicalAdapterIndex; + DXCoreMemoryType memoryType; +}; + +struct DXCoreProcessMemoryQueryInput +{ + uint32_t physicalAdapterIndex; + DXCoreMemoryType memoryType; + uint32_t processId; +}; + +struct DXCoreProcessMemoryQueryOutput +{ + DXCoreMemoryUsage memoryUsage; + bool processQuerySucceeded; +}; + +struct DXCoreAdapterProcessSetQueryInput +{ + uint32_t arraySize; + _Field_size_(arraySize) uint32_t* processIds; +}; + +struct DXCoreAdapterProcessSetQueryOutput +{ + uint32_t processesWritten; + uint32_t processesTotal; +}; + +struct DXCoreEngineNamePropertyInput +{ + DXCoreAdapterEngineIndex adapterEngineIndex; + uint32_t engineNameLength; + _Field_size_(engineNameLength) wchar_t *engineName; +}; + +struct DXCoreEngineNamePropertyOutput +{ + uint32_t engineNameLength; +}; + +struct DXCoreFrequencyQueryOutput +{ + uint64_t frequency; + uint64_t maxFrequency; + uint64_t maxOverclockedFrequency; +}; + typedef void (STDMETHODCALLTYPE *PFN_DXCORE_NOTIFICATION_CALLBACK)( DXCoreNotificationType notificationType, _In_ IUnknown *object, @@ -104,11 +224,21 @@ typedef void (STDMETHODCALLTYPE *PFN_DXCORE_NOTIFICATION_CALLBACK)( static_assert(sizeof(bool) == 1, "bool assumed as one byte"); DEFINE_GUID(IID_IDXCoreAdapterFactory, 0x78ee5945, 0xc36e, 0x4b13, 0xa6, 0x69, 0x00, 0x5d, 0xd1, 0x1c, 0x0f, 0x06); +DEFINE_GUID(IID_IDXCoreAdapterFactory1, 0xd5682e19, 0x6d21, 0x401c, 0x82, 0x7a, 0x9a, 0x51, 0xa4, 0xea, 0x35, 0xd7); DEFINE_GUID(IID_IDXCoreAdapterList, 0x526c7776, 0x40e9, 0x459b, 0xb7, 0x11, 0xf3, 0x2a, 0xd7, 0x6d, 0xfc, 0x28); DEFINE_GUID(IID_IDXCoreAdapter, 0xf0db4c7f, 0xfe5a, 0x42a2, 0xbd, 0x62, 0xf2, 0xa6, 0xcf, 0x6f, 0xc8, 0x3e); +DEFINE_GUID(IID_IDXCoreAdapter1, 0xa0783366, 0xcfa3, 0x43be, 0x9d, 0x79, 0x55, 0xb2, 0xda, 0x97, 0xc6, 0x3c); + DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D11_GRAPHICS, 0x8c47866b, 0x7583, 0x450d, 0xf0, 0xf0, 0x6b, 0xad, 0xa8, 0x95, 0xaf, 0x4b); DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, 0x0c9ece4d, 0x2f6e, 0x4f01, 0x8c, 0x96, 0xe8, 0x9e, 0x33, 0x1b, 0x47, 0xb1); DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE, 0x248e2800, 0xa793, 0x4724, 0xab, 0xaa, 0x23, 0xa6, 0xde, 0x1b, 0xe0, 0x90); +DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GENERIC_ML, 0xb71b0d41, 0x1088, 0x422f, 0xa2, 0x7c, 0x2, 0x50, 0xb7, 0xd3, 0xa9, 0x88); +DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GENERIC_MEDIA, 0x8eb2c848, 0x82f6, 0x4b49, 0xaa, 0x87, 0xae, 0xcf, 0xcf, 0x1, 0x74, 0xc6); + +DEFINE_GUID(DXCORE_HARDWARE_TYPE_ATTRIBUTE_GPU, 0xb69eb219, 0x3ded, 0x4464, 0x97, 0x9f, 0xa0, 0xb, 0xd4, 0x68, 0x70, 0x6); +DEFINE_GUID(DXCORE_HARDWARE_TYPE_ATTRIBUTE_COMPUTE_ACCELERATOR, 0xe0b195da, 0x58ef, 0x4a22, 0x90, 0xf1, 0x1f, 0x28, 0x16, 0x9c, 0xab, 0x8d); +DEFINE_GUID(DXCORE_HARDWARE_TYPE_ATTRIBUTE_NPU, 0xd46140c4, 0xadd7, 0x451b, 0x9e, 0x56, 0x6, 0xfe, 0x8c, 0x3b, 0x58, 0xed); +DEFINE_GUID(DXCORE_HARDWARE_TYPE_ATTRIBUTE_MEDIA_ACCELERATOR, 0x66bdb96a, 0x50b, 0x44c7, 0xa4, 0xfd, 0xd1, 0x44, 0xce, 0xa, 0xb4, 0x43); /* interface IDXCoreAdapter */ MIDL_INTERFACE("f0db4c7f-fe5a-42a2-bd62-f2a6cf6fc83e") @@ -214,6 +344,32 @@ IDXCoreAdapter : public IUnknown } }; +/* interface IDXCoreAdapter1 */ +MIDL_INTERFACE("a0783366-cfa3-43be-9d79-55b2da97c63c") +IDXCoreAdapter1 : public IDXCoreAdapter +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetPropertyWithInput( + DXCoreAdapterProperty property, + size_t inputPropertyDetailsSize, + _In_reads_bytes_opt_(inputPropertyDetailsSize) const void *inputPropertyDetails, + size_t outputBufferSize, + _Out_writes_bytes_(outputBufferSize) void *outputBuffer) = 0; + + template + HRESULT GetPropertyWithInput( + DXCoreAdapterProperty property, + _In_reads_bytes_opt_(sizeof(T1)) const T1 *inputPropertyDetails, + _Out_writes_bytes_(sizeof(T2)) T2 *outputBuffer) + { + return GetPropertyWithInput(property, + sizeof(T1), + (const void*)inputPropertyDetails, + sizeof(T2), + (void*)outputBuffer); + } +}; + /* interface IDXCoreAdapterList */ MIDL_INTERFACE("526c7776-40e9-459b-b711-f32ad76dfc28") IDXCoreAdapterList : public IUnknown @@ -309,8 +465,33 @@ IDXCoreAdapterFactory : public IUnknown uint32_t eventCookie) = 0; }; +/* interface IDXCoreAdapterFactory1 */ +MIDL_INTERFACE("d5682e19-6d21-401c-827a-9a51a4ea35d7") +IDXCoreAdapterFactory1 : public IDXCoreAdapterFactory +{ +public: + virtual HRESULT STDMETHODCALLTYPE CreateAdapterListByWorkload( + DXCoreWorkload workload, + DXCoreRuntimeFilterFlags runtimeFilter, + DXCoreHardwareTypeFilterFlags hardwareTypeFilter, + REFIID riid, + _COM_Outptr_ void **ppvAdapterList) = 0; + + template + HRESULT STDMETHODCALLTYPE CreateAdapterListByWorkload( + DXCoreWorkload workload, + DXCoreRuntimeFilterFlags runtimeFilter, + DXCoreHardwareTypeFilterFlags hardwareTypeFilter, + _COM_Outptr_ T **ppvAdapterList) + { + return CreateAdapterListByWorkload(workload, + runtimeFilter, + hardwareTypeFilter, + IID_PPV_ARGS(ppvAdapterList)); + } +}; + #endif // __cplusplus #endif // __dxcore_interface_h__ - diff --git a/deps/DirectX-Headers/include/directx/dxgicommon.idl b/deps/DirectX-Headers/include/directx/dxgicommon.idl index 856f9fb..4980058 100644 --- a/deps/DirectX-Headers/include/directx/dxgicommon.idl +++ b/deps/DirectX-Headers/include/directx/dxgicommon.idl @@ -3,6 +3,7 @@ // Licensed under the MIT license // +import "ocidl.idl"; typedef struct DXGI_RATIONAL { diff --git a/deps/DirectX-Headers/include/directx/dxgiformat.h b/deps/DirectX-Headers/include/directx/dxgiformat.h index a0930cf..28f087f 100644 --- a/deps/DirectX-Headers/include/directx/dxgiformat.h +++ b/deps/DirectX-Headers/include/directx/dxgiformat.h @@ -135,6 +135,8 @@ typedef enum DXGI_FORMAT DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 189, DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 190, + DXGI_FORMAT_A4B4G4R4_UNORM = 191, + DXGI_FORMAT_FORCE_UINT = 0xffffffff } DXGI_FORMAT; diff --git a/deps/DirectX-Headers/include/directx/dxgiformat.idl b/deps/DirectX-Headers/include/directx/dxgiformat.idl index 820ce89..d3eb0a7 100644 --- a/deps/DirectX-Headers/include/directx/dxgiformat.idl +++ b/deps/DirectX-Headers/include/directx/dxgiformat.idl @@ -131,6 +131,8 @@ typedef enum DXGI_FORMAT DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 189, DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 190, + DXGI_FORMAT_A4B4G4R4_UNORM = 191, + DXGI_FORMAT_FORCE_UINT = 0xffffffff } DXGI_FORMAT; diff --git a/deps/DirectX-Headers/include/dxguids/dxguids.h b/deps/DirectX-Headers/include/dxguids/dxguids.h index b9a7b08..f3f0548 100644 --- a/deps/DirectX-Headers/include/dxguids/dxguids.h +++ b/deps/DirectX-Headers/include/dxguids/dxguids.h @@ -190,6 +190,8 @@ WINADAPTER_IID(ID3D12InfoQueue1, 0x2852dd88, 0xb484, 0x4c0c, 0xb6, 0xb1, 0x67, 0 // DXCore #ifdef __dxcore_interface_h__ WINADAPTER_IID(IDXCoreAdapterFactory, 0x78ee5945, 0xc36e, 0x4b13, 0xa6, 0x69, 0x00, 0x5d, 0xd1, 0x1c, 0x0f, 0x06); +WINADAPTER_IID(IDXCoreAdapterFactory1, 0xd5682e19, 0x6d21, 0x401c, 0x82, 0x7a, 0x9a, 0x51, 0xa4, 0xea, 0x35, 0xd7); WINADAPTER_IID(IDXCoreAdapterList, 0x526c7776, 0x40e9, 0x459b, 0xb7, 0x11, 0xf3, 0x2a, 0xd7, 0x6d, 0xfc, 0x28); WINADAPTER_IID(IDXCoreAdapter, 0xf0db4c7f, 0xfe5a, 0x42a2, 0xbd, 0x62, 0xf2, 0xa6, 0xcf, 0x6f, 0xc8, 0x3e); +WINADAPTER_IID(IDXCoreAdapter1, 0xa0783366, 0xcfa3, 0x43be, 0x9d, 0x79, 0x55, 0xb2, 0xda, 0x97, 0xc6, 0x3c); #endif diff --git a/deps/DirectX-Headers/meson.build b/deps/DirectX-Headers/meson.build deleted file mode 100644 index f271ae9..0000000 --- a/deps/DirectX-Headers/meson.build +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. - -project('DirectX-Headers', 'cpp', version : '1.606.4', - default_options : ['cpp_std=c++14']) - -inc_dirs = [include_directories('include', is_system : true)] -install_inc_subdirs = [''] - -if host_machine.system() != 'windows' - inc_dirs += include_directories('include/wsl/stubs', is_system : true) - install_inc_subdirs += ['', 'wsl/stubs', 'directx'] -endif - -guids_lib = static_library('DirectX-Guids', 'src/dxguids.cpp', include_directories : inc_dirs, install : true) - -dep_dxheaders = declare_dependency( - link_with : guids_lib, - include_directories : inc_dirs) - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('DirectX-Headers', dep_dxheaders) -endif - -if not meson.is_subproject() and get_option('build-test') - subdir('test') -endif - -pkg = import('pkgconfig') -pkg.generate(name : 'DirectX-Headers', - description : 'Headers for using D3D12', - libraries : [guids_lib], - version : meson.project_version(), - subdirs : install_inc_subdirs) -install_subdir('include', install_dir : '') diff --git a/deps/DirectX-Headers/meson_options.txt b/deps/DirectX-Headers/meson_options.txt deleted file mode 100644 index a6ed5d3..0000000 --- a/deps/DirectX-Headers/meson_options.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. - -option('build-test', - type : 'boolean', - value : true, - description : 'Build the test') diff --git a/deps/DirectX-Headers/src/d3dx12_property_format_table.cpp b/deps/DirectX-Headers/src/d3dx12_property_format_table.cpp new file mode 100644 index 0000000..aee52ab --- /dev/null +++ b/deps/DirectX-Headers/src/d3dx12_property_format_table.cpp @@ -0,0 +1,2445 @@ + + + +//********************************************************* +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +// +//********************************************************* + +#ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN +#endif +#ifndef NOMINMAX + #define NOMINMAX 1 +#endif +#ifdef __MINGW32__ + #include +#endif +#ifndef _WIN32 + #include +#endif +#include "d3dx12_property_format_table.h" +#include +#include +#include "D3D12TokenizedProgramFormat.hpp" +#if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 606) +#ifndef ASSUME + #define ASSUME(x) assert(x) +#endif + +#define R D3DFCN_R +#define G D3DFCN_G +#define B D3DFCN_B +#define A D3DFCN_A +#define D D3DFCN_D +#define S D3DFCN_S +#define X D3DFCN_X + +#define _TYPELESS D3DFCI_TYPELESS +#define _FLOAT D3DFCI_FLOAT +#define _SNORM D3DFCI_SNORM +#define _UNORM D3DFCI_UNORM +#define _SINT D3DFCI_SINT +#define _UINT D3DFCI_UINT +#define _UNORM_SRGB D3DFCI_UNORM_SRGB +#define _FIXED_2_8 D3DFCI_BIASED_FIXED_2_8 + +#ifndef INTSAFE_E_ARITHMETIC_OVERFLOW + #define INTSAFE_E_ARITHMETIC_OVERFLOW ((HRESULT)0x80070216L) +#endif + +// +// UINT addition +// +inline HRESULT Safe_UIntAdd(UINT uAugend, UINT uAddend, UINT* puResult) +{ + if ((uAugend + uAddend) >= uAugend) + { + *puResult = (uAugend + uAddend); + return S_OK; + } + *puResult = UINT_MAX; + return E_FAIL; +} + +// +// UINT multiplication +// +inline HRESULT Safe_UIntMult(UINT uMultiplicand, UINT uMultiplier, UINT* puResult) +{ + ULONGLONG ull64Result = (ULONGLONG)uMultiplicand * (ULONGLONG)uMultiplier; + + if (ull64Result <= UINT_MAX) + { + *puResult = (UINT)ull64Result; + return S_OK; + } + *puResult = UINT_MAX; + return E_FAIL; +} + +const LPCSTR D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::s_FormatNames[] = // separate from above structure so it can be compiled out of the runtime. +{ +// Name + "UNKNOWN", + "R32G32B32A32_TYPELESS", + "R32G32B32A32_FLOAT", + "R32G32B32A32_UINT", + "R32G32B32A32_SINT", + "R32G32B32_TYPELESS", + "R32G32B32_FLOAT", + "R32G32B32_UINT", + "R32G32B32_SINT", + "R16G16B16A16_TYPELESS", + "R16G16B16A16_FLOAT", + "R16G16B16A16_UNORM", + "R16G16B16A16_UINT", + "R16G16B16A16_SNORM", + "R16G16B16A16_SINT", + "R32G32_TYPELESS", + "R32G32_FLOAT", + "R32G32_UINT", + "R32G32_SINT", + "R32G8X24_TYPELESS", + "D32_FLOAT_S8X24_UINT", + "R32_FLOAT_X8X24_TYPELESS", + "X32_TYPELESS_G8X24_UINT", + "R10G10B10A2_TYPELESS", + "R10G10B10A2_UNORM", + "R10G10B10A2_UINT", + "R11G11B10_FLOAT", + "R8G8B8A8_TYPELESS", + "R8G8B8A8_UNORM", + "R8G8B8A8_UNORM_SRGB", + "R8G8B8A8_UINT", + "R8G8B8A8_SNORM", + "R8G8B8A8_SINT", + "R16G16_TYPELESS", + "R16G16_FLOAT", + "R16G16_UNORM", + "R16G16_UINT", + "R16G16_SNORM", + "R16G16_SINT", + "R32_TYPELESS", + "D32_FLOAT", + "R32_FLOAT", + "R32_UINT", + "R32_SINT", + "R24G8_TYPELESS", + "D24_UNORM_S8_UINT", + "R24_UNORM_X8_TYPELESS", + "X24_TYPELESS_G8_UINT", + "R8G8_TYPELESS", + "R8G8_UNORM", + "R8G8_UINT", + "R8G8_SNORM", + "R8G8_SINT", + "R16_TYPELESS", + "R16_FLOAT", + "D16_UNORM", + "R16_UNORM", + "R16_UINT", + "R16_SNORM", + "R16_SINT", + "R8_TYPELESS", + "R8_UNORM", + "R8_UINT", + "R8_SNORM", + "R8_SINT", + "A8_UNORM", + "R1_UNORM", + "R9G9B9E5_SHAREDEXP", + "R8G8_B8G8_UNORM", + "G8R8_G8B8_UNORM", + "BC1_TYPELESS", + "BC1_UNORM", + "BC1_UNORM_SRGB", + "BC2_TYPELESS", + "BC2_UNORM", + "BC2_UNORM_SRGB", + "BC3_TYPELESS", + "BC3_UNORM", + "BC3_UNORM_SRGB", + "BC4_TYPELESS", + "BC4_UNORM", + "BC4_SNORM", + "BC5_TYPELESS", + "BC5_UNORM", + "BC5_SNORM", + "B5G6R5_UNORM", + "B5G5R5A1_UNORM", + "B8G8R8A8_UNORM", + "B8G8R8X8_UNORM", + "R10G10B10_XR_BIAS_A2_UNORM", + "B8G8R8A8_TYPELESS", + "B8G8R8A8_UNORM_SRGB", + "B8G8R8X8_TYPELESS", + "B8G8R8X8_UNORM_SRGB", + "BC6H_TYPELESS", + "BC6H_UF16", + "BC6H_SF16", + "BC7_TYPELESS", + "BC7_UNORM", + "BC7_UNORM_SRGB", + "AYUV", + "Y410", + "Y416", + "NV12", + "P010", + "P016", + "420_OPAQUE", + "YUY2", + "Y210", + "Y216", + "NV11", + "AI44", + "IA44", + "P8", + "A8P8", +}; + +// -------------------------------------------------------------------------------------------------------------------------------- +// Format Cast Sets +// -------------------------------------------------------------------------------------------------------------------------------- +constexpr DXGI_FORMAT D3DFCS_UNKNOWN[] = +{ + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R32G32B32A32[] = +{ + DXGI_FORMAT_R32G32B32A32_TYPELESS, + DXGI_FORMAT_R32G32B32A32_FLOAT, + DXGI_FORMAT_R32G32B32A32_UINT, + DXGI_FORMAT_R32G32B32A32_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R32G32B32[] = +{ + DXGI_FORMAT_R32G32B32_TYPELESS, + DXGI_FORMAT_R32G32B32_FLOAT, + DXGI_FORMAT_R32G32B32_UINT, + DXGI_FORMAT_R32G32B32_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R16G16B16A16[] = +{ + DXGI_FORMAT_R16G16B16A16_TYPELESS, + DXGI_FORMAT_R16G16B16A16_FLOAT, + DXGI_FORMAT_R16G16B16A16_UNORM, + DXGI_FORMAT_R16G16B16A16_UINT, + DXGI_FORMAT_R16G16B16A16_SNORM, + DXGI_FORMAT_R16G16B16A16_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R32G32[] = +{ + DXGI_FORMAT_R32G32_TYPELESS, + DXGI_FORMAT_R32G32_FLOAT, + DXGI_FORMAT_R32G32_UINT, + DXGI_FORMAT_R32G32_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R32G8X24[] = +{ + DXGI_FORMAT_R32G8X24_TYPELESS, + DXGI_FORMAT_D32_FLOAT_S8X24_UINT, + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R11G11B10[] = +{ + DXGI_FORMAT_R11G11B10_FLOAT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R8G8B8A8[] = +{ + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UINT, + DXGI_FORMAT_R8G8B8A8_SNORM, + DXGI_FORMAT_R8G8B8A8_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R16G16[] = +{ + DXGI_FORMAT_R16G16_TYPELESS, + DXGI_FORMAT_R16G16_FLOAT, + DXGI_FORMAT_R16G16_UNORM, + DXGI_FORMAT_R16G16_UINT, + DXGI_FORMAT_R16G16_SNORM, + DXGI_FORMAT_R16G16_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R32[] = +{ + DXGI_FORMAT_R32_TYPELESS, + DXGI_FORMAT_D32_FLOAT, + DXGI_FORMAT_R32_FLOAT, + DXGI_FORMAT_R32_UINT, + DXGI_FORMAT_R32_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R24G8[] = +{ + DXGI_FORMAT_R24G8_TYPELESS, + DXGI_FORMAT_D24_UNORM_S8_UINT, + DXGI_FORMAT_R24_UNORM_X8_TYPELESS, + DXGI_FORMAT_X24_TYPELESS_G8_UINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R8G8[] = +{ + DXGI_FORMAT_R8G8_TYPELESS, + DXGI_FORMAT_R8G8_UNORM, + DXGI_FORMAT_R8G8_UINT, + DXGI_FORMAT_R8G8_SNORM, + DXGI_FORMAT_R8G8_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R16[] = +{ + DXGI_FORMAT_R16_TYPELESS, + DXGI_FORMAT_R16_FLOAT, + DXGI_FORMAT_D16_UNORM, + DXGI_FORMAT_R16_UNORM, + DXGI_FORMAT_R16_UINT, + DXGI_FORMAT_R16_SNORM, + DXGI_FORMAT_R16_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R8[] = +{ + DXGI_FORMAT_R8_TYPELESS, + DXGI_FORMAT_R8_UNORM, + DXGI_FORMAT_R8_UINT, + DXGI_FORMAT_R8_SNORM, + DXGI_FORMAT_R8_SINT, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_A8[] = +{ + DXGI_FORMAT_A8_UNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R1[] = +{ + DXGI_FORMAT_R1_UNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R9G9B9E5[] = +{ + DXGI_FORMAT_R9G9B9E5_SHAREDEXP, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R8G8_B8G8[] = +{ + DXGI_FORMAT_R8G8_B8G8_UNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_G8R8_G8B8[] = +{ + DXGI_FORMAT_G8R8_G8B8_UNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_BC1[] = +{ + DXGI_FORMAT_BC1_TYPELESS, + DXGI_FORMAT_BC1_UNORM, + DXGI_FORMAT_BC1_UNORM_SRGB, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_BC2[] = +{ + DXGI_FORMAT_BC2_TYPELESS, + DXGI_FORMAT_BC2_UNORM, + DXGI_FORMAT_BC2_UNORM_SRGB, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_BC3[] = +{ + DXGI_FORMAT_BC3_TYPELESS, + DXGI_FORMAT_BC3_UNORM, + DXGI_FORMAT_BC3_UNORM_SRGB, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_BC4[] = +{ + DXGI_FORMAT_BC4_TYPELESS, + DXGI_FORMAT_BC4_UNORM, + DXGI_FORMAT_BC4_SNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_BC5[] = +{ + DXGI_FORMAT_BC5_TYPELESS, + DXGI_FORMAT_BC5_UNORM, + DXGI_FORMAT_BC5_SNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_B5G6R5[] = +{ + DXGI_FORMAT_B5G6R5_UNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_B5G5R5A1[] = +{ + DXGI_FORMAT_B5G5R5A1_UNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_B8G8R8A8[] = +{ + DXGI_FORMAT_B8G8R8A8_TYPELESS, + DXGI_FORMAT_B8G8R8A8_UNORM, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_B8G8R8X8[] = +{ + DXGI_FORMAT_B8G8R8X8_TYPELESS, + DXGI_FORMAT_B8G8R8X8_UNORM, + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_R10G10B10A2[] = +{ + DXGI_FORMAT_R10G10B10A2_TYPELESS, + DXGI_FORMAT_R10G10B10A2_UNORM, + DXGI_FORMAT_R10G10B10A2_UINT, + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_BC6H[] = +{ + DXGI_FORMAT_BC6H_TYPELESS, + DXGI_FORMAT_BC6H_UF16, + DXGI_FORMAT_BC6H_SF16, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_BC7[] = +{ + DXGI_FORMAT_BC7_TYPELESS, + DXGI_FORMAT_BC7_UNORM, + DXGI_FORMAT_BC7_UNORM_SRGB, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_AYUV[] = +{ + DXGI_FORMAT_AYUV, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_NV12[] = +{ + DXGI_FORMAT_NV12, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_YUY2[] = +{ + DXGI_FORMAT_YUY2, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_P010[] = +{ + DXGI_FORMAT_P010, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_P016[] = +{ + DXGI_FORMAT_P016, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_NV11[] = +{ + DXGI_FORMAT_NV11, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_420_OPAQUE[] = +{ + DXGI_FORMAT_420_OPAQUE, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_Y410[] = +{ + DXGI_FORMAT_Y410, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_Y416[] = +{ + DXGI_FORMAT_Y416, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_Y210[] = +{ + DXGI_FORMAT_Y210, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_Y216[] = +{ + DXGI_FORMAT_Y216, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_AI44[] = +{ + DXGI_FORMAT_AI44, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_IA44[] = +{ + DXGI_FORMAT_IA44, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_P8[] = +{ + DXGI_FORMAT_P8, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_A8P8[] = +{ + DXGI_FORMAT_A8P8, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_B4G4R4A4[] = +{ + DXGI_FORMAT_B4G4R4A4_UNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_P208[] = +{ + DXGI_FORMAT_P208, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_V208[] = +{ + DXGI_FORMAT_V208, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_V408[] = +{ + DXGI_FORMAT_V408, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr DXGI_FORMAT D3DFCS_A4B4G4R4[] = +{ + DXGI_FORMAT_A4B4G4R4_UNORM, + DXGI_FORMAT_UNKNOWN // not part of cast set, just the "null terminator" +}; + +constexpr D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FORMAT_DETAIL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::s_FormatDetail[] = +{ + // DXGI_FORMAT ParentFormat pDefaultFormatCastSet BitsPerComponent[4], BitsPerUnit, SRGB, WidthAlignment, HeightAlignment, DepthAlignment, Layout, TypeLevel, ComponentName[4],ComponentInterpretation[4], bDX9VertexOrIndexFormat bDX9TextureFormat, bFloatNormFormat, bPlanar, bYUV bDependantFormatCastSet bInternal + {DXGI_FORMAT_UNKNOWN ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R32G32B32A32_TYPELESS ,DXGI_FORMAT_R32G32B32A32_TYPELESS, D3DFCS_R32G32B32A32, {32,32,32,32}, 128, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,B,A, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32G32B32A32_FLOAT ,DXGI_FORMAT_R32G32B32A32_TYPELESS, D3DFCS_R32G32B32A32, {32,32,32,32}, 128, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _FLOAT, _FLOAT, _FLOAT, _FLOAT, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32G32B32A32_UINT ,DXGI_FORMAT_R32G32B32A32_TYPELESS, D3DFCS_R32G32B32A32, {32,32,32,32}, 128, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _UINT, _UINT, _UINT, _UINT, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32G32B32A32_SINT ,DXGI_FORMAT_R32G32B32A32_TYPELESS, D3DFCS_R32G32B32A32, {32,32,32,32}, 128, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _SINT, _SINT, _SINT, _SINT, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R32G32B32_TYPELESS ,DXGI_FORMAT_R32G32B32_TYPELESS, D3DFCS_R32G32B32, {32,32,32,0}, 96, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,B,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32G32B32_FLOAT ,DXGI_FORMAT_R32G32B32_TYPELESS, D3DFCS_R32G32B32, {32,32,32,0}, 96, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,X, _FLOAT, _FLOAT, _FLOAT, _TYPELESS, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32G32B32_UINT ,DXGI_FORMAT_R32G32B32_TYPELESS, D3DFCS_R32G32B32, {32,32,32,0}, 96, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,X, _UINT, _UINT, _UINT, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32G32B32_SINT ,DXGI_FORMAT_R32G32B32_TYPELESS, D3DFCS_R32G32B32, {32,32,32,0}, 96, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,X, _SINT, _SINT, _SINT, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R16G16B16A16_TYPELESS ,DXGI_FORMAT_R16G16B16A16_TYPELESS, D3DFCS_R16G16B16A16, {16,16,16,16}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,B,A, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16B16A16_FLOAT ,DXGI_FORMAT_R16G16B16A16_TYPELESS, D3DFCS_R16G16B16A16, {16,16,16,16}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _FLOAT, _FLOAT, _FLOAT, _FLOAT, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16B16A16_UNORM ,DXGI_FORMAT_R16G16B16A16_TYPELESS, D3DFCS_R16G16B16A16, {16,16,16,16}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM, _UNORM, _UNORM, _UNORM, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16B16A16_UINT ,DXGI_FORMAT_R16G16B16A16_TYPELESS, D3DFCS_R16G16B16A16, {16,16,16,16}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _UINT, _UINT, _UINT, _UINT, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16B16A16_SNORM ,DXGI_FORMAT_R16G16B16A16_TYPELESS, D3DFCS_R16G16B16A16, {16,16,16,16}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _SNORM, _SNORM, _SNORM, _SNORM, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16B16A16_SINT ,DXGI_FORMAT_R16G16B16A16_TYPELESS, D3DFCS_R16G16B16A16, {16,16,16,16}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _SINT, _SINT, _SINT, _SINT, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R32G32_TYPELESS ,DXGI_FORMAT_R32G32_TYPELESS, D3DFCS_R32G32, {32,32,0,0}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32G32_FLOAT ,DXGI_FORMAT_R32G32_TYPELESS, D3DFCS_R32G32, {32,32,0,0}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _FLOAT, _FLOAT, _TYPELESS, _TYPELESS, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32G32_UINT ,DXGI_FORMAT_R32G32_TYPELESS, D3DFCS_R32G32, {32,32,0,0}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _UINT, _UINT, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32G32_SINT ,DXGI_FORMAT_R32G32_TYPELESS, D3DFCS_R32G32, {32,32,0,0}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _SINT, _SINT, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R32G8X24_TYPELESS ,DXGI_FORMAT_R32G8X24_TYPELESS, D3DFCS_R32G8X24, {32,8,24,0}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_D32_FLOAT_S8X24_UINT ,DXGI_FORMAT_R32G8X24_TYPELESS, D3DFCS_R32G8X24, {32,8,24,0}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, D,S,X,X, _FLOAT,_UINT,_TYPELESS,_TYPELESS, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS ,DXGI_FORMAT_R32G8X24_TYPELESS, D3DFCS_R32G8X24, {32,8,24,0}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _FLOAT,_TYPELESS,_TYPELESS,_TYPELESS, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_X32_TYPELESS_G8X24_UINT ,DXGI_FORMAT_R32G8X24_TYPELESS, D3DFCS_R32G8X24, {32,8,24,0}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, X,G,X,X, _TYPELESS,_UINT,_TYPELESS,_TYPELESS, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R10G10B10A2_TYPELESS ,DXGI_FORMAT_R10G10B10A2_TYPELESS, D3DFCS_R10G10B10A2, {10,10,10,2}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,B,A, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, }, + { DXGI_FORMAT_R10G10B10A2_UNORM ,DXGI_FORMAT_R10G10B10A2_TYPELESS, D3DFCS_R10G10B10A2, {10,10,10,2}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, }, + { DXGI_FORMAT_R10G10B10A2_UINT ,DXGI_FORMAT_R10G10B10A2_TYPELESS, D3DFCS_R10G10B10A2, {10,10,10,2}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _UINT, _UINT, _UINT, _UINT, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, }, + {DXGI_FORMAT_R11G11B10_FLOAT ,DXGI_FORMAT_R11G11B10_FLOAT, D3DFCS_R11G11B10, {11,11,10,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,X, _FLOAT, _FLOAT, _FLOAT, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R8G8B8A8_TYPELESS ,DXGI_FORMAT_R8G8B8A8_TYPELESS, D3DFCS_R8G8B8A8, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,B,A, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8G8B8A8_UNORM ,DXGI_FORMAT_R8G8B8A8_TYPELESS, D3DFCS_R8G8B8A8, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM, _UNORM, _UNORM, _UNORM, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8G8B8A8_UNORM_SRGB ,DXGI_FORMAT_R8G8B8A8_TYPELESS, D3DFCS_R8G8B8A8, {8,8,8,8}, 32, TRUE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM_SRGB, _UNORM_SRGB, _UNORM_SRGB, _UNORM_SRGB, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8G8B8A8_UINT ,DXGI_FORMAT_R8G8B8A8_TYPELESS, D3DFCS_R8G8B8A8, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _UINT, _UINT, _UINT, _UINT, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8G8B8A8_SNORM ,DXGI_FORMAT_R8G8B8A8_TYPELESS, D3DFCS_R8G8B8A8, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _SNORM, _SNORM, _SNORM, _SNORM, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8G8B8A8_SINT ,DXGI_FORMAT_R8G8B8A8_TYPELESS, D3DFCS_R8G8B8A8, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _SINT, _SINT, _SINT, _SINT, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R16G16_TYPELESS ,DXGI_FORMAT_R16G16_TYPELESS, D3DFCS_R16G16, {16,16,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16_FLOAT ,DXGI_FORMAT_R16G16_TYPELESS, D3DFCS_R16G16, {16,16,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _FLOAT, _FLOAT, _TYPELESS, _TYPELESS, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16_UNORM ,DXGI_FORMAT_R16G16_TYPELESS, D3DFCS_R16G16, {16,16,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _UNORM, _UNORM, _TYPELESS, _TYPELESS, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16_UINT ,DXGI_FORMAT_R16G16_TYPELESS, D3DFCS_R16G16, {16,16,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _UINT, _UINT, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16_SNORM ,DXGI_FORMAT_R16G16_TYPELESS, D3DFCS_R16G16, {16,16,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _SNORM, _SNORM, _TYPELESS, _TYPELESS, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16G16_SINT ,DXGI_FORMAT_R16G16_TYPELESS, D3DFCS_R16G16, {16,16,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _SINT, _SINT, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R32_TYPELESS ,DXGI_FORMAT_R32_TYPELESS, D3DFCS_R32, {32,0,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_D32_FLOAT ,DXGI_FORMAT_R32_TYPELESS, D3DFCS_R32, {32,0,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, D,X,X,X, _FLOAT, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32_FLOAT ,DXGI_FORMAT_R32_TYPELESS, D3DFCS_R32, {32,0,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _FLOAT, _TYPELESS, _TYPELESS, _TYPELESS, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32_UINT ,DXGI_FORMAT_R32_TYPELESS, D3DFCS_R32, {32,0,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _UINT, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R32_SINT ,DXGI_FORMAT_R32_TYPELESS, D3DFCS_R32, {32,0,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _SINT, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R24G8_TYPELESS ,DXGI_FORMAT_R24G8_TYPELESS, D3DFCS_R24G8, {24,8,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_D24_UNORM_S8_UINT ,DXGI_FORMAT_R24G8_TYPELESS, D3DFCS_R24G8, {24,8,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, D,S,X,X, _UNORM,_UINT,_TYPELESS,_TYPELESS, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R24_UNORM_X8_TYPELESS ,DXGI_FORMAT_R24G8_TYPELESS, D3DFCS_R24G8, {24,8,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM,_TYPELESS,_TYPELESS,_TYPELESS, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_X24_TYPELESS_G8_UINT ,DXGI_FORMAT_R24G8_TYPELESS, D3DFCS_R24G8, {24,8,0,0}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, X,G,X,X, _TYPELESS,_UINT,_TYPELESS,_TYPELESS, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R8G8_TYPELESS ,DXGI_FORMAT_R8G8_TYPELESS, D3DFCS_R8G8, {8,8,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,G,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8G8_UNORM ,DXGI_FORMAT_R8G8_TYPELESS, D3DFCS_R8G8, {8,8,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _UNORM, _UNORM, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8G8_UINT ,DXGI_FORMAT_R8G8_TYPELESS, D3DFCS_R8G8, {8,8,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _UINT, _UINT, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8G8_SNORM ,DXGI_FORMAT_R8G8_TYPELESS, D3DFCS_R8G8, {8,8,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _SNORM, _SNORM, _TYPELESS, _TYPELESS, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8G8_SINT ,DXGI_FORMAT_R8G8_TYPELESS, D3DFCS_R8G8, {8,8,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,X,X, _SINT, _SINT, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R16_TYPELESS ,DXGI_FORMAT_R16_TYPELESS, D3DFCS_R16, {16,0,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16_FLOAT ,DXGI_FORMAT_R16_TYPELESS, D3DFCS_R16, {16,0,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _FLOAT, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_D16_UNORM ,DXGI_FORMAT_R16_TYPELESS, D3DFCS_R16, {16,0,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, D,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16_UNORM ,DXGI_FORMAT_R16_TYPELESS, D3DFCS_R16, {16,0,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16_UINT ,DXGI_FORMAT_R16_TYPELESS, D3DFCS_R16, {16,0,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _UINT, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16_SNORM ,DXGI_FORMAT_R16_TYPELESS, D3DFCS_R16, {16,0,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _SNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R16_SINT ,DXGI_FORMAT_R16_TYPELESS, D3DFCS_R16, {16,0,0,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _SINT, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R8_TYPELESS ,DXGI_FORMAT_R8_TYPELESS, D3DFCS_R8, {8,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, R,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8_UNORM ,DXGI_FORMAT_R8_TYPELESS, D3DFCS_R8, {8,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8_UINT ,DXGI_FORMAT_R8_TYPELESS, D3DFCS_R8, {8,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _UINT, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8_SNORM ,DXGI_FORMAT_R8_TYPELESS, D3DFCS_R8, {8,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _SNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_R8_SINT ,DXGI_FORMAT_R8_TYPELESS, D3DFCS_R8, {8,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _SINT, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_A8_UNORM ,DXGI_FORMAT_A8_UNORM, D3DFCS_A8, {0,0,0,8}, 8, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, X,X,X,A, _TYPELESS, _TYPELESS, _TYPELESS, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R1_UNORM ,DXGI_FORMAT_R1_UNORM, D3DFCS_R1, {1,0,0,0}, 1, FALSE, 8, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R9G9B9E5_SHAREDEXP ,DXGI_FORMAT_R9G9B9E5_SHAREDEXP, D3DFCS_R9G9B9E5, {0,0,0,0}, 32, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,X, _FLOAT, _FLOAT, _FLOAT, _FLOAT, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R8G8_B8G8_UNORM ,DXGI_FORMAT_R8G8_B8G8_UNORM, D3DFCS_R8G8_B8G8, {0,0,0,0}, 16, FALSE, 2, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,X, _UNORM, _UNORM, _UNORM, _TYPELESS, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_G8R8_G8B8_UNORM ,DXGI_FORMAT_G8R8_G8B8_UNORM, D3DFCS_G8R8_G8B8, {0,0,0,0}, 16, FALSE, 2, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,X, _UNORM, _UNORM, _UNORM, _TYPELESS, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_BC1_TYPELESS ,DXGI_FORMAT_BC1_TYPELESS, D3DFCS_BC1, {0,0,0,0}, 64, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_PARTIAL_TYPE, R,G,B,A, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC1_UNORM ,DXGI_FORMAT_BC1_TYPELESS, D3DFCS_BC1, {0,0,0,0}, 64, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC1_UNORM_SRGB ,DXGI_FORMAT_BC1_TYPELESS, D3DFCS_BC1, {0,0,0,0}, 64, TRUE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM_SRGB, _UNORM_SRGB, _UNORM_SRGB, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_BC2_TYPELESS ,DXGI_FORMAT_BC2_TYPELESS, D3DFCS_BC2, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_PARTIAL_TYPE, R,G,B,A, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC2_UNORM ,DXGI_FORMAT_BC2_TYPELESS, D3DFCS_BC2, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC2_UNORM_SRGB ,DXGI_FORMAT_BC2_TYPELESS, D3DFCS_BC2, {0,0,0,0}, 128, TRUE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM_SRGB, _UNORM_SRGB, _UNORM_SRGB, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_BC3_TYPELESS ,DXGI_FORMAT_BC3_TYPELESS, D3DFCS_BC3, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_PARTIAL_TYPE, R,G,B,A, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC3_UNORM ,DXGI_FORMAT_BC3_TYPELESS, D3DFCS_BC3, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC3_UNORM_SRGB ,DXGI_FORMAT_BC3_TYPELESS, D3DFCS_BC3, {0,0,0,0}, 128, TRUE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM_SRGB, _UNORM_SRGB, _UNORM_SRGB, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_BC4_TYPELESS ,DXGI_FORMAT_BC4_TYPELESS, D3DFCS_BC4, {0,0,0,0}, 64, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_PARTIAL_TYPE, R,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC4_UNORM ,DXGI_FORMAT_BC4_TYPELESS, D3DFCS_BC4, {0,0,0,0}, 64, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC4_SNORM ,DXGI_FORMAT_BC4_TYPELESS, D3DFCS_BC4, {0,0,0,0}, 64, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _SNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_BC5_TYPELESS ,DXGI_FORMAT_BC5_TYPELESS, D3DFCS_BC5, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_PARTIAL_TYPE, R,G,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC5_UNORM ,DXGI_FORMAT_BC5_TYPELESS, D3DFCS_BC5, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,X,X, _UNORM, _UNORM, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC5_SNORM ,DXGI_FORMAT_BC5_TYPELESS, D3DFCS_BC5, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,X,X, _SNORM, _SNORM, _TYPELESS, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_B5G6R5_UNORM ,DXGI_FORMAT_B5G6R5_UNORM, D3DFCS_B5G6R5, {5,6,5,0}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,X, _UNORM, _UNORM, _UNORM, _TYPELESS, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_B5G5R5A1_UNORM ,DXGI_FORMAT_B5G5R5A1_UNORM, D3DFCS_B5G5R5A1, {5,5,5,1}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_B8G8R8A8_UNORM ,DXGI_FORMAT_B8G8R8A8_TYPELESS, D3DFCS_B8G8R8A8, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_B8G8R8X8_UNORM ,DXGI_FORMAT_B8G8R8X8_TYPELESS, D3DFCS_B8G8R8X8, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,X, _UNORM, _UNORM, _UNORM, _TYPELESS, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM ,DXGI_FORMAT_R10G10B10A2_TYPELESS, D3DFCS_R10G10B10A2, {10,10,10,2}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, R,G,B,A, _FIXED_2_8, _FIXED_2_8, _FIXED_2_8, _UNORM, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_B8G8R8A8_TYPELESS ,DXGI_FORMAT_B8G8R8A8_TYPELESS, D3DFCS_B8G8R8A8, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, B,G,R,A, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_B8G8R8A8_UNORM_SRGB ,DXGI_FORMAT_B8G8R8A8_TYPELESS, D3DFCS_B8G8R8A8, {8,8,8,8}, 32, TRUE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,A, _UNORM_SRGB, _UNORM_SRGB, _UNORM_SRGB, _UNORM_SRGB, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_B8G8R8X8_TYPELESS ,DXGI_FORMAT_B8G8R8X8_TYPELESS, D3DFCS_B8G8R8X8, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_PARTIAL_TYPE, B,G,R,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_B8G8R8X8_UNORM_SRGB ,DXGI_FORMAT_B8G8R8X8_TYPELESS, D3DFCS_B8G8R8X8, {8,8,8,8}, 32, TRUE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,X, _UNORM_SRGB, _UNORM_SRGB, _UNORM_SRGB, _TYPELESS, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_BC6H_TYPELESS ,DXGI_FORMAT_BC6H_TYPELESS, D3DFCS_BC6H, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_PARTIAL_TYPE, R,G,B,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC6H_UF16 ,DXGI_FORMAT_BC6H_TYPELESS, D3DFCS_BC6H, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,X, _FLOAT, _FLOAT, _FLOAT, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC6H_SF16 ,DXGI_FORMAT_BC6H_TYPELESS, D3DFCS_BC6H, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,X, _FLOAT, _FLOAT, _FLOAT, _TYPELESS, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + {DXGI_FORMAT_BC7_TYPELESS ,DXGI_FORMAT_BC7_TYPELESS, D3DFCS_BC7, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_PARTIAL_TYPE, R,G,B,A, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC7_UNORM ,DXGI_FORMAT_BC7_TYPELESS, D3DFCS_BC7, {0,0,0,0}, 128, FALSE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_BC7_UNORM_SRGB ,DXGI_FORMAT_BC7_TYPELESS, D3DFCS_BC7, {0,0,0,0}, 128, TRUE, 4, 4, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,A, _UNORM_SRGB, _UNORM_SRGB, _UNORM_SRGB, _UNORM, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + // YUV 4:4:4 formats + { DXGI_FORMAT_AYUV ,DXGI_FORMAT_AYUV, D3DFCS_AYUV, {8,8,8,8}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_Y410 ,DXGI_FORMAT_Y410, D3DFCS_Y410, {10,10,10,2}, 32, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_Y416 ,DXGI_FORMAT_Y416, D3DFCS_Y416, {16,16,16,16}, 64, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + // YUV 4:2:0 formats + { DXGI_FORMAT_NV12 ,DXGI_FORMAT_NV12, D3DFCS_NV12, {0,0,0,0}, 8, FALSE, 2, 2, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_P010 ,DXGI_FORMAT_P010, D3DFCS_P010, {0,0,0,0}, 16, FALSE, 2, 2, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_P016 ,DXGI_FORMAT_P016, D3DFCS_P016, {0,0,0,0}, 16, FALSE, 2, 2, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_420_OPAQUE ,DXGI_FORMAT_420_OPAQUE, D3DFCS_420_OPAQUE, {0,0,0,0}, 8, FALSE, 2, 2, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, }, + // YUV 4:2:2 formats + { DXGI_FORMAT_YUY2 ,DXGI_FORMAT_YUY2, D3DFCS_YUY2, {0,0,0,0}, 16, FALSE, 2, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,X, _UNORM, _UNORM, _UNORM, _TYPELESS, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_Y210 ,DXGI_FORMAT_Y210, D3DFCS_Y210, {0,0,0,0}, 32, FALSE, 2, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,X, _UNORM, _UNORM, _UNORM, _TYPELESS, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_Y216 ,DXGI_FORMAT_Y216, D3DFCS_Y216, {0,0,0,0}, 32, FALSE, 2, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,G,B,X, _UNORM, _UNORM, _UNORM, _TYPELESS, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + // YUV 4:1:1 formats + { DXGI_FORMAT_NV11 ,DXGI_FORMAT_NV11, D3DFCS_NV11, {0,0,0,0}, 8, FALSE, 4, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, }, + // Legacy substream formats + { DXGI_FORMAT_AI44 ,DXGI_FORMAT_AI44, D3DFCS_AI44, {0,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_IA44 ,DXGI_FORMAT_IA44, D3DFCS_IA44, {0,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_P8 ,DXGI_FORMAT_P8, D3DFCS_P8, {0,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_A8P8 ,DXGI_FORMAT_A8P8, D3DFCS_A8P8, {0,0,0,0}, 16, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT_B4G4R4A4_UNORM ,DXGI_FORMAT_B4G4R4A4_UNORM, D3DFCS_B4G4R4A4, {4,4,4,4}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, B,G,R,A, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT(116) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(117) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(118) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(119) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(120) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(121) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(122) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + + { DXGI_FORMAT(123) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + + { DXGI_FORMAT(124) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(125) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(126) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(127) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(128) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(129) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(DXGI_FORMAT_P208) ,DXGI_FORMAT_P208, D3DFCS_P208, {0,0,0,0}, 8, FALSE, 2, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT(DXGI_FORMAT_V208) ,DXGI_FORMAT_V208, D3DFCS_V208, {0,0,0,0}, 8, FALSE, 1, 2, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, }, + { DXGI_FORMAT(DXGI_FORMAT_V408) ,DXGI_FORMAT_V408, D3DFCS_V408, {0,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, }, + + { DXGI_FORMAT(133) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(134) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(135) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(136) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(137) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(138) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(139) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(140) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(141) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(142) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(143) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(144) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(145) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(146) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(147) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(148) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(149) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(150) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(151) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(152) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(153) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(154) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(155) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(156) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(157) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(158) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(159) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(160) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(161) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(162) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(163) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(164) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(165) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(166) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(167) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(168) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(169) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(170) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(171) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(172) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(173) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(174) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(175) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(176) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(177) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(178) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(179) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(180) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(181) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(182) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(183) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(184) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(185) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(186) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(187) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + { DXGI_FORMAT(188) ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 0, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_NO_TYPE, X,X,X,X, _TYPELESS, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, }, + + { DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE ,DXGI_FORMAT_UNKNOWN, D3DFCS_UNKNOWN, {0,0,0,0}, 8, FALSE, 1, 1, 1, D3DFL_CUSTOM, D3DFTL_FULL_TYPE, R,X,X,X, _UNORM, _TYPELESS, _TYPELESS, _TYPELESS, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + { DXGI_FORMAT_A4B4G4R4_UNORM ,DXGI_FORMAT_A4B4G4R4_UNORM, D3DFCS_A4B4G4R4, {4,4,4,4}, 16, FALSE, 1, 1, 1, D3DFL_STANDARD, D3DFTL_FULL_TYPE, A,B,G,R, _UNORM, _UNORM, _UNORM, _UNORM, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, }, + //DXGI_FORMAT ParentFormat pDefaultFormatCastSet BitsPerComponent[4], BitsPerUnit, SRGB, WidthAlignment, HeightAlignment, DepthAlignment, Layout, TypeLevel, ComponentName[4],ComponentInterpretation[4], bDX9VertexOrIndexFormat bDX9TextureFormat, bFloatNormFormat, bPlanar, bYUV bDependantFormatCastSet bInternal + +}; + +const UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::s_NumFormats = (sizeof(D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::s_FormatDetail) / sizeof(D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FORMAT_DETAIL)); + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetHighestDefinedFeatureLevel +D3D_FEATURE_LEVEL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetHighestDefinedFeatureLevel() +{ + return D3D_FEATURE_LEVEL_12_2; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetNumFormats +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetNumFormats() +{ + return s_NumFormats; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetFormatTable +const D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FORMAT_DETAIL* D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetFormatTable() +{ + return &s_FormatDetail[0]; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetFormatTable +BOOL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::Opaque(DXGI_FORMAT Format) +{ + return Format == DXGI_FORMAT_420_OPAQUE; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// FormatExists +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FormatExists(DXGI_FORMAT Format) +{ + return GetFormat( Format) != (DXGI_FORMAT) -1 ? true : false; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetDetailTableIndex +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetDetailTableIndex(DXGI_FORMAT Format ) +{ + if( (UINT)Format < _countof( s_FormatDetail ) ) + { + assert( s_FormatDetail[(UINT)Format].DXGIFormat == Format ); + return static_cast(Format); + } + + return (UINT)-1; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// IsBlockCompressFormat - returns true if format is block compressed. This function is a helper function for GetBitsPerUnit and +// if this function returns true then GetBitsPerUnit returns block size. +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::IsBlockCompressFormat(DXGI_FORMAT Format) +{ + // Returns true if BC1, BC2, BC3, BC4, BC5, BC6, BC7, or ASTC + return (Format >= DXGI_FORMAT_BC1_TYPELESS && Format <= DXGI_FORMAT_BC5_SNORM) || + (Format >= DXGI_FORMAT_BC6H_TYPELESS && Format <= DXGI_FORMAT_BC7_UNORM_SRGB); +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetByteAlignment +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetByteAlignment(DXGI_FORMAT Format) +{ + UINT bits = GetBitsPerUnit(Format); + if (!IsBlockCompressFormat(Format)) + { + bits *= GetWidthAlignment(Format)*GetHeightAlignment(Format)*GetDepthAlignment(Format); + } + + assert((bits & 0x7) == 0); // Unit must be byte-aligned + return bits >> 3; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetBitsPerUnitThrow +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetBitsPerUnitThrow(DXGI_FORMAT Format) +{ + return s_FormatDetail[GetDetailTableIndexThrow( Format )].BitsPerUnit; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// FormatExistsInHeader +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FormatExistsInHeader(DXGI_FORMAT Format, bool bExternalHeader) +{ + const UINT Index = GetDetailTableIndex( Format ); + if (UINT( -1 ) == Index || (bExternalHeader && GetFormatDetail( Format )->bInternal)) + { + return false; + } + else + { + return true; + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetName +LPCSTR D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetName(DXGI_FORMAT Format, bool bHideInternalFormats) +{ + const UINT Index = GetDetailTableIndex( Format ); + if (UINT( -1 ) == Index || (bHideInternalFormats && GetFormatDetail( Format )->bInternal)) + { + return "Unrecognized"; + } + else + { + return s_FormatNames[ Index ]; + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// IsSRGBFormat +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::IsSRGBFormat(DXGI_FORMAT Format) +{ + const UINT Index = GetDetailTableIndex(Format); + if(UINT( -1 ) == Index ) + { + return false; + } + + return s_FormatDetail[Index].SRGBFormat ? true : false; +} + +//---------------------------------------------------------------------------- +// DivideAndRoundUp +inline HRESULT DivideAndRoundUp(UINT dividend, UINT divisor, _Out_ UINT& result) +{ + HRESULT hr = S_OK; + + UINT adjustedDividend; + hr = Safe_UIntAdd(dividend, (divisor - 1), &adjustedDividend); + + result = SUCCEEDED(hr) ? (adjustedDividend / divisor) : 0; + + return hr; +} + +//---------------------------------------------------------------------------- +// CalculateExtraPlanarRows +HRESULT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::CalculateExtraPlanarRows( + DXGI_FORMAT format, + UINT plane0Height, + _Out_ UINT& totalHeight + ) +{ + if (!D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::Planar(format)) + { + totalHeight = plane0Height; + return S_OK; + } + + // blockWidth, blockHeight, and blockSize only reflect the size of plane 0. Each planar format has additonal planes that must + // be counted. Each format increases size by another 0.5x, 1x, or 2x. Grab the number of "half allocation" increments so integer + // math can be used to calculate the extra size. + UINT extraHalfHeight; + UINT round; + + switch (D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetParentFormat(format)) + { + case DXGI_FORMAT_NV12: + case DXGI_FORMAT_P010: + case DXGI_FORMAT_P016: + case DXGI_FORMAT_420_OPAQUE: + extraHalfHeight = 1; + round = 1; + break; + + case DXGI_FORMAT_NV11: + case DXGI_FORMAT_P208: + extraHalfHeight = 2; + round = 0; + break; + case DXGI_FORMAT_V208: + extraHalfHeight = 2; + round = 1; + break; + + case DXGI_FORMAT_V408: + extraHalfHeight = 4; + round = 0; + break; + + case DXGI_FORMAT_R24G8_TYPELESS: + case DXGI_FORMAT_R32G8X24_TYPELESS: + totalHeight = plane0Height; + return S_OK; + + default: + assert(false); + return S_OK; + } + + UINT extraPlaneHeight; + if (FAILED(Safe_UIntMult(plane0Height, extraHalfHeight, &extraPlaneHeight)) + || FAILED(Safe_UIntAdd(extraPlaneHeight, round, &extraPlaneHeight)) + || FAILED(Safe_UIntAdd(plane0Height, (extraPlaneHeight >> 1), &totalHeight))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + + return S_OK; +} + +//---------------------------------------------------------------------------- +// CalculateResourceSize +HRESULT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::CalculateResourceSize( + UINT width, + UINT height, + UINT depth, + DXGI_FORMAT format, + UINT mipLevels, + UINT subresources, + _Out_ SIZE_T& totalByteSize, + _Out_writes_opt_(subresources) D3D12_MEMCPY_DEST *pDst) +{ + UINT tableIndex = GetDetailTableIndexNoThrow( format ); + const FORMAT_DETAIL& formatDetail = s_FormatDetail[tableIndex]; + + bool fIsBlockCompressedFormat = IsBlockCompressFormat(format ); + + // No format currently requires depth alignment. + assert(formatDetail.DepthAlignment == 1); + + UINT subWidth = width; + UINT subHeight = height; + UINT subDepth = depth; + for (UINT s = 0, iM = 0; s < subresources; ++s) + { + UINT blockWidth; + if (FAILED(DivideAndRoundUp(subWidth, formatDetail.WidthAlignment, /*_Out_*/ blockWidth))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + + UINT blockSize, blockHeight; + if (fIsBlockCompressedFormat) + { + if (FAILED(DivideAndRoundUp(subHeight, formatDetail.HeightAlignment, /*_Out_*/ blockHeight))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + + // Block Compressed formats use BitsPerUnit as block size. + blockSize = formatDetail.BitsPerUnit; + } + else + { + // The height must *not* be aligned to HeightAlign. As there is no plane pitch/stride, the expectation is that the 2nd plane + // begins immediately after the first. The only formats with HeightAlignment other than 1 are planar or block compressed, and + // block compressed is handled above. + assert(formatDetail.bPlanar || formatDetail.HeightAlignment == 1); + blockHeight = subHeight; + + // Combined with the division os subWidth by the width alignment above, this helps achieve rounding the stride up to an even multiple of + // block width. This is especially important for formats like NV12 and P208 whose chroma plane is wider than the luma. + blockSize = formatDetail.BitsPerUnit * formatDetail.WidthAlignment; + } + + if (DXGI_FORMAT_UNKNOWN == formatDetail.DXGIFormat) + { + blockSize = 8; + } + + // Convert block width size to bytes. + assert((blockSize & 0x7) == 0); + blockSize = blockSize >> 3; + + if (formatDetail.bPlanar) + { + if (FAILED(CalculateExtraPlanarRows(format, blockHeight, /*_Out_*/ blockHeight))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + } + + // Calculate rowPitch, depthPitch, and total subresource size. + UINT rowPitch, depthPitch; + + if ( FAILED(Safe_UIntMult(blockWidth, blockSize, &rowPitch)) + || FAILED(Safe_UIntMult(blockHeight, rowPitch, &depthPitch))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + SIZE_T subresourceByteSize = subDepth * depthPitch; + + if (pDst) + { + D3D12_MEMCPY_DEST& dst = pDst[s]; + + // This data will be returned straight from the API to satisfy Map. So, strides/ alignment must be API-correct. + dst.pData = reinterpret_cast(totalByteSize); + assert(s != 0 || dst.pData == nullptr); + + dst.RowPitch = rowPitch; + dst.SlicePitch = depthPitch; + } + + // Align the subresource size. + static_assert((MAP_ALIGN_REQUIREMENT & (MAP_ALIGN_REQUIREMENT - 1)) == 0, "This code expects MAP_ALIGN_REQUIREMENT to be a power of 2."); + + SIZE_T subresourceByteSizeAligned = subresourceByteSize + MAP_ALIGN_REQUIREMENT - 1; + subresourceByteSizeAligned = subresourceByteSizeAligned & ~(MAP_ALIGN_REQUIREMENT - 1); + totalByteSize = totalByteSize + subresourceByteSizeAligned; + + + // Iterate over mip levels and array elements + if (++iM >= mipLevels) + { + iM = 0; + + subWidth = width; + subHeight = height; + subDepth = depth; + } + else + { + subWidth /= (1 == subWidth ? 1 : 2); + subHeight /= (1 == subHeight ? 1 : 2); + subDepth /= (1 == subDepth ? 1 : 2); + } + } + + return S_OK; +} + +inline bool IsPow2( UINT Val ) +{ + return 0 == (Val & (Val - 1)); +} + +// This helper function calculates the Row Pitch for a given format. For Planar formats this function returns +// the row major RowPitch of the resource. The RowPitch is the same for all the planes. For Planar +// also use the CalculateExtraPlanarRows function to calculate the corresonding height or use the CalculateMinimumRowMajorSlicePitch +// function. For Block Compressed Formats, this function returns the RowPitch of a row of blocks. For packed subsampled formats and other formats, +// this function returns the row pitch of one single row of pixels. +HRESULT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::CalculateMinimumRowMajorRowPitch(DXGI_FORMAT Format, UINT Width, _Out_ UINT &RowPitch) +{ + // Early out for DXGI_FORMAT_UNKNOWN special case. + if (Format == DXGI_FORMAT_UNKNOWN) + { + RowPitch = Width; + return S_OK; + } + + UINT WidthAlignment = GetWidthAlignment(Format); + + UINT NumUnits; + if (IsBlockCompressFormat(Format)) + { + // This function calculates the minimum stride needed for a block row when the format + // is block compressed.The GetBitsPerUnit value stored in the format table indicates + // the size of a compressed block for block compressed formats. + assert(WidthAlignment != 0); + if (FAILED(DivideAndRoundUp(Width, WidthAlignment, NumUnits))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + } + else + { + // All other formats must have strides aligned to their width alignment requirements. + // The Width may not be aligned to the WidthAlignment. This is not an error for this + // function as we expect to allow formats like NV12 to have odd dimensions in the future. + + // The following alignement code expects only pow2 alignment requirements. Only block + // compressed formats currently have non-pow2 alignment requriements. + assert(IsPow2(WidthAlignment)); + + UINT Mask = WidthAlignment - 1; + if (FAILED(Safe_UIntAdd(Width, Mask, &NumUnits))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + + NumUnits &= ~Mask; + } + + if (FAILED(Safe_UIntMult(NumUnits, GetBitsPerUnit(Format), &RowPitch))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + + // This must to always be Byte aligned. + assert((RowPitch & 7) == 0); + RowPitch >>= 3; + + return S_OK; +} + +// This helper function calculates the SlicePitch for a given format. For Planar formats the slice pitch includes the extra +// planes. +HRESULT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::CalculateMinimumRowMajorSlicePitch(DXGI_FORMAT Format, UINT TightRowPitch, UINT Height, _Out_ UINT &SlicePitch) +{ + if (Planar(Format)) + { + UINT PlanarHeight; + if (FAILED(CalculateExtraPlanarRows(Format, Height, PlanarHeight))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + + return Safe_UIntMult(TightRowPitch, PlanarHeight, &SlicePitch); + } + else if (Format == DXGI_FORMAT_UNKNOWN) + { + return Safe_UIntMult(TightRowPitch, Height, &SlicePitch); + } + + UINT HeightAlignment = GetHeightAlignment(Format); + + // Caution assert to make sure that no new format breaks this assumption that all HeightAlignment formats are BC or Planar. + // This is to make sure that Height handled correctly for this calculation. + assert(HeightAlignment == 1 || IsBlockCompressFormat(Format)); + + UINT HeightOfPacked; + if (FAILED(DivideAndRoundUp(Height, HeightAlignment, HeightOfPacked))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + + if (FAILED(Safe_UIntMult(HeightOfPacked, TightRowPitch, &SlicePitch))) + { + return INTSAFE_E_ARITHMETIC_OVERFLOW; + } + + return S_OK; +} + + + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetBitsPerUnit - returns bits per pixel unless format is a block compress format then it returns bits per block. +// use IsBlockCompressFormat() to determine if block size is returned. +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetBitsPerUnit(DXGI_FORMAT Format) +{ + return s_FormatDetail[GetDetailTableIndexNoThrow( Format )].BitsPerUnit; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetWidthAlignment(DXGI_FORMAT Format) +{ + return s_FormatDetail[GetDetailTableIndexNoThrow( Format )].WidthAlignment; +} + +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetHeightAlignment(DXGI_FORMAT Format) +{ + return s_FormatDetail[GetDetailTableIndexNoThrow( Format )].HeightAlignment; +} + +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetDepthAlignment(DXGI_FORMAT Format) +{ + return s_FormatDetail[GetDetailTableIndexNoThrow( Format )].DepthAlignment; +} +//--------------------------------------------------------------------------------------------------------------------------------- +// GetFormat +DXGI_FORMAT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetFormat(SIZE_T Index) +{ + if( Index < GetNumFormats() ) + { + return s_FormatDetail[Index].DXGIFormat; + } + return (DXGI_FORMAT)-1; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// CanBeCastEvenFullyTyped +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::CanBeCastEvenFullyTyped(DXGI_FORMAT Format, D3D_FEATURE_LEVEL fl) +{ + //SRGB can be cast away/back, and XR_BIAS can be cast to/from UNORM + switch(fl) + { + case D3D_FEATURE_LEVEL_1_0_GENERIC: + case D3D_FEATURE_LEVEL_1_0_CORE: + return false; + default: + break; + } + switch( Format ) + { + case DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: + case DXGI_FORMAT_B8G8R8A8_UNORM: + case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB: + return true; + case DXGI_FORMAT_R10G10B10A2_UNORM: + case DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM: + return fl >= D3D_FEATURE_LEVEL_10_0; + default: + return false; + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetFormatDetail +const D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FORMAT_DETAIL* D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetFormatDetail( DXGI_FORMAT Format ) +{ + const UINT Index = GetDetailTableIndex(Format); + if(UINT( -1 ) == Index ) + { + return nullptr; + } + + return &s_FormatDetail[ Index ]; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetBitsPerStencil +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetBitsPerStencil(DXGI_FORMAT Format) +{ + const UINT Index = GetDetailTableIndexThrow( Format ); + if( (s_FormatDetail[Index].TypeLevel != D3DFTL_PARTIAL_TYPE) && + (s_FormatDetail[Index].TypeLevel != D3DFTL_FULL_TYPE) ) + { + return 0; + } + for( UINT comp = 0; comp < 4; comp++ ) + { + D3D_FORMAT_COMPONENT_NAME name = D3DFCN_D; + switch(comp) + { + case 0: name = s_FormatDetail[Index].ComponentName0; break; + case 1: name = s_FormatDetail[Index].ComponentName1; break; + case 2: name = s_FormatDetail[Index].ComponentName2; break; + case 3: name = s_FormatDetail[Index].ComponentName3; break; + } + if( name == D3DFCN_S ) + { + return s_FormatDetail[Index].BitsPerComponent[comp]; + } + } + return 0; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetFormatReturnTypes +void D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetFormatReturnTypes( + DXGI_FORMAT Format, + D3D_FORMAT_COMPONENT_INTERPRETATION* pInterpretations ) // return array with 4 entries +{ + const UINT Index = GetDetailTableIndexThrow(Format); + pInterpretations[D3D10_SB_4_COMPONENT_R] = s_FormatDetail[Index].ComponentInterpretation0; + pInterpretations[D3D10_SB_4_COMPONENT_G] = s_FormatDetail[Index].ComponentInterpretation1; + pInterpretations[D3D10_SB_4_COMPONENT_B] = s_FormatDetail[Index].ComponentInterpretation2; + pInterpretations[D3D10_SB_4_COMPONENT_A] = s_FormatDetail[Index].ComponentInterpretation3; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetAddressingBitsPerAlignedSize +UINT8 D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetAddressingBitsPerAlignedSize(DXGI_FORMAT Format) +{ + UINT byteAlignment = GetByteAlignment(Format); + UINT8 addressBitsPerElement = 0; + + switch(byteAlignment) + { + case 1: addressBitsPerElement = 0; break; + case 2: addressBitsPerElement = 1; break; + case 4: addressBitsPerElement = 2; break; + case 8: addressBitsPerElement = 3; break; + case 16: addressBitsPerElement = 4; break; + + // The format is not supported + default: return UINT8( -1 ); + } + + return addressBitsPerElement; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetNumComponentsInFormat +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetNumComponentsInFormat( DXGI_FORMAT Format ) +{ + UINT n = 0; + const UINT Index = GetDetailTableIndexThrow(Format); + for( UINT comp = 0; comp < 4; comp++ ) + { + D3D_FORMAT_COMPONENT_NAME name = D3DFCN_D; + switch(comp) + { + case 0: name = s_FormatDetail[Index].ComponentName0; break; + case 1: name = s_FormatDetail[Index].ComponentName1; break; + case 2: name = s_FormatDetail[Index].ComponentName2; break; + case 3: name = s_FormatDetail[Index].ComponentName3; break; + } + if( name != D3DFCN_X ) + { + n++; + } + } + return n; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// Sequential2AbsoluteComponentIndex +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::Sequential2AbsoluteComponentIndex( DXGI_FORMAT Format, UINT SequentialComponentIndex) +{ + UINT n = 0; + const UINT Index = GetDetailTableIndexThrow(Format); + for( UINT comp = 0; comp < 4; comp++ ) + { + D3D_FORMAT_COMPONENT_NAME name = static_cast(0); + switch(comp) + { + case 0: name = s_FormatDetail[Index].ComponentName0; break; + case 1: name = s_FormatDetail[Index].ComponentName1; break; + case 2: name = s_FormatDetail[Index].ComponentName2; break; + case 3: name = s_FormatDetail[Index].ComponentName3; break; + } + if( name != D3DFCN_X ) + { + if (SequentialComponentIndex == n) + { + return comp; + } + n++; + } + } + return UINT(-1); +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// Depth Only Format +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::DepthOnlyFormat(DXGI_FORMAT Format) +{ + switch( Format ) + { + case DXGI_FORMAT_D32_FLOAT: + case DXGI_FORMAT_D16_UNORM: + return true; + default: + return false; + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::SupportsSamplerFeedback(DXGI_FORMAT Format) +{ + switch (Format) + { + case DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE: + case DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE: + return true; + default: + return false; + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetParentFormat +DXGI_FORMAT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetParentFormat(DXGI_FORMAT Format) +{ + return s_FormatDetail[Format].ParentFormat; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetFormatCastSet +const DXGI_FORMAT* D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetFormatCastSet(DXGI_FORMAT Format) +{ + return s_FormatDetail[Format].pDefaultFormatCastSet; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetTypeLevel +D3D_FORMAT_TYPE_LEVEL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetTypeLevel(DXGI_FORMAT Format) +{ + return s_FormatDetail[GetDetailTableIndexNoThrow( Format )].TypeLevel; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetLayout +D3D_FORMAT_LAYOUT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetLayout(DXGI_FORMAT Format) +{ + return s_FormatDetail[GetDetailTableIndexNoThrow( Format )].Layout; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetComponentName +D3D_FORMAT_COMPONENT_NAME D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetComponentName(DXGI_FORMAT Format, UINT AbsoluteComponentIndex) +{ + D3D_FORMAT_COMPONENT_NAME name; + switch( AbsoluteComponentIndex ) + { + case 0: name = s_FormatDetail[GetDetailTableIndexNoThrow( Format )].ComponentName0; break; + case 1: name = s_FormatDetail[GetDetailTableIndexNoThrow( Format )].ComponentName1; break; + case 2: name = s_FormatDetail[GetDetailTableIndexNoThrow( Format )].ComponentName2; break; + case 3: name = s_FormatDetail[GetDetailTableIndexNoThrow( Format )].ComponentName3; break; + default: throw E_FAIL; + } + return name; +} +//--------------------------------------------------------------------------------------------------------------------------------- +// GetBitsPerComponent +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetBitsPerComponent(DXGI_FORMAT Format, UINT AbsoluteComponentIndex) +{ + if( AbsoluteComponentIndex > 3 ) + { + throw E_FAIL; + } + return s_FormatDetail[GetDetailTableIndexNoThrow( Format )].BitsPerComponent[AbsoluteComponentIndex]; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetFormatComponentInterpretation +D3D_FORMAT_COMPONENT_INTERPRETATION D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetFormatComponentInterpretation(DXGI_FORMAT Format, UINT AbsoluteComponentIndex) +{ + D3D_FORMAT_COMPONENT_INTERPRETATION interp {}; + + switch( AbsoluteComponentIndex ) + { + case 0: interp = s_FormatDetail[GetDetailTableIndexNoThrow( Format )].ComponentInterpretation0; break; + case 1: interp = s_FormatDetail[GetDetailTableIndexNoThrow( Format )].ComponentInterpretation1; break; + case 2: interp = s_FormatDetail[GetDetailTableIndexNoThrow( Format )].ComponentInterpretation2; break; + case 3: interp = s_FormatDetail[GetDetailTableIndexNoThrow( Format )].ComponentInterpretation3; break; +// default: throw E_FAIL; + } + return interp; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// Planar +BOOL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::Planar(DXGI_FORMAT Format) +{ + return s_FormatDetail[GetDetailTableIndexNoThrow( Format )].bPlanar; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// Non-opaque Planar +BOOL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::NonOpaquePlanar(DXGI_FORMAT Format) +{ + return Planar(Format) && !Opaque(Format); +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// YUV +BOOL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::YUV(DXGI_FORMAT Format) +{ + return s_FormatDetail[GetDetailTableIndexNoThrow( Format )].bYUV; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// Format family supports stencil +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FamilySupportsStencil(DXGI_FORMAT Format) +{ + switch( GetParentFormat(Format) ) + { + case DXGI_FORMAT_R32G8X24_TYPELESS: + case DXGI_FORMAT_R24G8_TYPELESS: + return true; + default: + return false; + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetDetailTableIndexThrow +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetDetailTableIndexThrow(DXGI_FORMAT Format) +{ + UINT Index = GetDetailTableIndex( Format ); + if(UINT( -1 ) == Index ) + { + throw E_FAIL; + } + return Index; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetDetailTableIndexNoThrow +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetDetailTableIndexNoThrow(DXGI_FORMAT Format) +{ + UINT Index = GetDetailTableIndex( Format ); + assert(UINT( -1 ) != Index ); // Needs to be validated externally. + return Index; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetYCbCrChromaSubsampling +void D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetYCbCrChromaSubsampling( + DXGI_FORMAT Format, + _Out_ UINT& HorizontalSubsampling, + _Out_ UINT& VerticalSubsampling + ) +{ + switch( Format) + { + // YCbCr 4:2:0 + case DXGI_FORMAT_NV12: + case DXGI_FORMAT_P010: + case DXGI_FORMAT_P016: + case DXGI_FORMAT_420_OPAQUE: + HorizontalSubsampling = 2; + VerticalSubsampling = 2; + break; + + // YCbCr 4:2:2 + case DXGI_FORMAT_P208: + case DXGI_FORMAT_YUY2: + case DXGI_FORMAT_Y210: + HorizontalSubsampling = 2; + VerticalSubsampling = 1; + break; + + // YCbCr 4:4:0 + case DXGI_FORMAT_V208: + HorizontalSubsampling = 1; + VerticalSubsampling = 2; + break; + + // YCbCr 4:4:4 + case DXGI_FORMAT_AYUV: + case DXGI_FORMAT_V408: + case DXGI_FORMAT_Y410: + case DXGI_FORMAT_Y416: + // Fallthrough + + // YCbCr palletized 4:4:4: + case DXGI_FORMAT_AI44: + case DXGI_FORMAT_IA44: + case DXGI_FORMAT_P8: + case DXGI_FORMAT_A8P8: + HorizontalSubsampling = 1; + VerticalSubsampling = 1; + break; + + // YCbCr 4:1:1 + case DXGI_FORMAT_NV11: + HorizontalSubsampling = 4; + VerticalSubsampling = 1; + break; + + default: + // All YCbCr formats should be in this list. + assert( !YUV(Format) ); + HorizontalSubsampling = 1; + VerticalSubsampling = 1; + break; + }; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// Plane count for non-opaque planar formats +UINT D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::NonOpaquePlaneCount(DXGI_FORMAT Format) +{ + if (!D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::NonOpaquePlanar(Format)) + { + return 1; + } + + // V208 and V408 are the only 3-plane formats. + return (Format == DXGI_FORMAT_V208 || Format == DXGI_FORMAT_V408) ? 3 : 2; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetTileShape +// +// Retrieve 64K Tiled Resource tile shape +void D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetTileShape( + D3D12_TILE_SHAPE* pTileShape, + DXGI_FORMAT Format, + D3D12_RESOURCE_DIMENSION Dimension, + UINT SampleCount + ) +{ + UINT BPU = GetBitsPerUnit(Format); + + switch(Dimension) + { + case D3D12_RESOURCE_DIMENSION_UNKNOWN: + case D3D12_RESOURCE_DIMENSION_BUFFER: + case D3D12_RESOURCE_DIMENSION_TEXTURE1D: + { + assert(!IsBlockCompressFormat(Format)); + pTileShape->WidthInTexels = (BPU == 0) ? D3D12_TILED_RESOURCE_TILE_SIZE_IN_BYTES : D3D12_TILED_RESOURCE_TILE_SIZE_IN_BYTES*8 / BPU; + pTileShape->HeightInTexels = 1; + pTileShape->DepthInTexels = 1; + } + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE2D: + { + if (IsBlockCompressFormat(Format)) + { + // Currently only supported block sizes are 64 and 128. + // These equations calculate the size in texels for a tile. It relies on the fact that 64 * 64 blocks fit in a tile if the block size is 128 bits. + assert(BPU == 64 || BPU == 128); + pTileShape->WidthInTexels = 64 * GetWidthAlignment(Format); + pTileShape->HeightInTexels = 64 * GetHeightAlignment(Format); + pTileShape->DepthInTexels = 1; + if (BPU == 64) + { + // If bits per block are 64 we double width so it takes up the full tile size. + // This is only true for BC1 and BC4 + assert((Format >= DXGI_FORMAT_BC1_TYPELESS && Format <= DXGI_FORMAT_BC1_UNORM_SRGB) || + (Format >= DXGI_FORMAT_BC4_TYPELESS && Format <= DXGI_FORMAT_BC4_SNORM)); + pTileShape->WidthInTexels *= 2; + } + } + else + { + pTileShape->DepthInTexels = 1; + if (BPU <= 8) + { + pTileShape->WidthInTexels = 256; + pTileShape->HeightInTexels = 256; + } + else if (BPU <= 16) + { + pTileShape->WidthInTexels = 256; + pTileShape->HeightInTexels = 128; + } + else if (BPU <= 32) + { + pTileShape->WidthInTexels = 128; + pTileShape->HeightInTexels = 128; + } + else if (BPU <= 64) + { + pTileShape->WidthInTexels = 128; + pTileShape->HeightInTexels = 64; + } + else if (BPU <= 128) + { + pTileShape->WidthInTexels = 64; + pTileShape->HeightInTexels = 64; + } + else + { + ASSUME( FALSE ); + } + + if (SampleCount <= 1) + { /* Do nothing */ } + else if (SampleCount <= 2) + { + pTileShape->WidthInTexels /= 2; + pTileShape->HeightInTexels /= 1; + } + else if (SampleCount <= 4) + { + pTileShape->WidthInTexels /= 2; + pTileShape->HeightInTexels /= 2; + } + else if (SampleCount <= 8) + { + pTileShape->WidthInTexels /= 4; + pTileShape->HeightInTexels /= 2; + } + else if (SampleCount <= 16) + { + pTileShape->WidthInTexels /= 4; + pTileShape->HeightInTexels /= 4; + } + else + { + ASSUME( FALSE ); + } + } + } + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE3D: + { + if (IsBlockCompressFormat(Format)) + { + // Currently only supported block sizes are 64 and 128. + // These equations calculate the size in texels for a tile. It relies on the fact that 16*16*16 blocks fit in a tile if the block size is 128 bits. + assert(BPU == 64 || BPU == 128); + pTileShape->WidthInTexels = 16 * GetWidthAlignment(Format); + pTileShape->HeightInTexels = 16 * GetHeightAlignment(Format); + pTileShape->DepthInTexels = 16 * GetDepthAlignment(Format); + if (BPU == 64) + { + // If bits per block are 64 we double width so it takes up the full tile size. + // This is only true for BC1 and BC4 + assert((Format >= DXGI_FORMAT_BC1_TYPELESS && Format <= DXGI_FORMAT_BC1_UNORM_SRGB) || + (Format >= DXGI_FORMAT_BC4_TYPELESS && Format <= DXGI_FORMAT_BC4_SNORM)); + pTileShape->WidthInTexels *= 2; + } + } + else if (Format == DXGI_FORMAT_R8G8_B8G8_UNORM || Format == DXGI_FORMAT_G8R8_G8B8_UNORM) + { + //RGBG and GRGB are treated as 2x1 block format + pTileShape->WidthInTexels = 64; + pTileShape->HeightInTexels = 32; + pTileShape->DepthInTexels = 16; + } + else + { + // Not a block format so BPU is bits per pixel. + assert(GetWidthAlignment(Format) == 1 && GetHeightAlignment(Format) == 1 && GetDepthAlignment(Format)); + switch(BPU) + { + case 8: + pTileShape->WidthInTexels = 64; + pTileShape->HeightInTexels = 32; + pTileShape->DepthInTexels = 32; + break; + case 16: + pTileShape->WidthInTexels = 32; + pTileShape->HeightInTexels = 32; + pTileShape->DepthInTexels = 32; + break; + case 32: + pTileShape->WidthInTexels = 32; + pTileShape->HeightInTexels = 32; + pTileShape->DepthInTexels = 16; + break; + case 64: + pTileShape->WidthInTexels = 32; + pTileShape->HeightInTexels = 16; + pTileShape->DepthInTexels = 16; + break; + case 128: + pTileShape->WidthInTexels = 16; + pTileShape->HeightInTexels = 16; + pTileShape->DepthInTexels = 16; + break; + } + } + break; + } + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// Get4KTileShape +// +// Retrieve 4K Tiled Resource tile shape +void D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::Get4KTileShape( + D3D12_TILE_SHAPE* pTileShape, + DXGI_FORMAT Format, + D3D12_RESOURCE_DIMENSION Dimension, + UINT SampleCount + ) +{ + UINT BPU = GetBitsPerUnit(Format); + + switch(Dimension) + { + case D3D12_RESOURCE_DIMENSION_UNKNOWN: + case D3D12_RESOURCE_DIMENSION_BUFFER: + case D3D12_RESOURCE_DIMENSION_TEXTURE1D: + { + assert(!IsBlockCompressFormat(Format)); + pTileShape->WidthInTexels = (BPU == 0) ? 4096 : 4096*8 / BPU; + pTileShape->HeightInTexels = 1; + pTileShape->DepthInTexels = 1; + } + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE2D: + { + pTileShape->DepthInTexels = 1; + if (IsBlockCompressFormat(Format)) + { + // Currently only supported block sizes are 64 and 128. + // These equations calculate the size in texels for a tile. It relies on the fact that 16*16*16 blocks fit in a tile if the block size is 128 bits. + assert(BPU == 64 || BPU == 128); + pTileShape->WidthInTexels = 16 * GetWidthAlignment(Format); + pTileShape->HeightInTexels = 16 * GetHeightAlignment(Format); + if (BPU == 64) + { + // If bits per block are 64 we double width so it takes up the full tile size. + // This is only true for BC1 and BC4 + assert((Format >= DXGI_FORMAT_BC1_TYPELESS && Format <= DXGI_FORMAT_BC1_UNORM_SRGB) || + (Format >= DXGI_FORMAT_BC4_TYPELESS && Format <= DXGI_FORMAT_BC4_SNORM)); + pTileShape->WidthInTexels *= 2; + } + } + else + { + if (BPU <= 8) + { + pTileShape->WidthInTexels = 64; + pTileShape->HeightInTexels = 64; + } + else if (BPU <= 16) + { + pTileShape->WidthInTexels = 64; + pTileShape->HeightInTexels = 32; + } + else if (BPU <= 32) + { + pTileShape->WidthInTexels = 32; + pTileShape->HeightInTexels = 32; + } + else if (BPU <= 64) + { + pTileShape->WidthInTexels = 32; + pTileShape->HeightInTexels = 16; + } + else if (BPU <= 128) + { + pTileShape->WidthInTexels = 16; + pTileShape->HeightInTexels = 16; + } + else + { + ASSUME( FALSE ); + } + + if (SampleCount <= 1) + { /* Do nothing */ } + else if (SampleCount <= 2) + { + pTileShape->WidthInTexels /= 2; + pTileShape->HeightInTexels /= 1; + } + else if (SampleCount <= 4) + { + pTileShape->WidthInTexels /= 2; + pTileShape->HeightInTexels /= 2; + } + else if (SampleCount <= 8) + { + pTileShape->WidthInTexels /= 4; + pTileShape->HeightInTexels /= 2; + } + else if (SampleCount <= 16) + { + pTileShape->WidthInTexels /= 4; + pTileShape->HeightInTexels /= 4; + } + else + { + ASSUME( FALSE ); + } + + assert(GetWidthAlignment(Format) == 1); + assert(GetHeightAlignment(Format) == 1); + assert(GetDepthAlignment(Format) == 1); + } + + break; + } + case D3D12_RESOURCE_DIMENSION_TEXTURE3D: + { + if (IsBlockCompressFormat(Format)) + { + // Currently only supported block sizes are 64 and 128. + // These equations calculate the size in texels for a tile. It relies on the fact that 16*16*16 blocks fit in a tile if the block size is 128 bits. + assert(BPU == 64 || BPU == 128); + pTileShape->WidthInTexels = 8 * GetWidthAlignment(Format); + pTileShape->HeightInTexels = 8 * GetHeightAlignment(Format); + pTileShape->DepthInTexels = 4; + if (BPU == 64) + { + // If bits per block are 64 we double width so it takes up the full tile size. + // This is only true for BC1 and BC4 + assert((Format >= DXGI_FORMAT_BC1_TYPELESS && Format <= DXGI_FORMAT_BC1_UNORM_SRGB) || + (Format >= DXGI_FORMAT_BC4_TYPELESS && Format <= DXGI_FORMAT_BC4_SNORM)); + pTileShape->DepthInTexels *= 2; + } + } + else + { + if (BPU <= 8) + { + pTileShape->WidthInTexels = 16; + pTileShape->HeightInTexels = 16; + pTileShape->DepthInTexels = 16; + } + else if (BPU <= 16) + { + pTileShape->WidthInTexels = 16; + pTileShape->HeightInTexels = 16; + pTileShape->DepthInTexels = 8; + } + else if (BPU <= 32) + { + pTileShape->WidthInTexels = 16; + pTileShape->HeightInTexels = 8; + pTileShape->DepthInTexels = 8; + } + else if (BPU <= 64) + { + pTileShape->WidthInTexels = 8; + pTileShape->HeightInTexels = 8; + pTileShape->DepthInTexels = 8; + } + else if (BPU <= 128) + { + pTileShape->WidthInTexels = 8; + pTileShape->HeightInTexels = 8; + pTileShape->DepthInTexels = 4; + } + else + { + ASSUME( FALSE ); + } + + assert(GetWidthAlignment(Format) == 1); + assert(GetHeightAlignment(Format) == 1); + assert(GetDepthAlignment(Format) == 1); + } + } + break; + } +} + +//---------------------------------------------------------------------------------------------------------------------------------- +// GetPlaneSliceFromViewFormat +// Maps resource format + view format to a plane index for resource formats where the plane index can be inferred from this information. +// For planar formats where the plane index is ambiguous given this information (examples: V208, V408), this function returns 0. +// This function returns 0 for non-planar formats. +UINT8 D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetPlaneSliceFromViewFormat( + DXGI_FORMAT ResourceFormat, + DXGI_FORMAT ViewFormat + ) +{ + switch(GetParentFormat(ResourceFormat)) + { + case DXGI_FORMAT_R24G8_TYPELESS: + switch(ViewFormat) + { + case DXGI_FORMAT_R24_UNORM_X8_TYPELESS: + return 0; + case DXGI_FORMAT_X24_TYPELESS_G8_UINT: + return 1; + default: + ASSUME( false ); + } + break; + case DXGI_FORMAT_R32G8X24_TYPELESS: + switch(ViewFormat) + { + case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS: + return 0; + case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT: + return 1; + default: + ASSUME( false ); + } + break; + case DXGI_FORMAT_NV12: + case DXGI_FORMAT_NV11: + case DXGI_FORMAT_P208: + switch(ViewFormat) + { + case DXGI_FORMAT_R8_UNORM: + case DXGI_FORMAT_R8_UINT: + return 0; + case DXGI_FORMAT_R8G8_UNORM: + case DXGI_FORMAT_R8G8_UINT: + return 1; + default: + ASSUME( false ); + } + break; + case DXGI_FORMAT_P016: + case DXGI_FORMAT_P010: + switch(ViewFormat) + { + case DXGI_FORMAT_R16_UNORM: + case DXGI_FORMAT_R16_UINT: + return 0; + case DXGI_FORMAT_R16G16_UNORM: + case DXGI_FORMAT_R16G16_UINT: + case DXGI_FORMAT_R32_UINT: + return 1; + default: + ASSUME( false ); + } + break; + default: + break; + } + return 0; +} + +//---------------------------------------------------------------------------------------------------------------------------------- +void D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetPlaneSubsampledSizeAndFormatForCopyableLayout( + UINT PlaneSlice, + DXGI_FORMAT Format, + UINT Width, + UINT Height, + _Out_ DXGI_FORMAT& PlaneFormat, + _Out_ UINT& MinPlanePitchWidth, + _Out_ UINT& PlaneWidth, + _Out_ UINT& PlaneHeight) +{ + DXGI_FORMAT ParentFormat = GetParentFormat(Format); + + if (Planar(ParentFormat)) + { + switch (ParentFormat) + { + // YCbCr 4:2:0 + case DXGI_FORMAT_NV12: + switch(PlaneSlice) + { + case 0: + PlaneFormat = DXGI_FORMAT_R8_TYPELESS; + PlaneWidth = Width; + PlaneHeight = Height; + break; + case 1: + PlaneFormat = DXGI_FORMAT_R8G8_TYPELESS; + PlaneWidth = (Width + 1) >> 1; + PlaneHeight = (Height + 1) >> 1; + break; + default: + ASSUME(FALSE); + }; + + MinPlanePitchWidth = PlaneWidth; + break; + + case DXGI_FORMAT_P010: + case DXGI_FORMAT_P016: + switch(PlaneSlice) + { + case 0: + PlaneFormat = DXGI_FORMAT_R16_TYPELESS; + PlaneWidth = Width; + PlaneHeight = Height; + break; + case 1: + PlaneFormat = DXGI_FORMAT_R16G16_TYPELESS; + PlaneWidth = (Width + 1) >> 1; + PlaneHeight = (Height + 1) >> 1; + break; + default: + ASSUME(FALSE); + }; + + MinPlanePitchWidth = PlaneWidth; + break; + + // YCbCr 4:2:2 + case DXGI_FORMAT_P208: + switch(PlaneSlice) + { + case 0: + PlaneFormat = DXGI_FORMAT_R8_TYPELESS; + PlaneWidth = Width; + PlaneHeight = Height; + break; + case 1: + PlaneFormat = DXGI_FORMAT_R8G8_TYPELESS; + PlaneWidth = (Width + 1) >> 1; + PlaneHeight = Height; + break; + default: + ASSUME(FALSE); + }; + + MinPlanePitchWidth = PlaneWidth; + break; + + // YCbCr 4:4:0 + case DXGI_FORMAT_V208: + PlaneFormat = DXGI_FORMAT_R8_TYPELESS; + switch(PlaneSlice) + { + case 0: + PlaneWidth = Width; + PlaneHeight = Height; + break; + case 1: + case 2: + PlaneWidth = Width; + PlaneHeight = (Height + 1) >> 1; + break; + default: + ASSUME(FALSE); + }; + + MinPlanePitchWidth = PlaneWidth; + break; + + // YCbCr 4:4:4 + case DXGI_FORMAT_V408: + + switch(PlaneSlice) + { + case 0: + case 1: + case 2: + PlaneFormat = DXGI_FORMAT_R8_TYPELESS; + PlaneWidth = Width; + PlaneHeight = Height; + MinPlanePitchWidth = PlaneWidth; + break; + default: + ASSUME(FALSE); + }; + break; + + // YCbCr 4:1:1 + case DXGI_FORMAT_NV11: + switch(PlaneSlice) + { + case 0: + PlaneFormat = DXGI_FORMAT_R8_TYPELESS; + PlaneWidth = Width; + PlaneHeight = Height; + MinPlanePitchWidth = Width; + break; + case 1: + PlaneFormat = DXGI_FORMAT_R8G8_TYPELESS; + PlaneWidth = (Width + 3) >> 2; + PlaneHeight = Height; + + // NV11 has unused padding to the right of the chroma plane in the RowMajor (linear) copyable layout. + MinPlanePitchWidth = (Width + 1) >> 1; + break; + default: + ASSUME(FALSE); + }; + + break; + + case DXGI_FORMAT_R32G8X24_TYPELESS: + case DXGI_FORMAT_R24G8_TYPELESS: + switch(PlaneSlice) + { + case 0: + PlaneFormat = DXGI_FORMAT_R32_TYPELESS; + PlaneWidth = Width; + PlaneHeight = Height; + MinPlanePitchWidth = Width; + break; + case 1: + PlaneFormat = DXGI_FORMAT_R8_TYPELESS; + PlaneWidth = Width; + PlaneHeight = Height; + MinPlanePitchWidth = Width; + break; + default: + ASSUME(FALSE); + }; + break; + + default: + ASSUME( FALSE ); + }; + } + else + { + assert(PlaneSlice == 0); + PlaneFormat = Format; + PlaneWidth = Width; + PlaneHeight = Height; + MinPlanePitchWidth = PlaneWidth; + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// GetPlaneCount +UINT8 D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetPlaneCount(DXGI_FORMAT Format) +{ + switch( GetParentFormat(Format) ) + { + case DXGI_FORMAT_NV12: + case DXGI_FORMAT_NV11: + case DXGI_FORMAT_P208: + case DXGI_FORMAT_P016: + case DXGI_FORMAT_P010: + case DXGI_FORMAT_R24G8_TYPELESS: + case DXGI_FORMAT_R32G8X24_TYPELESS: + return 2; + case DXGI_FORMAT_V208: + case DXGI_FORMAT_V408: + return 3; + default: + return 1; + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +void D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetMipDimensions(UINT8 mipSlice, _Inout_ UINT64 *pWidth, _Inout_opt_ UINT64 *pHeight, _Inout_opt_ UINT64 *pDepth) +{ + UINT denominator = (1 << mipSlice); // 2 ^ subresource + UINT64 mipWidth = *pWidth / denominator; + UINT64 mipHeight = pHeight ? *pHeight / denominator : 1; + UINT64 mipDepth = pDepth ? *pDepth / denominator : 1; + + // Adjust dimensions for degenerate mips + if(mipHeight == 0 ) + mipHeight = 1; + if(mipWidth == 0 ) + mipWidth = 1; + if(mipDepth == 0) + mipDepth = 1; + + *pWidth = mipWidth; + if(pHeight) *pHeight = mipHeight; + if(pDepth) *pDepth = mipDepth; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// DX9VertexOrIndexFormat +BOOL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::DX9VertexOrIndexFormat(DXGI_FORMAT Format) +{ + return s_FormatDetail[D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetDetailTableIndexThrow( Format )].bDX9VertexOrIndexFormat; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// DX9TextureFormat +BOOL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::DX9TextureFormat(DXGI_FORMAT Format) +{ + return s_FormatDetail[D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetDetailTableIndexThrow( Format )].bDX9TextureFormat; +} +//--------------------------------------------------------------------------------------------------------------------------------- +// FloatNormTextureFormat +BOOL D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FloatNormTextureFormat(DXGI_FORMAT Format) +{ + return s_FormatDetail[D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::GetDetailTableIndexThrow( Format )].bFloatNormFormat; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// ValidCastToR32UAV +// +// D3D11 has a limitation on typed UAVs (e.g. Texture1D/2D/3D) whereby the only format that can be read is R32_*. Lots of formats +// can be written though, with type conversion (e.g. R8G8B8A8_*). If an API user wants to do image processing in-place, in either +// the Compute Shader or the Pixel Shader, the only format available is R32_* (since it can be read and written at the same time). +// +// We were able to allow resources (Texture1D/2D/3D), created with a format from a small set of families that have 32 bits per element +// (such as R8G8B8A8_TYPELESS), to be cast to R32_* when creating a UAV. This means the Compute Shader or Pixel Shader can +// do simultaneous read+write on the resource when bound as an R32_* UAV, with the caveat that the shader code has to do manual +// type conversion manually, but later on the resource can be used as an SRV or RT as the desired type (e.g. R8G8B8A8_UNORM), and +// thus have access to filtering/blending where the hardware knows what the format is. +// +// If we didn't have this ability to cast some formats to R32_* UAVs, applications would have to keep an extra allocation around +// and do a rendering pass that copies from the R32_* UAV to whatever typed resource they really wanted. For formats not included +// in this list, such as any format that doesn't have 32-bits per component, as well as some 32-bit per component formats like +// R24G8 or R11G11B10_FLOAT there is no alternative for an application but to do the extra copy as mentioned, or avoid in-place +// image editing in favor of ping-ponging between buffers with multiple passes. +// +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::ValidCastToR32UAV(DXGI_FORMAT from, DXGI_FORMAT to) +{ + // Allow casting of 32 bit formats to R32_* + if( + ((to == DXGI_FORMAT_R32_UINT)||(to == DXGI_FORMAT_R32_SINT)||(to == DXGI_FORMAT_R32_FLOAT)) + && + ( + (from == DXGI_FORMAT_R10G10B10A2_TYPELESS) || + (from == DXGI_FORMAT_R8G8B8A8_TYPELESS) || + (from == DXGI_FORMAT_B8G8R8A8_TYPELESS) || + (from == DXGI_FORMAT_B8G8R8X8_TYPELESS) || + (from == DXGI_FORMAT_R16G16_TYPELESS) || + (from == DXGI_FORMAT_R32_TYPELESS) + ) + ) + { + return true; + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// IsSupportedTextureDisplayableFormat +// +// List of formats associated with Feature_D3D1XDisplayable +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::IsSupportedTextureDisplayableFormat + ( DXGI_FORMAT Format + , bool bMediaFormatOnly + ) +{ + if (bMediaFormatOnly) + { + return (false + || ( Format == DXGI_FORMAT_NV12 + || Format == DXGI_FORMAT_YUY2 + ) + ); + } + else + { + return (false // eases evolution + || ( Format == DXGI_FORMAT_B8G8R8A8_UNORM + || Format == DXGI_FORMAT_R8G8B8A8_UNORM + || Format == DXGI_FORMAT_R16G16B16A16_FLOAT + || Format == DXGI_FORMAT_R10G10B10A2_UNORM + || Format == DXGI_FORMAT_NV12 + || Format == DXGI_FORMAT_YUY2 + ) + ); + } +} + +//--------------------------------------------------------------------------------------------------------------------------------- +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::FloatAndNotFloatFormats(DXGI_FORMAT FormatA, DXGI_FORMAT FormatB) +{ + UINT NumComponents = (std::min)(GetNumComponentsInFormat(FormatA), GetNumComponentsInFormat(FormatB)); + for (UINT c = 0; c < NumComponents; c++) + { + D3D_FORMAT_COMPONENT_INTERPRETATION fciA = GetFormatComponentInterpretation(FormatA, c); + D3D_FORMAT_COMPONENT_INTERPRETATION fciB = GetFormatComponentInterpretation(FormatB, c); + if ((fciA != fciB) && ((fciA == D3DFCI_FLOAT) || (fciB == D3DFCI_FLOAT))) + { + return true; + } + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::SNORMAndUNORMFormats(DXGI_FORMAT FormatA, DXGI_FORMAT FormatB) +{ + UINT NumComponents = (std::min)(GetNumComponentsInFormat(FormatA), GetNumComponentsInFormat(FormatB)); + for (UINT c = 0; c < NumComponents; c++) + { + D3D_FORMAT_COMPONENT_INTERPRETATION fciA = GetFormatComponentInterpretation(FormatA, c); + D3D_FORMAT_COMPONENT_INTERPRETATION fciB = GetFormatComponentInterpretation(FormatB, c); + if (((fciA == D3DFCI_SNORM) && (fciB == D3DFCI_UNORM)) || + ((fciB == D3DFCI_SNORM) && (fciA == D3DFCI_UNORM))) + { + return true; + } + } + return false; +} + +//--------------------------------------------------------------------------------------------------------------------------------- +// Formats allowed by runtime for decode histogram. + bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::DecodeHistogramAllowedForOutputFormatSupport(DXGI_FORMAT Format) + { + return ( + /* YUV 4:2:0 */ + Format == DXGI_FORMAT_NV12 + || Format == DXGI_FORMAT_P010 + || Format == DXGI_FORMAT_P016 + /* YUV 4:2:2 */ + || Format == DXGI_FORMAT_YUY2 + || Format == DXGI_FORMAT_Y210 + || Format == DXGI_FORMAT_Y216 + /* YUV 4:4:4 */ + || Format == DXGI_FORMAT_AYUV + || Format == DXGI_FORMAT_Y410 + || Format == DXGI_FORMAT_Y416 + ); + } + +//--------------------------------------------------------------------------------------------------------------------------------- +// Formats allowed by runtime for decode histogram. Scopes to tested formats. + bool D3D12_PROPERTY_LAYOUT_FORMAT_TABLE::MotionEstimatorAllowedInputFormat(DXGI_FORMAT Format) + { + return Format == DXGI_FORMAT_NV12; + } + +#undef R +#undef G +#undef B +#undef A +#undef D +#undef S +#undef X + +#undef _TYPELESS +#undef _FLOAT +#undef _SNORM +#undef _UNORM +#undef _SINT +#undef _UINT +#undef _UNORM_SRGB +#undef _FIXED_2_8 + +#endif // D3D12_SDK_VERSION >= 606 + diff --git a/deps/ShaderTranspiler b/deps/ShaderTranspiler index 2b4b851..2b173d8 160000 --- a/deps/ShaderTranspiler +++ b/deps/ShaderTranspiler @@ -1 +1 @@ -Subproject commit 2b4b851d35bb1df424644358288db2bdf1ec3737 +Subproject commit 2b173d8beb8082df89e8f1e99dea188df5998896 diff --git a/deps/VulkanMemoryAllocator/CMakeLists.txt b/deps/VulkanMemoryAllocator/CMakeLists.txt index 0cbcbdd..8adeb7a 100644 --- a/deps/VulkanMemoryAllocator/CMakeLists.txt +++ b/deps/VulkanMemoryAllocator/CMakeLists.txt @@ -1,55 +1,49 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.15...3.26) -project(VulkanMemoryAllocator LANGUAGES CXX) +project(VMA VERSION 3.1.0 LANGUAGES CXX) -# https://cmake.org/cmake/help/latest/variable/PROJECT_IS_TOP_LEVEL.html -string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} PROJECT_IS_TOP_LEVEL) +add_library(VulkanMemoryAllocator INTERFACE) +add_library(GPUOpen::VulkanMemoryAllocator ALIAS VulkanMemoryAllocator) -if(PROJECT_IS_TOP_LEVEL) - find_package(Vulkan REQUIRED) - include_directories(${Vulkan_INCLUDE_DIR}) -endif() +target_include_directories(VulkanMemoryAllocator INTERFACE $) -# VulkanMemoryAllocator contains an sample application which is not built by default -option(VMA_BUILD_SAMPLE "Build VulkanMemoryAllocator sample application" OFF) -option(VMA_BUILD_SAMPLE_SHADERS "Build VulkanMemoryAllocator sample application's shaders" OFF) - -message(STATUS "VMA_BUILD_SAMPLE = ${VMA_BUILD_SAMPLE}") -message(STATUS "VMA_BUILD_SAMPLE_SHADERS = ${VMA_BUILD_SAMPLE_SHADERS}") - -option(VMA_STATIC_VULKAN_FUNCTIONS "Link statically with Vulkan API" ON) -option(VMA_DYNAMIC_VULKAN_FUNCTIONS "Fetch pointers to Vulkan functions internally (no static linking)" OFF) -option(VMA_DEBUG_ALWAYS_DEDICATED_MEMORY "Every allocation will have its own memory block" OFF) -option(VMA_DEBUG_INITIALIZE_ALLOCATIONS "Automatically fill new allocations and destroyed allocations with some bit pattern" OFF) -option(VMA_DEBUG_GLOBAL_MUTEX "Enable single mutex protecting all entry calls to the library" OFF) -option(VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT "Never exceed VkPhysicalDeviceLimits::maxMemoryAllocationCount and return error" OFF) - -message(STATUS "VMA_STATIC_VULKAN_FUNCTIONS = ${VMA_STATIC_VULKAN_FUNCTIONS}") -message(STATUS "VMA_DYNAMIC_VULKAN_FUNCTIONS = ${VMA_DYNAMIC_VULKAN_FUNCTIONS}") -message(STATUS "VMA_DEBUG_ALWAYS_DEDICATED_MEMORY = ${VMA_DEBUG_ALWAYS_DEDICATED_MEMORY}") -message(STATUS "VMA_DEBUG_INITIALIZE_ALLOCATIONS = ${VMA_DEBUG_INITIALIZE_ALLOCATIONS}") -message(STATUS "VMA_DEBUG_GLOBAL_MUTEX = ${VMA_DEBUG_GLOBAL_MUTEX}") -message(STATUS "VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT = ${VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT}") - -if(VMA_BUILD_SAMPLE) - set(VMA_BUILD_SAMPLE_SHADERS ON) +if (CMAKE_VERSION VERSION_LESS "3.21") + # https://cmake.org/cmake/help/latest/variable/PROJECT_IS_TOP_LEVEL.html + string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} PROJECT_IS_TOP_LEVEL) endif() -option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" OFF) - -if(BUILD_DOCUMENTATION) - find_package(Doxygen REQUIRED) - # set input and output files - set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile) - set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) - # request to configure the file - configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) - # note the option ALL which allows to build the docs together with the application - add_custom_target( doc_doxygen ALL - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen" - VERBATIM ) +option(VMA_ENABLE_INSTALL "Install VulkanMemoryAllocator" ${PROJECT_IS_TOP_LEVEL}) +if (VMA_ENABLE_INSTALL) + include(GNUInstallDirs) + include(CMakePackageConfigHelpers) + + install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(TARGETS VulkanMemoryAllocator EXPORT VulkanMemoryAllocatorConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(EXPORT VulkanMemoryAllocatorConfig NAMESPACE "GPUOpen::" DESTINATION "share/cmake/VulkanMemoryAllocator") + + write_basic_package_version_file(VulkanMemoryAllocatorConfigVersion.cmake COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/VulkanMemoryAllocatorConfigVersion.cmake" DESTINATION "share/cmake/VulkanMemoryAllocator") + + option(VMA_BUILD_DOCUMENTATION "Create and install the HTML based API documentation") + if(VMA_BUILD_DOCUMENTATION) + find_package(Doxygen REQUIRED) + # set input and output files + set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile) + set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + # request to configure the file + configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) + # note the option ALL which allows to build the docs together with the application + add_custom_target(doc_doxygen ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM + ) + install(DIRECTORY docs/ DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/VulkanMemoryAllocator" PATTERN ".nojekyll" EXCLUDE) + endif() + + option(VMA_BUILD_SAMPLES "Build samples") + if (VMA_BUILD_SAMPLES) + add_subdirectory(src) + endif() endif() - -add_subdirectory(src) diff --git a/deps/VulkanMemoryAllocator/LICENSE.txt b/deps/VulkanMemoryAllocator/LICENSE.txt index fcf8b67..b9fff38 100644 --- a/deps/VulkanMemoryAllocator/LICENSE.txt +++ b/deps/VulkanMemoryAllocator/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/deps/VulkanMemoryAllocator/README.md b/deps/VulkanMemoryAllocator/README.md index 621bc41..c8997c8 100644 --- a/deps/VulkanMemoryAllocator/README.md +++ b/deps/VulkanMemoryAllocator/README.md @@ -51,10 +51,13 @@ Additional features: - Support for Vulkan 1.0, 1.1, 1.2, 1.3. - Support for extensions (and equivalent functionality included in new Vulkan versions): - VK_KHR_dedicated_allocation: Just enable it and it will be used automatically by the library. - - VK_KHR_buffer_device_address: Flag `VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR` is automatically added to memory allocations where needed. + - VK_KHR_bind_memory2. + - VK_KHR_maintenance4. + - VK_KHR_maintenance5, including `VkBufferUsageFlags2CreateInfoKHR`. - VK_EXT_memory_budget: Used internally if available to query for current usage and budget. If not available, it falls back to an estimation based on memory heap sizes. + - VK_KHR_buffer_device_address: Flag `VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR` is automatically added to memory allocations where needed. - VK_EXT_memory_priority: Set `priority` of allocations or custom pools and it will be set automatically using this extension. - - VK_AMD_device_coherent_memory + - VK_AMD_device_coherent_memory. - Defragmentation of GPU and CPU memory: Let the library move data around to free some memory blocks and make your allocations better compacted. - Statistics: Obtain brief or detailed statistics about the amount of memory used, unused, number of allocated blocks, number of allocations etc. - globally, per memory heap, and per memory type. - Debug annotations: Associate custom `void* pUserData` and debug `char* pName` with each allocation. @@ -99,38 +102,35 @@ With this one function call: # How to build -On Windows it is recommended to use [CMake UI](https://cmake.org/runningcmake/). Alternatively you can generate a Visual Studio project map using CMake in command line: `cmake -B./build/ -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 16 2019" -A x64 ./` +On Windows it is recommended to use [CMake GUI](https://cmake.org/runningcmake/). -On Linux: +Alternatively you can generate/open a Visual Studio from the command line: -``` -mkdir build -cd build -cmake .. -make +```sh +# By default CMake picks the newest version of Visual Studio it can use +cmake -S . -B build -D VMA_BUILD_SAMPLES=ON +cmake --open build ``` -The following targets are available +On Linux: + +```sh +cmake -S . -B build +# Since VMA has no source files, you can skip to installation immediately +cmake --install build --prefix build/install +``` -| Target | Description | CMake option | Default setting | -| ------------- | ------------- | ------------- | ------------- | -| VmaSample | VMA sample application | `VMA_BUILD_SAMPLE` | `OFF` | -| VmaBuildSampleShaders | Shaders for VmaSample | `VMA_BUILD_SAMPLE_SHADERS` | `OFF` | +## How to use -Please note that while VulkanMemoryAllocator library is supported on other platforms besides Windows, VmaSample is not. +After calling either `find_package` or `add_subdirectory` simply link the library. +This automatically handles configuring the include directory. Example: -These CMake options are available +```cmake +find_package(VulkanMemoryAllocator CONFIG REQUIRED) +target_link_libraries(YourGameEngine PRIVATE GPUOpen::VulkanMemoryAllocator) +``` -| CMake option | Description | Default setting | -| ------------- | ------------- | ------------- | -| `VMA_RECORDING_ENABLED` | Enable VMA memory recording for debugging | `OFF` | -| `VMA_USE_STL_CONTAINERS` | Use C++ STL containers instead of VMA's containers | `OFF` | -| `VMA_STATIC_VULKAN_FUNCTIONS` | Link statically with Vulkan API | `OFF` | -| `VMA_DYNAMIC_VULKAN_FUNCTIONS` | Fetch pointers to Vulkan functions internally (no static linking) | `ON` | -| `VMA_DEBUG_ALWAYS_DEDICATED_MEMORY` | Every allocation will have its own memory block | `OFF` | -| `VMA_DEBUG_INITIALIZE_ALLOCATIONS` | Automatically fill new allocations and destroyed allocations with some bit pattern | `OFF` | -| `VMA_DEBUG_GLOBAL_MUTEX` | Enable single mutex protecting all entry calls to the library | `OFF` | -| `VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT` | Never exceed [VkPhysicalDeviceLimits::maxMemoryAllocationCount](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#limits-maxMemoryAllocationCount) and return error | `OFF` | +For more info on using CMake visit the official [CMake documentation](https://cmake.org/cmake/help/latest/index.html). ## Building using vcpkg @@ -146,7 +146,7 @@ The VulkanMemoryAllocator port in vcpkg is kept up to date by Microsoft team mem # Binaries -The release comes with precompiled binary executable for "VulkanSample" application which contains test suite. It is compiled using Visual Studio 2019, so it requires appropriate libraries to work, including "MSVCP140.dll", "VCRUNTIME140.dll", "VCRUNTIME140_1.dll". If the launch fails with error message telling about those files missing, please download and install [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads), "x64" version. +The release comes with precompiled binary executable for "VulkanSample" application which contains test suite. It is compiled using Visual Studio 2022, so it requires appropriate libraries to work, including "MSVCP140.dll", "VCRUNTIME140.dll", "VCRUNTIME140_1.dll". If the launch fails with error message telling about those files missing, please download and install [Microsoft Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads), "X64" version. # Read more @@ -154,24 +154,30 @@ See **[Documentation](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAll # Software using this library +- **[Blender](https://www.blender.org)** +- **[Baldur's Gate III](https://www.mobygames.com/game/150689/baldurs-gate-iii/credits/windows/?autoplatform=true)** +- **[Cyberpunk 2077](https://www.mobygames.com/game/128136/cyberpunk-2077/credits/windows/?autoplatform=true)** - **[X-Plane](https://x-plane.com/)** - **[Detroit: Become Human](https://gpuopen.com/learn/porting-detroit-3/)** - **[Vulkan Samples](https://github.com/LunarG/VulkanSamples)** - official Khronos Vulkan samples. License: Apache-style. +- **[GFXReconstruct](https://github.com/LunarG/gfxreconstruct)** - a tools for the capture and replay of graphics API calls. License: MIT. - **[Anvil](https://github.com/GPUOpen-LibrariesAndSDKs/Anvil)** - cross-platform framework for Vulkan. License: MIT. - **[Filament](https://github.com/google/filament)** - physically based rendering engine for Android, Windows, Linux and macOS, from Google. Apache License 2.0. - **[Atypical Games - proprietary game engine](https://developer.samsung.com/galaxy-gamedev/gamedev-blog/infinitejet.html)** - **[Flax Engine](https://flaxengine.com/)** - **[Godot Engine](https://github.com/godotengine/godot/)** - multi-platform 2D and 3D game engine. License: MIT. - **[Lightweight Java Game Library (LWJGL)](https://www.lwjgl.org/)** - includes binding of the library for Java. License: BSD. +- **[LightweightVK](https://github.com/corporateshark/lightweightvk)** - lightweight C++ bindless Vulkan 1.3 wrapper. License: MIT. - **[PowerVR SDK](https://github.com/powervr-graphics/Native_SDK)** - C++ cross-platform 3D graphics SDK, from Imagination. License: MIT. - **[Skia](https://github.com/google/skia)** - complete 2D graphic library for drawing Text, Geometries, and Images, from Google. - **[The Forge](https://github.com/ConfettiFX/The-Forge)** - cross-platform rendering framework. Apache License 2.0. -- **[VK9](https://github.com/disks86/VK9)** - Direct3D 9 compatibility layer using Vulkan. Zlib lincese. +- **[VK9](https://github.com/disks86/VK9)** - Direct3D 9 compatibility layer using Vulkan. Zlib license. - **[vkDOOM3](https://github.com/DustinHLand/vkDOOM3)** - Vulkan port of GPL DOOM 3 BFG Edition. License: GNU GPL. - **[vkQuake2](https://github.com/kondrak/vkQuake2)** - vanilla Quake 2 with Vulkan support. License: GNU GPL. - **[Vulkan Best Practice for Mobile Developers](https://github.com/ARM-software/vulkan_best_practice_for_mobile_developers)** from ARM. License: MIT. - **[RPCS3](https://github.com/RPCS3/rpcs3)** - PlayStation 3 emulator/debugger. License: GNU GPLv2. - **[PPSSPP](https://github.com/hrydgard/ppsspp)** - Playstation Portable emulator/debugger. License: GNU GPLv2+. +- **[Wicked Engine](https://github.com/turanszkij/WickedEngine)** - 3D engine with modern graphics [Many other projects on GitHub](https://github.com/search?q=AMD_VULKAN_MEMORY_ALLOCATOR_H&type=Code) and some game development studios that use Vulkan in their games. @@ -180,7 +186,7 @@ See **[Documentation](https://gpuopen-librariesandsdks.github.io/VulkanMemoryAll - **[D3D12 Memory Allocator](https://github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator)** - equivalent library for Direct3D 12. License: MIT. - **[Awesome Vulkan](https://github.com/vinjn/awesome-vulkan)** - a curated list of awesome Vulkan libraries, debuggers and resources. - **[vcpkg](https://github.com/Microsoft/vcpkg)** dependency manager from Microsoft also offers a port of this library. -- **[VulkanMemoryAllocator-Hpp](https://github.com/malte-v/VulkanMemoryAllocator-Hpp)** - C++ binding for this library. License: CC0-1.0. +- **[VulkanMemoryAllocator-Hpp](https://github.com/YaaZ/VulkanMemoryAllocator-Hpp)** - C++ binding for this library. License: CC0-1.0. - **[PyVMA](https://github.com/realitix/pyvma)** - Python wrapper for this library. Author: Jean-Sébastien B. (@realitix). License: Apache 2.0. - **[vk-mem](https://github.com/gwihlidal/vk-mem-rs)** - Rust binding for this library. Author: Graham Wihlidal. License: Apache 2.0 or MIT. - **[Haskell bindings](https://hackage.haskell.org/package/VulkanMemoryAllocator)**, **[github](https://github.com/expipiplus1/vulkan/tree/master/VulkanMemoryAllocator)** - Haskell bindings for this library. Author: Ellie Hermaszewska (@expipiplus1). License BSD-3-Clause. diff --git a/deps/VulkanMemoryAllocator/include/vk_mem_alloc.h b/deps/VulkanMemoryAllocator/include/vk_mem_alloc.h index a258656..2307325 100644 --- a/deps/VulkanMemoryAllocator/include/vk_mem_alloc.h +++ b/deps/VulkanMemoryAllocator/include/vk_mem_alloc.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -25,14 +25,17 @@ /** \mainpage Vulkan Memory Allocator -Version 3.1.0-development +Version 3.1.0 -Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. \n -License: MIT +Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. \n +License: MIT \n +See also: [product page on GPUOpen](https://gpuopen.com/gaming-product/vulkan-memory-allocator/), +[repository on GitHub](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) -API documentation divided into groups: [Modules](modules.html) -\section main_table_of_contents Table of contents +API documentation divided into groups: [Topics](topics.html) + +General documentation chapters: - User guide - \subpage quick_start @@ -46,6 +49,7 @@ License: MIT - [Custom memory pools](@ref choosing_memory_type_custom_memory_pools) - [Dedicated allocations](@ref choosing_memory_type_dedicated_allocations) - \subpage memory_mapping + - [Copy functions](@ref memory_mapping_copy_functions) - [Mapping functions](@ref memory_mapping_mapping_functions) - [Persistently mapped memory](@ref memory_mapping_persistently_mapped_memory) - [Cache flush and invalidate](@ref memory_mapping_cache_control) @@ -55,6 +59,7 @@ License: MIT - \subpage resource_aliasing - \subpage custom_memory_pools - [Choosing memory type index](@ref custom_memory_pools_MemTypeIndex) + - [When not to use custom pools](@ref custom_memory_pools_when_not_use) - [Linear allocation algorithm](@ref linear_algorithm) - [Free-at-once](@ref linear_algorithm_free_at_once) - [Stack](@ref linear_algorithm_stack) @@ -72,7 +77,8 @@ License: MIT - [Memory initialization](@ref debugging_memory_usage_initialization) - [Margins](@ref debugging_memory_usage_margins) - [Corruption detection](@ref debugging_memory_usage_corruption_detection) - - \subpage opengl_interop + - [Leak detection features](@ref debugging_memory_usage_leak_detection) + - \subpage other_api_interop - \subpage usage_patterns - [GPU-only resource](@ref usage_patterns_gpu_only) - [Staging copy for upload](@ref usage_patterns_staging_copy_upload) @@ -96,11 +102,6 @@ License: MIT - [Allocation algorithm](@ref general_considerations_allocation_algorithm) - [Features not supported](@ref general_considerations_features_not_supported) -\section main_see_also See also - -- [**Product page on GPUOpen**](https://gpuopen.com/gaming-product/vulkan-memory-allocator/) -- [**Source repository on GitHub**](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) - \defgroup group_init Library initialization \brief API elements related to the initialization and management of the entire library, especially #VmaAllocator object. @@ -126,9 +127,7 @@ See documentation chapter: \ref statistics. extern "C" { #endif -#ifndef VULKAN_H_ - #include -#endif +#include #if !defined(VMA_VULKAN_VERSION) #if defined(VK_VERSION_1_3) @@ -213,6 +212,25 @@ extern "C" { #endif #endif +// Defined to 1 when VK_KHR_maintenance4 device extension is defined in Vulkan headers. +#if !defined(VMA_KHR_MAINTENANCE4) + #if VK_KHR_maintenance4 + #define VMA_KHR_MAINTENANCE4 1 + #else + #define VMA_KHR_MAINTENANCE4 0 + #endif +#endif + +// Defined to 1 when VK_KHR_maintenance5 device extension is defined in Vulkan headers. +#if !defined(VMA_KHR_MAINTENANCE5) + #if VK_KHR_maintenance5 + #define VMA_KHR_MAINTENANCE5 1 + #else + #define VMA_KHR_MAINTENANCE5 0 + #endif +#endif + + // Defined to 1 when VK_KHR_external_memory device extension is defined in Vulkan headers. #if !defined(VMA_EXTERNAL_MEMORY) #if VK_KHR_external_memory @@ -234,6 +252,12 @@ extern "C" { #define VMA_CALL_POST #endif +// Define this macro to decorate pNext pointers with an attribute specifying the Vulkan +// structure that will be extended via the pNext chain. +#ifndef VMA_EXTENDS_VK_STRUCT + #define VMA_EXTENDS_VK_STRUCT(vkStruct) +#endif + // Define this macro to decorate pointers with an attribute specifying the // length of the array they point to if they are not null. // @@ -420,6 +444,20 @@ typedef enum VmaAllocatorCreateFlagBits For more details, see the documentation of the VK_EXT_memory_priority extension. */ VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT = 0x00000040, + /** + Enables usage of VK_KHR_maintenance4 extension in the library. + + You may set this flag only if you found available and enabled this device extension, + while creating Vulkan device passed as VmaAllocatorCreateInfo::device. + */ + VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT = 0x00000080, + /** + Enables usage of VK_KHR_maintenance5 extension in the library. + + You should set this flag if you found available and enabled this device extension, + while creating Vulkan device passed as VmaAllocatorCreateInfo::device. + */ + VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT = 0x00000100, VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VmaAllocatorCreateFlagBits; @@ -521,6 +559,9 @@ typedef enum VmaAllocationCreateFlagBits /** \brief Set this flag if the allocation should have its own memory block. Use it for special, big resources, like fullscreen images used as attachments. + + If you use this flag while creating a buffer or an image, `VkMemoryDedicatedAllocateInfo` + structure is applied if possible. */ VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 0x00000001, @@ -602,7 +643,7 @@ typedef enum VmaAllocationCreateFlagBits This includes allocations created in \ref custom_memory_pools. Declares that mapped memory can be read, written, and accessed in random order, - so a `HOST_CACHED` memory type is required. + so a `HOST_CACHED` memory type is preferred. */ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT = 0x00000800, /** @@ -983,13 +1024,14 @@ typedef struct VmaVulkanFunctions PFN_vkBindImageMemory2KHR VMA_NULLABLE vkBindImageMemory2KHR; #endif #if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000 + /// Fetch from "vkGetPhysicalDeviceMemoryProperties2" on Vulkan >= 1.1, but you can also fetch it from "vkGetPhysicalDeviceMemoryProperties2KHR" if you enabled extension VK_KHR_get_physical_device_properties2. PFN_vkGetPhysicalDeviceMemoryProperties2KHR VMA_NULLABLE vkGetPhysicalDeviceMemoryProperties2KHR; #endif -#if VMA_VULKAN_VERSION >= 1003000 +#if VMA_KHR_MAINTENANCE4 || VMA_VULKAN_VERSION >= 1003000 /// Fetch from "vkGetDeviceBufferMemoryRequirements" on Vulkan >= 1.3, but you can also fetch it from "vkGetDeviceBufferMemoryRequirementsKHR" if you enabled extension VK_KHR_maintenance4. - PFN_vkGetDeviceBufferMemoryRequirements VMA_NULLABLE vkGetDeviceBufferMemoryRequirements; + PFN_vkGetDeviceBufferMemoryRequirementsKHR VMA_NULLABLE vkGetDeviceBufferMemoryRequirements; /// Fetch from "vkGetDeviceImageMemoryRequirements" on Vulkan >= 1.3, but you can also fetch it from "vkGetDeviceImageMemoryRequirementsKHR" if you enabled extension VK_KHR_maintenance4. - PFN_vkGetDeviceImageMemoryRequirements VMA_NULLABLE vkGetDeviceImageMemoryRequirements; + PFN_vkGetDeviceImageMemoryRequirementsKHR VMA_NULLABLE vkGetDeviceImageMemoryRequirements; #endif } VmaVulkanFunctions; @@ -1049,13 +1091,15 @@ typedef struct VmaAllocatorCreateInfo Starting from version 3.0.0 this member is no longer optional, it must be set! */ VkInstance VMA_NOT_NULL instance; - /** \brief Optional. The highest version of Vulkan that the application is designed to use. + /** \brief Optional. Vulkan version that the application uses. It must be a value in the format as created by macro `VK_MAKE_VERSION` or a constant like: `VK_API_VERSION_1_1`, `VK_API_VERSION_1_0`. The patch version number specified is ignored. Only the major and minor versions are considered. - It must be less or equal (preferably equal) to value as passed to `vkCreateInstance` as `VkApplicationInfo::apiVersion`. Only versions 1.0, 1.1, 1.2, 1.3 are supported by the current implementation. Leaving it initialized to zero is equivalent to `VK_API_VERSION_1_0`. + It must match the Vulkan version used by the application and supported on the selected physical device, + so it must be no higher than `VkApplicationInfo::apiVersion` passed to `vkCreateInstance` + and no higher than `VkPhysicalDeviceProperties::apiVersion` found on the physical device used. */ uint32_t vulkanApiVersion; #if VMA_EXTERNAL_MEMORY @@ -1319,7 +1363,7 @@ typedef struct VmaPoolCreateInfo Please note that some structures, e.g. `VkMemoryPriorityAllocateInfoEXT`, `VkMemoryDedicatedAllocateInfoKHR`, can be attached automatically by this library when using other, more convenient of its features. */ - void* VMA_NULLABLE pMemoryAllocateNext; + void* VMA_NULLABLE VMA_EXTENDS_VK_STRUCT(VkMemoryAllocateInfo) pMemoryAllocateNext; } VmaPoolCreateInfo; /** @} */ @@ -1329,7 +1373,11 @@ typedef struct VmaPoolCreateInfo @{ */ -/// Parameters of #VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo(). +/** +Parameters of #VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo(). + +There is also an extended version of this structure that carries additional parameters: #VmaAllocationInfo2. +*/ typedef struct VmaAllocationInfo { /** \brief Memory type index that this allocation was allocated from. @@ -1389,6 +1437,33 @@ typedef struct VmaAllocationInfo const char* VMA_NULLABLE pName; } VmaAllocationInfo; +/// Extended parameters of a #VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2(). +typedef struct VmaAllocationInfo2 +{ + /** \brief Basic parameters of the allocation. + + If you need only these, you can use function vmaGetAllocationInfo() and structure #VmaAllocationInfo instead. + */ + VmaAllocationInfo allocationInfo; + /** \brief Size of the `VkDeviceMemory` block that the allocation belongs to. + + In case of an allocation with dedicated memory, it will be equal to `allocationInfo.size`. + */ + VkDeviceSize blockSize; + /** \brief `VK_TRUE` if the allocation has dedicated memory, `VK_FALSE` if it was placed as part of a larger memory block. + + When `VK_TRUE`, it also means `VkMemoryDedicatedAllocateInfo` was used when creating the allocation + (if VK_KHR_dedicated_allocation extension or Vulkan version >= 1.1 is enabled). + */ + VkBool32 dedicatedMemory; +} VmaAllocationInfo2; + +/** Callback function called during vmaBeginDefragmentation() to check custom criterion about ending current defragmentation pass. + +Should return true if the defragmentation needs to stop current pass. +*/ +typedef VkBool32 (VKAPI_PTR* PFN_vmaCheckDefragmentationBreakFunction)(void* VMA_NULLABLE pUserData); + /** \brief Parameters for defragmentation. To be used with function vmaBeginDefragmentation(). @@ -1412,6 +1487,13 @@ typedef struct VmaDefragmentationInfo `0` means no limit. */ uint32_t maxAllocationsPerPass; + /** \brief Optional custom callback for stopping vmaBeginDefragmentation(). + + Have to return true for breaking current defragmentation pass. + */ + PFN_vmaCheckDefragmentationBreakFunction VMA_NULLABLE pfnBreakCallback; + /// \brief Optional data to pass to custom callback for stopping pass of defragmentation. + void* VMA_NULLABLE pBreakCallbackUserData; } VmaDefragmentationInfo; /// Single move of an allocation to be done for defragmentation. @@ -1912,12 +1994,27 @@ you should avoid calling it too often. You can retrieve same VmaAllocationInfo structure while creating your resource, from function vmaCreateBuffer(), vmaCreateImage(). You can remember it if you are sure parameters don't change (e.g. due to defragmentation). + +There is also a new function vmaGetAllocationInfo2() that offers extended information +about the allocation, returned using new structure #VmaAllocationInfo2. */ VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo( VmaAllocator VMA_NOT_NULL allocator, VmaAllocation VMA_NOT_NULL allocation, VmaAllocationInfo* VMA_NOT_NULL pAllocationInfo); +/** \brief Returns extended information about specified allocation. + +Current parameters of given allocation are returned in `pAllocationInfo`. +Extended parameters in structure #VmaAllocationInfo2 include memory block size +and a flag telling whether the allocation has dedicated memory. +It can be useful e.g. for interop with OpenGL. +*/ +VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo2( + VmaAllocator VMA_NOT_NULL allocator, + VmaAllocation VMA_NOT_NULL allocation, + VmaAllocationInfo2* VMA_NOT_NULL pAllocationInfo); + /** \brief Sets pUserData in given allocation to new value. The value of pointer `pUserData` is copied to allocation's `pUserData`. @@ -2069,7 +2166,7 @@ For more information, see documentation of vmaFlushAllocation(). \param allocator \param allocationCount \param allocations -\param offsets If not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all ofsets are zero. +\param offsets If not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all offsets are zero. \param sizes If not null, it must point to an array of sizes of regions to flush in respective allocations. Null means `VK_WHOLE_SIZE` for all allocations. This function returns the `VkResult` from `vkFlushMappedMemoryRanges` if it is @@ -2090,7 +2187,7 @@ For more information, see documentation of vmaInvalidateAllocation(). \param allocator \param allocationCount \param allocations -\param offsets If not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all ofsets are zero. +\param offsets If not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all offsets are zero. \param sizes If not null, it must point to an array of sizes of regions to flush in respective allocations. Null means `VK_WHOLE_SIZE` for all allocations. This function returns the `VkResult` from `vkInvalidateMappedMemoryRanges` if it is @@ -2103,6 +2200,61 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocations( const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) offsets, const VkDeviceSize* VMA_NULLABLE VMA_LEN_IF_NOT_NULL(allocationCount) sizes); +/** \brief Maps the allocation temporarily if needed, copies data from specified host pointer to it, and flushes the memory from the host caches if needed. + +\param allocator +\param pSrcHostPointer Pointer to the host data that become source of the copy. +\param dstAllocation Handle to the allocation that becomes destination of the copy. +\param dstAllocationLocalOffset Offset within `dstAllocation` where to write copied data, in bytes. +\param size Number of bytes to copy. + +This is a convenience function that allows to copy data from a host pointer to an allocation easily. +Same behavior can be achieved by calling vmaMapMemory(), `memcpy()`, vmaUnmapMemory(), vmaFlushAllocation(). + +This function can be called only for allocations created in a memory type that has `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` flag. +It can be ensured e.g. by using #VMA_MEMORY_USAGE_AUTO and #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or +#VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. +Otherwise, the function will fail and generate a Validation Layers error. + +`dstAllocationLocalOffset` is relative to the contents of given `dstAllocation`. +If you mean whole allocation, you should pass 0. +Do not pass allocation's offset within device memory block this parameter! +*/ +VMA_CALL_PRE VkResult VMA_CALL_POST vmaCopyMemoryToAllocation( + VmaAllocator VMA_NOT_NULL allocator, + const void* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(size) pSrcHostPointer, + VmaAllocation VMA_NOT_NULL dstAllocation, + VkDeviceSize dstAllocationLocalOffset, + VkDeviceSize size); + +/** \brief Invalidates memory in the host caches if needed, maps the allocation temporarily if needed, and copies data from it to a specified host pointer. + +\param allocator +\param srcAllocation Handle to the allocation that becomes source of the copy. +\param srcAllocationLocalOffset Offset within `srcAllocation` where to read copied data, in bytes. +\param pDstHostPointer Pointer to the host memory that become destination of the copy. +\param size Number of bytes to copy. + +This is a convenience function that allows to copy data from an allocation to a host pointer easily. +Same behavior can be achieved by calling vmaInvalidateAllocation(), vmaMapMemory(), `memcpy()`, vmaUnmapMemory(). + +This function should be called only for allocations created in a memory type that has `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` +and `VK_MEMORY_PROPERTY_HOST_CACHED_BIT` flag. +It can be ensured e.g. by using #VMA_MEMORY_USAGE_AUTO and #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. +Otherwise, the function may fail and generate a Validation Layers error. +It may also work very slowly when reading from an uncached memory. + +`srcAllocationLocalOffset` is relative to the contents of given `srcAllocation`. +If you mean whole allocation, you should pass 0. +Do not pass allocation's offset within device memory block as this parameter! +*/ +VMA_CALL_PRE VkResult VMA_CALL_POST vmaCopyAllocationToMemory( + VmaAllocator VMA_NOT_NULL allocator, + VmaAllocation VMA_NOT_NULL srcAllocation, + VkDeviceSize srcAllocationLocalOffset, + void* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL(size) pDstHostPointer, + VkDeviceSize size); + /** \brief Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions. \param allocator @@ -2227,7 +2379,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory2( VmaAllocation VMA_NOT_NULL allocation, VkDeviceSize allocationLocalOffset, VkBuffer VMA_NOT_NULL_NON_DISPATCHABLE buffer, - const void* VMA_NULLABLE pNext); + const void* VMA_NULLABLE VMA_EXTENDS_VK_STRUCT(VkBindBufferMemoryInfoKHR) pNext); /** \brief Binds image to allocation. @@ -2264,7 +2416,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory2( VmaAllocation VMA_NOT_NULL allocation, VkDeviceSize allocationLocalOffset, VkImage VMA_NOT_NULL_NON_DISPATCHABLE image, - const void* VMA_NULLABLE pNext); + const void* VMA_NULLABLE VMA_EXTENDS_VK_STRUCT(VkBindImageMemoryInfoKHR) pNext); /** \brief Creates a new `VkBuffer`, allocates and binds memory for it. @@ -2604,14 +2756,23 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( #include #include #include +#include #include #include +#if !defined(VMA_CPP20) + #if __cplusplus >= 202002L || _MSVC_LANG >= 202002L // C++20 + #define VMA_CPP20 1 + #else + #define VMA_CPP20 0 + #endif +#endif + #ifdef _MSC_VER #include // For functions like __popcnt, _BitScanForward etc. #endif -#if __cplusplus >= 202002L || _MSVC_LANG >= 202002L // C++20 - #include // For std::popcount +#if VMA_CPP20 + #include #endif #if VMA_STATS_STRING_ENABLED @@ -2651,8 +2812,7 @@ VmaAllocatorCreateInfo::pVulkanFunctions. Other members can be null. #endif #ifndef VMA_USE_STL_SHARED_MUTEX - // Compiler conforms to C++17. - #if __cplusplus >= 201703L + #if __cplusplus >= 201703L || _MSVC_LANG >= 201703L // C++17 #define VMA_USE_STL_SHARED_MUTEX 1 // Visual studio defines __cplusplus properly only when passed additional parameter: /Zc:__cplusplus // Otherwise it is always 199711L, despite shared_mutex works since Visual Studio 2015 Update 2. @@ -2686,7 +2846,7 @@ remove them if not needed. */ #if !defined(VMA_CONFIGURATION_USER_INCLUDES_H) #include // for assert - #include // for min, max + #include // for min, max, swap #include #else #include VMA_CONFIGURATION_USER_INCLUDES_H @@ -2697,6 +2857,14 @@ remove them if not needed. #define VMA_NULL nullptr #endif +#ifndef VMA_FALLTHROUGH + #if __cplusplus >= 201703L || _MSVC_LANG >= 201703L // C++17 + #define VMA_FALLTHROUGH [[fallthrough]] + #else + #define VMA_FALLTHROUGH + #endif +#endif + // Normal assert to check for programmer's errors, especially in Debug configuration. #ifndef VMA_ASSERT #ifdef NDEBUG @@ -2716,6 +2884,11 @@ remove them if not needed. #endif #endif +// Assert used for reporting memory leaks - unfreed allocations. +#ifndef VMA_ASSERT_LEAK + #define VMA_ASSERT_LEAK(expr) VMA_ASSERT(expr) +#endif + // If your compiler is not compatible with C++17 and definition of // aligned_alloc() function is missing, uncommenting following line may help: @@ -2773,7 +2946,7 @@ static void* vma_aligned_alloc(size_t alignment, size_t size) { return _aligned_malloc(size, alignment); } -#elif __cplusplus >= 201703L // Compiler conforms to C++17. +#elif __cplusplus >= 201703L || _MSVC_LANG >= 201703L // C++17 static void* vma_aligned_alloc(size_t alignment, size_t size) { return aligned_alloc(alignment, size); @@ -2799,7 +2972,7 @@ static void vma_aligned_free(void* VMA_NULLABLE ptr) #endif #ifndef VMA_ALIGN_OF - #define VMA_ALIGN_OF(type) (__alignof(type)) + #define VMA_ALIGN_OF(type) (alignof(type)) #endif #ifndef VMA_SYSTEM_ALIGNED_MALLOC @@ -2838,10 +3011,6 @@ static void vma_aligned_free(void* VMA_NULLABLE ptr) #define VMA_MAX(v1, v2) ((std::max)((v1), (v2))) #endif -#ifndef VMA_SWAP - #define VMA_SWAP(v1, v2) std::swap((v1), (v2)) -#endif - #ifndef VMA_SORT #define VMA_SORT(beg, end, cmp) std::sort(beg, end, cmp) #endif @@ -2860,15 +3029,34 @@ static void vma_aligned_free(void* VMA_NULLABLE ptr) #define VMA_DEBUG_LOG(str) VMA_DEBUG_LOG_FORMAT("%s", (str)) #endif +#ifndef VMA_LEAK_LOG_FORMAT + #define VMA_LEAK_LOG_FORMAT(format, ...) VMA_DEBUG_LOG_FORMAT(format, __VA_ARGS__) +#endif + +#ifndef VMA_CLASS_NO_COPY + #define VMA_CLASS_NO_COPY(className) \ + private: \ + className(const className&) = delete; \ + className& operator=(const className&) = delete; +#endif +#ifndef VMA_CLASS_NO_COPY_NO_MOVE + #define VMA_CLASS_NO_COPY_NO_MOVE(className) \ + private: \ + className(const className&) = delete; \ + className(className&&) = delete; \ + className& operator=(const className&) = delete; \ + className& operator=(className&&) = delete; +#endif + // Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString. #if VMA_STATS_STRING_ENABLED static inline void VmaUint32ToStr(char* VMA_NOT_NULL outStr, size_t strLen, uint32_t num) { - snprintf(outStr, strLen, "%u", static_cast(num)); + snprintf(outStr, strLen, "%" PRIu32, num); } static inline void VmaUint64ToStr(char* VMA_NOT_NULL outStr, size_t strLen, uint64_t num) { - snprintf(outStr, strLen, "%llu", static_cast(num)); + snprintf(outStr, strLen, "%" PRIu64, num); } static inline void VmaPtrToStr(char* VMA_NOT_NULL outStr, size_t strLen, const void* ptr) { @@ -2879,7 +3067,9 @@ static void vma_aligned_free(void* VMA_NULLABLE ptr) #ifndef VMA_MUTEX class VmaMutex { + VMA_CLASS_NO_COPY_NO_MOVE(VmaMutex) public: + VmaMutex() { } void Lock() { m_Mutex.lock(); } void Unlock() { m_Mutex.unlock(); } bool TryLock() { return m_Mutex.try_lock(); } @@ -3045,13 +3235,6 @@ tools like RenderDoc. #define VMA_MAPPING_HYSTERESIS_ENABLED 1 #endif -#ifndef VMA_CLASS_NO_COPY - #define VMA_CLASS_NO_COPY(className) \ - private: \ - className(const className&) = delete; \ - className& operator=(const className&) = delete; -#endif - #define VMA_VALIDATE(cond) do { if(!(cond)) { \ VMA_ASSERT(0 && "Validation failed: " #cond); \ return false; \ @@ -3134,7 +3317,7 @@ enum class VmaAllocationRequestType #ifndef _VMA_FORWARD_DECLARATIONS // Opaque handle used by allocation algorithms to identify single allocation in any conforming way. -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VmaAllocHandle) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VmaAllocHandle); struct VmaMutexLock; struct VmaMutexLockRead; @@ -3167,17 +3350,6 @@ class VmaList; template class VmaIntrusiveLinkedList; -// Unused in this version -#if 0 -template -struct VmaPair; -template -struct VmaPairFirstLess; - -template -class VmaMap; -#endif - #if VMA_STATS_STRING_ENABLED class VmaStringBuilder; class VmaJsonWriter; @@ -3217,7 +3389,7 @@ class VmaAllocationObjectAllocator; /* Returns number of bits set to 1 in (v). -On specific platforms and compilers you can use instrinsics like: +On specific platforms and compilers you can use intrinsics like: Visual Studio: return __popcnt(v); @@ -3229,7 +3401,7 @@ But you need to check in runtime whether user's CPU supports these, as some old */ static inline uint32_t VmaCountBitsSet(uint32_t v) { -#if __cplusplus >= 202002L || _MSVC_LANG >= 202002L // C++20 +#if VMA_CPP20 return std::popcount(v); #else uint32_t c = v - ((v >> 1) & 0x55555555); @@ -3248,6 +3420,10 @@ static inline uint8_t VmaBitScanLSB(uint64_t mask) if (_BitScanForward64(&pos, mask)) return static_cast(pos); return UINT8_MAX; +#elif VMA_CPP20 + if(mask) + return static_cast(std::countr_zero(mask)); + return UINT8_MAX; #elif defined __GNUC__ || defined __clang__ return static_cast(__builtin_ffsll(mask)) - 1U; #else @@ -3270,6 +3446,10 @@ static inline uint8_t VmaBitScanLSB(uint32_t mask) if (_BitScanForward(&pos, mask)) return static_cast(pos); return UINT8_MAX; +#elif VMA_CPP20 + if(mask) + return static_cast(std::countr_zero(mask)); + return UINT8_MAX; #elif defined __GNUC__ || defined __clang__ return static_cast(__builtin_ffs(mask)) - 1U; #else @@ -3291,6 +3471,9 @@ static inline uint8_t VmaBitScanMSB(uint64_t mask) unsigned long pos; if (_BitScanReverse64(&pos, mask)) return static_cast(pos); +#elif VMA_CPP20 + if(mask) + return 63 - static_cast(std::countl_zero(mask)); #elif defined __GNUC__ || defined __clang__ if (mask) return 63 - static_cast(__builtin_clzll(mask)); @@ -3313,6 +3496,9 @@ static inline uint8_t VmaBitScanMSB(uint32_t mask) unsigned long pos; if (_BitScanReverse(&pos, mask)) return static_cast(pos); +#elif VMA_CPP20 + if(mask) + return 31 - static_cast(std::countl_zero(mask)); #elif defined __GNUC__ || defined __clang__ if (mask) return 31 - static_cast(__builtin_clz(mask)); @@ -3460,7 +3646,7 @@ static inline bool VmaIsBufferImageGranularityConflict( { if (suballocType1 > suballocType2) { - VMA_SWAP(suballocType1, suballocType2); + std::swap(suballocType1, suballocType2); } switch (suballocType1) @@ -3544,7 +3730,7 @@ new element with value (key) should be inserted. template static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT& key, const CmpLess& cmp) { - size_t down = 0, up = (end - beg); + size_t down = 0, up = size_t(end - beg); while (down < up) { const size_t mid = down + (up - down) / 2; // Overflow-safe midpoint calculation @@ -3605,13 +3791,95 @@ static inline void VmaPnextChainPushFront(MainT* mainStruct, NewT* newStruct) newStruct->pNext = mainStruct->pNext; mainStruct->pNext = newStruct; } +// Finds structure with s->sType == sType in mainStruct->pNext chain. +// Returns pointer to it. If not found, returns null. +template +static inline const FindT* VmaPnextChainFind(const MainT* mainStruct, VkStructureType sType) +{ + for(const VkBaseInStructure* s = (const VkBaseInStructure*)mainStruct->pNext; + s != VMA_NULL; s = s->pNext) + { + if(s->sType == sType) + { + return (const FindT*)s; + } + } + return VMA_NULL; +} + +// An abstraction over buffer or image `usage` flags, depending on available extensions. +struct VmaBufferImageUsage +{ +#if VMA_KHR_MAINTENANCE5 + typedef uint64_t BaseType; // VkFlags64 +#else + typedef uint32_t BaseType; // VkFlags32 +#endif + + static const VmaBufferImageUsage UNKNOWN; + + BaseType Value; + + VmaBufferImageUsage() { *this = UNKNOWN; } + explicit VmaBufferImageUsage(BaseType usage) : Value(usage) { } + VmaBufferImageUsage(const VkBufferCreateInfo &createInfo, bool useKhrMaintenance5); + explicit VmaBufferImageUsage(const VkImageCreateInfo &createInfo); + + bool operator==(const VmaBufferImageUsage& rhs) const { return Value == rhs.Value; } + bool operator!=(const VmaBufferImageUsage& rhs) const { return Value != rhs.Value; } + + bool Contains(BaseType flag) const { return (Value & flag) != 0; } + bool ContainsDeviceAccess() const + { + // This relies on values of VK_IMAGE_USAGE_TRANSFER* being the same as VK_BUFFER_IMAGE_TRANSFER*. + return (Value & ~BaseType(VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT)) != 0; + } +}; + +const VmaBufferImageUsage VmaBufferImageUsage::UNKNOWN = VmaBufferImageUsage(0); + +static void swap(VmaBufferImageUsage& lhs, VmaBufferImageUsage& rhs) noexcept +{ + using std::swap; + swap(lhs.Value, rhs.Value); +} + +VmaBufferImageUsage::VmaBufferImageUsage(const VkBufferCreateInfo &createInfo, + bool useKhrMaintenance5) +{ +#if VMA_KHR_MAINTENANCE5 + if(useKhrMaintenance5) + { + // If VkBufferCreateInfo::pNext chain contains VkBufferUsageFlags2CreateInfoKHR, + // take usage from it and ignore VkBufferCreateInfo::usage, per specification + // of the VK_KHR_maintenance5 extension. + const VkBufferUsageFlags2CreateInfoKHR* const usageFlags2 = + VmaPnextChainFind(&createInfo, VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR); + if(usageFlags2) + { + this->Value = usageFlags2->usage; + return; + } + } +#endif + + this->Value = (BaseType)createInfo.usage; +} + +VmaBufferImageUsage::VmaBufferImageUsage(const VkImageCreateInfo &createInfo) +{ + // Maybe in the future there will be VK_KHR_maintenanceN extension with structure + // VkImageUsageFlags2CreateInfoKHR, like the one for buffers... + + this->Value = (BaseType)createInfo.usage; +} // This is the main algorithm that guides the selection of a memory type best for an allocation - // converts usage to required/preferred/not preferred flags. static bool FindMemoryPreferences( bool isIntegratedGPU, const VmaAllocationCreateInfo& allocCreateInfo, - VkFlags bufImgUsage, // VkBufferCreateInfo::usage or VkImageCreateInfo::usage. UINT32_MAX if unknown. + VmaBufferImageUsage bufImgUsage, VkMemoryPropertyFlags& outRequiredFlags, VkMemoryPropertyFlags& outPreferredFlags, VkMemoryPropertyFlags& outNotPreferredFlags) @@ -3654,13 +3922,14 @@ static bool FindMemoryPreferences( case VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE: case VMA_MEMORY_USAGE_AUTO_PREFER_HOST: { - if(bufImgUsage == UINT32_MAX) + if(bufImgUsage == VmaBufferImageUsage::UNKNOWN) { - VMA_ASSERT(0 && "VMA_MEMORY_USAGE_AUTO* values can only be used with functions like vmaCreateBuffer, vmaCreateImage so that the details of the created resource are known."); + VMA_ASSERT(0 && "VMA_MEMORY_USAGE_AUTO* values can only be used with functions like vmaCreateBuffer, vmaCreateImage so that the details of the created resource are known." + " Maybe you use VkBufferUsageFlags2CreateInfoKHR but forgot to use VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT?" ); return false; } - // This relies on values of VK_IMAGE_USAGE_TRANSFER* being the same VK_BUFFER_IMAGE_TRANSFER*. - const bool deviceAccess = (bufImgUsage & ~(VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT)) != 0; + + const bool deviceAccess = bufImgUsage.ContainsDeviceAccess(); const bool hostAccessSequentialWrite = (allocCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT) != 0; const bool hostAccessRandom = (allocCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT) != 0; const bool hostAccessAllowTransferInstead = (allocCreateInfo.flags & VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT) != 0; @@ -3670,18 +3939,21 @@ static bool FindMemoryPreferences( // CPU random access - e.g. a buffer written to or transferred from GPU to read back on CPU. if(hostAccessRandom) { - if(!isIntegratedGPU && deviceAccess && hostAccessAllowTransferInstead && !preferHost) + // Prefer cached. Cannot require it, because some platforms don't have it (e.g. Raspberry Pi - see #362)! + outPreferredFlags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + + if (!isIntegratedGPU && deviceAccess && hostAccessAllowTransferInstead && !preferHost) { // Nice if it will end up in HOST_VISIBLE, but more importantly prefer DEVICE_LOCAL. // Omitting HOST_VISIBLE here is intentional. // In case there is DEVICE_LOCAL | HOST_VISIBLE | HOST_CACHED, it will pick that one. // Otherwise, this will give same weight to DEVICE_LOCAL as HOST_VISIBLE | HOST_CACHED and select the former if occurs first on the list. - outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; } else { - // Always CPU memory, cached. - outRequiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + // Always CPU memory. + outRequiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; } } // CPU sequential write - may be CPU or host-visible GPU memory, uncached and write-combined. @@ -3720,19 +3992,18 @@ static bool FindMemoryPreferences( // No CPU access else { - // GPU access, no CPU access (e.g. a color attachment image) - prefer GPU memory - if(deviceAccess) - { - // ...unless there is a clear preference from the user not to do so. - if(preferHost) - outNotPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; - else - outPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; - } + // if(deviceAccess) + // + // GPU access, no CPU access (e.g. a color attachment image) - prefer GPU memory, + // unless there is a clear preference from the user not to do so. + // + // else: + // // No direct GPU access, no CPU access, just transfers. // It may be staging copy intended for e.g. preserving image for next frame (then better GPU memory) or // a "swap file" copy to free some GPU memory (then better CPU memory). // Up to the user to decide. If no preferece, assume the former and choose GPU memory. + if(preferHost) outNotPreferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; else @@ -3951,7 +4222,7 @@ static void VmaAddDetailedStatistics(VmaDetailedStatistics& inoutStats, const Vm // Helper RAII class to lock a mutex in constructor and unlock it in destructor (at the end of scope). struct VmaMutexLock { - VMA_CLASS_NO_COPY(VmaMutexLock) + VMA_CLASS_NO_COPY_NO_MOVE(VmaMutexLock) public: VmaMutexLock(VMA_MUTEX& mutex, bool useMutex = true) : m_pMutex(useMutex ? &mutex : VMA_NULL) @@ -3967,7 +4238,7 @@ struct VmaMutexLock // Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for reading. struct VmaMutexLockRead { - VMA_CLASS_NO_COPY(VmaMutexLockRead) + VMA_CLASS_NO_COPY_NO_MOVE(VmaMutexLockRead) public: VmaMutexLockRead(VMA_RW_MUTEX& mutex, bool useMutex) : m_pMutex(useMutex ? &mutex : VMA_NULL) @@ -3983,7 +4254,7 @@ struct VmaMutexLockRead // Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for writing. struct VmaMutexLockWrite { - VMA_CLASS_NO_COPY(VmaMutexLockWrite) + VMA_CLASS_NO_COPY_NO_MOVE(VmaMutexLockWrite) public: VmaMutexLockWrite(VMA_RW_MUTEX& mutex, bool useMutex) : m_pMutex(useMutex ? &mutex : VMA_NULL) @@ -4018,7 +4289,7 @@ struct AtomicTransactionalIncrement --(*m_Atomic); } - void Commit() { m_Atomic = nullptr; } + void Commit() { m_Atomic = VMA_NULL; } T Increment(AtomicT* atomic) { m_Atomic = atomic; @@ -4026,7 +4297,7 @@ struct AtomicTransactionalIncrement } private: - AtomicT* m_Atomic = nullptr; + AtomicT* m_Atomic = VMA_NULL; }; #endif // _VMA_ATOMIC_TRANSACTIONAL_INCREMENT @@ -4438,7 +4709,7 @@ allocator can create multiple blocks. template class VmaPoolAllocator { - VMA_CLASS_NO_COPY(VmaPoolAllocator) + VMA_CLASS_NO_COPY_NO_MOVE(VmaPoolAllocator) public: VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity); ~VmaPoolAllocator(); @@ -4571,7 +4842,7 @@ struct VmaListItem template class VmaRawList { - VMA_CLASS_NO_COPY(VmaRawList) + VMA_CLASS_NO_COPY_NO_MOVE(VmaRawList) public: typedef VmaListItem ItemType; @@ -4834,7 +5105,7 @@ VmaListItem* VmaRawList::InsertAfter(ItemType* pItem, const T& value) template class VmaList { - VMA_CLASS_NO_COPY(VmaList) + VMA_CLASS_NO_COPY_NO_MOVE(VmaList) public: class reverse_iterator; class const_iterator; @@ -5293,99 +5564,6 @@ void VmaIntrusiveLinkedList::RemoveAll() #endif // _VMA_INTRUSIVE_LINKED_LIST_FUNCTIONS #endif // _VMA_INTRUSIVE_LINKED_LIST -// Unused in this version. -#if 0 - -#ifndef _VMA_PAIR -template -struct VmaPair -{ - T1 first; - T2 second; - - VmaPair() : first(), second() {} - VmaPair(const T1& firstSrc, const T2& secondSrc) : first(firstSrc), second(secondSrc) {} -}; - -template -struct VmaPairFirstLess -{ - bool operator()(const VmaPair& lhs, const VmaPair& rhs) const - { - return lhs.first < rhs.first; - } - bool operator()(const VmaPair& lhs, const FirstT& rhsFirst) const - { - return lhs.first < rhsFirst; - } -}; -#endif // _VMA_PAIR - -#ifndef _VMA_MAP -/* Class compatible with subset of interface of std::unordered_map. -KeyT, ValueT must be POD because they will be stored in VmaVector. -*/ -template -class VmaMap -{ -public: - typedef VmaPair PairType; - typedef PairType* iterator; - - VmaMap(const VmaStlAllocator& allocator) : m_Vector(allocator) {} - - iterator begin() { return m_Vector.begin(); } - iterator end() { return m_Vector.end(); } - size_t size() { return m_Vector.size(); } - - void insert(const PairType& pair); - iterator find(const KeyT& key); - void erase(iterator it); - -private: - VmaVector< PairType, VmaStlAllocator> m_Vector; -}; - -#ifndef _VMA_MAP_FUNCTIONS -template -void VmaMap::insert(const PairType& pair) -{ - const size_t indexToInsert = VmaBinaryFindFirstNotLess( - m_Vector.data(), - m_Vector.data() + m_Vector.size(), - pair, - VmaPairFirstLess()) - m_Vector.data(); - VmaVectorInsert(m_Vector, indexToInsert, pair); -} - -template -VmaPair* VmaMap::find(const KeyT& key) -{ - PairType* it = VmaBinaryFindFirstNotLess( - m_Vector.data(), - m_Vector.data() + m_Vector.size(), - key, - VmaPairFirstLess()); - if ((it != m_Vector.end()) && (it->first == key)) - { - return it; - } - else - { - return m_Vector.end(); - } -} - -template -void VmaMap::erase(iterator it) -{ - VmaVectorRemove(m_Vector, it - m_Vector.begin()); -} -#endif // _VMA_MAP_FUNCTIONS -#endif // _VMA_MAP - -#endif // #if 0 - #if !defined(_VMA_STRING_BUILDER) && VMA_STATS_STRING_ENABLED class VmaStringBuilder { @@ -5426,7 +5604,7 @@ void VmaStringBuilder::AddNumber(uint32_t num) char* p = &buf[10]; do { - *--p = '0' + (num % 10); + *--p = '0' + (char)(num % 10); num /= 10; } while (num); Add(p); @@ -5439,7 +5617,7 @@ void VmaStringBuilder::AddNumber(uint64_t num) char* p = &buf[20]; do { - *--p = '0' + (num % 10); + *--p = '0' + (char)(num % 10); num /= 10; } while (num); Add(p); @@ -5461,7 +5639,7 @@ VmaStringBuilder passed to the constructor. */ class VmaJsonWriter { - VMA_CLASS_NO_COPY(VmaJsonWriter) + VMA_CLASS_NO_COPY_NO_MOVE(VmaJsonWriter) public: // sb - string builder to write the document to. Must remain alive for the whole lifetime of this object. VmaJsonWriter(const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb); @@ -5630,7 +5808,7 @@ void VmaJsonWriter::ContinueString(const char* pStr) { m_SB.Add("\\\""); } - else if (ch >= 32) + else if ((uint8_t)ch >= 32) { m_SB.Add(ch); } @@ -5653,7 +5831,6 @@ void VmaJsonWriter::ContinueString(const char* pStr) break; default: VMA_ASSERT(0 && "Character not currently supported."); - break; } } } @@ -5800,7 +5977,7 @@ static void VmaPrintDetailedStatistics(VmaJsonWriter& json, const VmaDetailedSta class VmaMappingHysteresis { - VMA_CLASS_NO_COPY(VmaMappingHysteresis) + VMA_CLASS_NO_COPY_NO_MOVE(VmaMappingHysteresis) public: VmaMappingHysteresis() = default; @@ -5907,7 +6084,7 @@ Thread-safety: */ class VmaDeviceMemoryBlock { - VMA_CLASS_NO_COPY(VmaDeviceMemoryBlock) + VMA_CLASS_NO_COPY_NO_MOVE(VmaDeviceMemoryBlock) public: VmaBlockMetadata* m_pMetadata; @@ -6049,9 +6226,17 @@ struct VmaAllocation_T void DedicatedAllocUnmap(VmaAllocator hAllocator); #if VMA_STATS_STRING_ENABLED - uint32_t GetBufferImageUsage() const { return m_BufferImageUsage; } - - void InitBufferImageUsage(uint32_t bufferImageUsage); + VmaBufferImageUsage GetBufferImageUsage() const { return m_BufferImageUsage; } + void InitBufferUsage(const VkBufferCreateInfo &createInfo, bool useKhrMaintenance5) + { + VMA_ASSERT(m_BufferImageUsage == VmaBufferImageUsage::UNKNOWN); + m_BufferImageUsage = VmaBufferImageUsage(createInfo, useKhrMaintenance5); + } + void InitImageUsage(const VkImageCreateInfo &createInfo) + { + VMA_ASSERT(m_BufferImageUsage == VmaBufferImageUsage::UNKNOWN); + m_BufferImageUsage = VmaBufferImageUsage(createInfo); + } void PrintParameters(class VmaJsonWriter& json) const; #endif @@ -6090,7 +6275,7 @@ struct VmaAllocation_T uint8_t m_MapCount; uint8_t m_Flags; // enum FLAGS #if VMA_STATS_STRING_ENABLED - uint32_t m_BufferImageUsage; // 0 if unknown. + VmaBufferImageUsage m_BufferImageUsage; // 0 if unknown. #endif }; #endif // _VMA_ALLOCATION_T @@ -6130,6 +6315,7 @@ Thread-safe, synchronized internally. */ class VmaDedicatedAllocationList { + VMA_CLASS_NO_COPY_NO_MOVE(VmaDedicatedAllocationList) public: VmaDedicatedAllocationList() {} ~VmaDedicatedAllocationList(); @@ -6164,7 +6350,7 @@ VmaDedicatedAllocationList::~VmaDedicatedAllocationList() if (!m_AllocationList.IsEmpty()) { - VMA_ASSERT(false && "Unfreed dedicated allocations found!"); + VMA_ASSERT_LEAK(false && "Unfreed dedicated allocations found!"); } } @@ -6185,7 +6371,7 @@ bool VmaDedicatedAllocationList::Validate() void VmaDedicatedAllocationList::AddDetailedStatistics(VmaDetailedStatistics& inoutStats) { - for(auto* item = m_AllocationList.Front(); item != nullptr; item = DedicatedAllocationLinkedList::GetNext(item)) + for(auto* item = m_AllocationList.Front(); item != VMA_NULL; item = DedicatedAllocationLinkedList::GetNext(item)) { const VkDeviceSize size = item->GetSize(); inoutStats.statistics.blockCount++; @@ -6202,7 +6388,7 @@ void VmaDedicatedAllocationList::AddStatistics(VmaStatistics& inoutStats) inoutStats.blockCount += allocCount; inoutStats.allocationCount += allocCount; - for(auto* item = m_AllocationList.Front(); item != nullptr; item = DedicatedAllocationLinkedList::GetNext(item)) + for(auto* item = m_AllocationList.Front(); item != VMA_NULL; item = DedicatedAllocationLinkedList::GetNext(item)) { const VkDeviceSize size = item->GetSize(); inoutStats.blockBytes += size; @@ -6315,6 +6501,7 @@ in a single VkDeviceMemory block. */ class VmaBlockMetadata { + VMA_CLASS_NO_COPY_NO_MOVE(VmaBlockMetadata) public: // pAllocationCallbacks, if not null, must be owned externally - alive and unchanged for the whole lifetime of this object. VmaBlockMetadata(const VkAllocationCallbacks* pAllocationCallbacks, @@ -6381,7 +6568,7 @@ class VmaBlockMetadata protected: const VkAllocationCallbacks* GetAllocationCallbacks() const { return m_pAllocationCallbacks; } VkDeviceSize GetBufferImageGranularity() const { return m_BufferImageGranularity; } - VkDeviceSize GetDebugMargin() const { return IsVirtual() ? 0 : VMA_DEBUG_MARGIN; } + VkDeviceSize GetDebugMargin() const { return VkDeviceSize(IsVirtual() ? 0 : VMA_DEBUG_MARGIN); } void DebugLogAllocation(VkDeviceSize offset, VkDeviceSize size, void* userData) const; #if VMA_STATS_STRING_ENABLED @@ -6417,7 +6604,7 @@ void VmaBlockMetadata::DebugLogAllocation(VkDeviceSize offset, VkDeviceSize size { if (IsVirtual()) { - VMA_DEBUG_LOG_FORMAT("UNFREED VIRTUAL ALLOCATION; Offset: %llu; Size: %llu; UserData: %p", offset, size, userData); + VMA_LEAK_LOG_FORMAT("UNFREED VIRTUAL ALLOCATION; Offset: %" PRIu64 "; Size: %" PRIu64 "; UserData: %p", offset, size, userData); } else { @@ -6428,14 +6615,14 @@ void VmaBlockMetadata::DebugLogAllocation(VkDeviceSize offset, VkDeviceSize size const char* name = allocation->GetName(); #if VMA_STATS_STRING_ENABLED - VMA_DEBUG_LOG_FORMAT("UNFREED ALLOCATION; Offset: %llu; Size: %llu; UserData: %p; Name: %s; Type: %s; Usage: %u", + VMA_LEAK_LOG_FORMAT("UNFREED ALLOCATION; Offset: %" PRIu64 "; Size: %" PRIu64 "; UserData: %p; Name: %s; Type: %s; Usage: %" PRIu64, offset, size, userData, name ? name : "vma_empty", VMA_SUBALLOCATION_TYPE_NAMES[allocation->GetSuballocationType()], - allocation->GetBufferImageUsage()); + (uint64_t)allocation->GetBufferImageUsage().Value); #else - VMA_DEBUG_LOG_FORMAT("UNFREED ALLOCATION; Offset: %llu; Size: %llu; UserData: %p; Name: %s; Type: %u", + VMA_LEAK_LOG_FORMAT("UNFREED ALLOCATION; Offset: %" PRIu64 "; Size: %" PRIu64 "; UserData: %p; Name: %s; Type: %u", offset, size, userData, name ? name : "vma_empty", - (uint32_t)allocation->GetSuballocationType()); + (unsigned)allocation->GetSuballocationType()); #endif // VMA_STATS_STRING_ENABLED } @@ -6749,1260 +6936,496 @@ void VmaBlockBufferImageGranularity::AllocPage(RegionInfo& page, uint8_t allocTy #endif // _VMA_BLOCK_BUFFER_IMAGE_GRANULARITY_FUNCTIONS #endif // _VMA_BLOCK_BUFFER_IMAGE_GRANULARITY -#if 0 -#ifndef _VMA_BLOCK_METADATA_GENERIC -class VmaBlockMetadata_Generic : public VmaBlockMetadata -{ - friend class VmaDefragmentationAlgorithm_Generic; - friend class VmaDefragmentationAlgorithm_Fast; - VMA_CLASS_NO_COPY(VmaBlockMetadata_Generic) -public: - VmaBlockMetadata_Generic(const VkAllocationCallbacks* pAllocationCallbacks, - VkDeviceSize bufferImageGranularity, bool isVirtual); - virtual ~VmaBlockMetadata_Generic() = default; - - size_t GetAllocationCount() const override { return m_Suballocations.size() - m_FreeCount; } - VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize; } - bool IsEmpty() const override { return (m_Suballocations.size() == 1) && (m_FreeCount == 1); } - void Free(VmaAllocHandle allocHandle) override { FreeSuballocation(FindAtOffset((VkDeviceSize)allocHandle - 1)); } - VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; } +#ifndef _VMA_BLOCK_METADATA_LINEAR +/* +Allocations and their references in internal data structure look like this: - void Init(VkDeviceSize size) override; - bool Validate() const override; +if(m_2ndVectorMode == SECOND_VECTOR_EMPTY): - void AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const override; - void AddStatistics(VmaStatistics& inoutStats) const override; + 0 +-------+ + | | + | | + | | + +-------+ + | Alloc | 1st[m_1stNullItemsBeginCount] + +-------+ + | Alloc | 1st[m_1stNullItemsBeginCount + 1] + +-------+ + | ... | + +-------+ + | Alloc | 1st[1st.size() - 1] + +-------+ + | | + | | + | | +GetSize() +-------+ -#if VMA_STATS_STRING_ENABLED - void PrintDetailedMap(class VmaJsonWriter& json, uint32_t mapRefCount) const override; -#endif +if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER): - bool CreateAllocationRequest( - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - bool upperAddress, - VmaSuballocationType allocType, - uint32_t strategy, - VmaAllocationRequest* pAllocationRequest) override; + 0 +-------+ + | Alloc | 2nd[0] + +-------+ + | Alloc | 2nd[1] + +-------+ + | ... | + +-------+ + | Alloc | 2nd[2nd.size() - 1] + +-------+ + | | + | | + | | + +-------+ + | Alloc | 1st[m_1stNullItemsBeginCount] + +-------+ + | Alloc | 1st[m_1stNullItemsBeginCount + 1] + +-------+ + | ... | + +-------+ + | Alloc | 1st[1st.size() - 1] + +-------+ + | | +GetSize() +-------+ - VkResult CheckCorruption(const void* pBlockData) override; +if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK): + + 0 +-------+ + | | + | | + | | + +-------+ + | Alloc | 1st[m_1stNullItemsBeginCount] + +-------+ + | Alloc | 1st[m_1stNullItemsBeginCount + 1] + +-------+ + | ... | + +-------+ + | Alloc | 1st[1st.size() - 1] + +-------+ + | | + | | + | | + +-------+ + | Alloc | 2nd[2nd.size() - 1] + +-------+ + | ... | + +-------+ + | Alloc | 2nd[1] + +-------+ + | Alloc | 2nd[0] +GetSize() +-------+ + +*/ +class VmaBlockMetadata_Linear : public VmaBlockMetadata +{ + VMA_CLASS_NO_COPY_NO_MOVE(VmaBlockMetadata_Linear) +public: + VmaBlockMetadata_Linear(const VkAllocationCallbacks* pAllocationCallbacks, + VkDeviceSize bufferImageGranularity, bool isVirtual); + virtual ~VmaBlockMetadata_Linear() = default; + + VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize; } + bool IsEmpty() const override { return GetAllocationCount() == 0; } + VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; } + + void Init(VkDeviceSize size) override; + bool Validate() const override; + size_t GetAllocationCount() const override; + size_t GetFreeRegionsCount() const override; + + void AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const override; + void AddStatistics(VmaStatistics& inoutStats) const override; + +#if VMA_STATS_STRING_ENABLED + void PrintDetailedMap(class VmaJsonWriter& json) const override; +#endif + + bool CreateAllocationRequest( + VkDeviceSize allocSize, + VkDeviceSize allocAlignment, + bool upperAddress, + VmaSuballocationType allocType, + uint32_t strategy, + VmaAllocationRequest* pAllocationRequest) override; + + VkResult CheckCorruption(const void* pBlockData) override; void Alloc( const VmaAllocationRequest& request, VmaSuballocationType type, void* userData) override; + void Free(VmaAllocHandle allocHandle) override; void GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) override; void* GetAllocationUserData(VmaAllocHandle allocHandle) const override; VmaAllocHandle GetAllocationListBegin() const override; VmaAllocHandle GetNextAllocation(VmaAllocHandle prevAlloc) const override; + VkDeviceSize GetNextFreeRegionSize(VmaAllocHandle alloc) const override; void Clear() override; void SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) override; void DebugLogAllAllocations() const override; private: - uint32_t m_FreeCount; + /* + There are two suballocation vectors, used in ping-pong way. + The one with index m_1stVectorIndex is called 1st. + The one with index (m_1stVectorIndex ^ 1) is called 2nd. + 2nd can be non-empty only when 1st is not empty. + When 2nd is not empty, m_2ndVectorMode indicates its mode of operation. + */ + typedef VmaVector> SuballocationVectorType; + + enum SECOND_VECTOR_MODE + { + SECOND_VECTOR_EMPTY, + /* + Suballocations in 2nd vector are created later than the ones in 1st, but they + all have smaller offset. + */ + SECOND_VECTOR_RING_BUFFER, + /* + Suballocations in 2nd vector are upper side of double stack. + They all have offsets higher than those in 1st vector. + Top of this stack means smaller offsets, but higher indices in this vector. + */ + SECOND_VECTOR_DOUBLE_STACK, + }; + VkDeviceSize m_SumFreeSize; - VmaSuballocationList m_Suballocations; - // Suballocations that are free. Sorted by size, ascending. - VmaVector> m_FreeSuballocationsBySize; + SuballocationVectorType m_Suballocations0, m_Suballocations1; + uint32_t m_1stVectorIndex; + SECOND_VECTOR_MODE m_2ndVectorMode; + // Number of items in 1st vector with hAllocation = null at the beginning. + size_t m_1stNullItemsBeginCount; + // Number of other items in 1st vector with hAllocation = null somewhere in the middle. + size_t m_1stNullItemsMiddleCount; + // Number of items in 2nd vector with hAllocation = null. + size_t m_2ndNullItemsCount; - VkDeviceSize AlignAllocationSize(VkDeviceSize size) const { return IsVirtual() ? size : VmaAlignUp(size, (VkDeviceSize)16); } + SuballocationVectorType& AccessSuballocations1st() { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; } + SuballocationVectorType& AccessSuballocations2nd() { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; } + const SuballocationVectorType& AccessSuballocations1st() const { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; } + const SuballocationVectorType& AccessSuballocations2nd() const { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; } - VmaSuballocationList::iterator FindAtOffset(VkDeviceSize offset) const; - bool ValidateFreeSuballocationList() const; + VmaSuballocation& FindSuballocation(VkDeviceSize offset) const; + bool ShouldCompact1st() const; + void CleanupAfterFree(); - // Checks if requested suballocation with given parameters can be placed in given pFreeSuballocItem. - // If yes, fills pOffset and returns true. If no, returns false. - bool CheckAllocation( + bool CreateAllocationRequest_LowerAddress( VkDeviceSize allocSize, VkDeviceSize allocAlignment, VmaSuballocationType allocType, - VmaSuballocationList::const_iterator suballocItem, - VmaAllocHandle* pAllocHandle) const; - - // Given free suballocation, it merges it with following one, which must also be free. - void MergeFreeWithNext(VmaSuballocationList::iterator item); - // Releases given suballocation, making it free. - // Merges it with adjacent free suballocations if applicable. - // Returns iterator to new free suballocation at this place. - VmaSuballocationList::iterator FreeSuballocation(VmaSuballocationList::iterator suballocItem); - // Given free suballocation, it inserts it into sorted list of - // m_FreeSuballocationsBySize if it is suitable. - void RegisterFreeSuballocation(VmaSuballocationList::iterator item); - // Given free suballocation, it removes it from sorted list of - // m_FreeSuballocationsBySize if it is suitable. - void UnregisterFreeSuballocation(VmaSuballocationList::iterator item); + uint32_t strategy, + VmaAllocationRequest* pAllocationRequest); + bool CreateAllocationRequest_UpperAddress( + VkDeviceSize allocSize, + VkDeviceSize allocAlignment, + VmaSuballocationType allocType, + uint32_t strategy, + VmaAllocationRequest* pAllocationRequest); }; -#ifndef _VMA_BLOCK_METADATA_GENERIC_FUNCTIONS -VmaBlockMetadata_Generic::VmaBlockMetadata_Generic(const VkAllocationCallbacks* pAllocationCallbacks, +#ifndef _VMA_BLOCK_METADATA_LINEAR_FUNCTIONS +VmaBlockMetadata_Linear::VmaBlockMetadata_Linear(const VkAllocationCallbacks* pAllocationCallbacks, VkDeviceSize bufferImageGranularity, bool isVirtual) : VmaBlockMetadata(pAllocationCallbacks, bufferImageGranularity, isVirtual), - m_FreeCount(0), m_SumFreeSize(0), - m_Suballocations(VmaStlAllocator(pAllocationCallbacks)), - m_FreeSuballocationsBySize(VmaStlAllocator(pAllocationCallbacks)) {} + m_Suballocations0(VmaStlAllocator(pAllocationCallbacks)), + m_Suballocations1(VmaStlAllocator(pAllocationCallbacks)), + m_1stVectorIndex(0), + m_2ndVectorMode(SECOND_VECTOR_EMPTY), + m_1stNullItemsBeginCount(0), + m_1stNullItemsMiddleCount(0), + m_2ndNullItemsCount(0) {} -void VmaBlockMetadata_Generic::Init(VkDeviceSize size) +void VmaBlockMetadata_Linear::Init(VkDeviceSize size) { VmaBlockMetadata::Init(size); - - m_FreeCount = 1; m_SumFreeSize = size; - - VmaSuballocation suballoc = {}; - suballoc.offset = 0; - suballoc.size = size; - suballoc.type = VMA_SUBALLOCATION_TYPE_FREE; - - m_Suballocations.push_back(suballoc); - m_FreeSuballocationsBySize.push_back(m_Suballocations.begin()); } -bool VmaBlockMetadata_Generic::Validate() const +bool VmaBlockMetadata_Linear::Validate() const { - VMA_VALIDATE(!m_Suballocations.empty()); - - // Expected offset of new suballocation as calculated from previous ones. - VkDeviceSize calculatedOffset = 0; - // Expected number of free suballocations as calculated from traversing their list. - uint32_t calculatedFreeCount = 0; - // Expected sum size of free suballocations as calculated from traversing their list. - VkDeviceSize calculatedSumFreeSize = 0; - // Expected number of free suballocations that should be registered in - // m_FreeSuballocationsBySize calculated from traversing their list. - size_t freeSuballocationsToRegister = 0; - // True if previous visited suballocation was free. - bool prevFree = false; + const SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); - const VkDeviceSize debugMargin = GetDebugMargin(); + VMA_VALIDATE(suballocations2nd.empty() == (m_2ndVectorMode == SECOND_VECTOR_EMPTY)); + VMA_VALIDATE(!suballocations1st.empty() || + suballocations2nd.empty() || + m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER); - for (const auto& subAlloc : m_Suballocations) + if (!suballocations1st.empty()) + { + // Null item at the beginning should be accounted into m_1stNullItemsBeginCount. + VMA_VALIDATE(suballocations1st[m_1stNullItemsBeginCount].type != VMA_SUBALLOCATION_TYPE_FREE); + // Null item at the end should be just pop_back(). + VMA_VALIDATE(suballocations1st.back().type != VMA_SUBALLOCATION_TYPE_FREE); + } + if (!suballocations2nd.empty()) { - // Actual offset of this suballocation doesn't match expected one. - VMA_VALIDATE(subAlloc.offset == calculatedOffset); + // Null item at the end should be just pop_back(). + VMA_VALIDATE(suballocations2nd.back().type != VMA_SUBALLOCATION_TYPE_FREE); + } - const bool currFree = (subAlloc.type == VMA_SUBALLOCATION_TYPE_FREE); - // Two adjacent free suballocations are invalid. They should be merged. - VMA_VALIDATE(!prevFree || !currFree); + VMA_VALIDATE(m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount <= suballocations1st.size()); + VMA_VALIDATE(m_2ndNullItemsCount <= suballocations2nd.size()); - VmaAllocation alloc = (VmaAllocation)subAlloc.userData; - if (!IsVirtual()) - { - VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE)); - } + VkDeviceSize sumUsedSize = 0; + const size_t suballoc1stCount = suballocations1st.size(); + const VkDeviceSize debugMargin = GetDebugMargin(); + VkDeviceSize offset = 0; - if (currFree) + if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) + { + const size_t suballoc2ndCount = suballocations2nd.size(); + size_t nullItem2ndCount = 0; + for (size_t i = 0; i < suballoc2ndCount; ++i) { - calculatedSumFreeSize += subAlloc.size; - ++calculatedFreeCount; - ++freeSuballocationsToRegister; + const VmaSuballocation& suballoc = suballocations2nd[i]; + const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); - // Margin required between allocations - every free space must be at least that large. - VMA_VALIDATE(subAlloc.size >= debugMargin); - } - else - { + VmaAllocation const alloc = (VmaAllocation)suballoc.userData; if (!IsVirtual()) { - VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == subAlloc.offset + 1); - VMA_VALIDATE(alloc->GetSize() == subAlloc.size); + VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE)); + } + VMA_VALIDATE(suballoc.offset >= offset); + + if (!currFree) + { + if (!IsVirtual()) + { + VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == suballoc.offset + 1); + VMA_VALIDATE(alloc->GetSize() == suballoc.size); + } + sumUsedSize += suballoc.size; + } + else + { + ++nullItem2ndCount; } - // Margin required between allocations - previous allocation must be free. - VMA_VALIDATE(debugMargin == 0 || prevFree); + offset = suballoc.offset + suballoc.size + debugMargin; } - calculatedOffset += subAlloc.size; - prevFree = currFree; + VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount); } - // Number of free suballocations registered in m_FreeSuballocationsBySize doesn't - // match expected one. - VMA_VALIDATE(m_FreeSuballocationsBySize.size() == freeSuballocationsToRegister); - - VkDeviceSize lastSize = 0; - for (size_t i = 0; i < m_FreeSuballocationsBySize.size(); ++i) + for (size_t i = 0; i < m_1stNullItemsBeginCount; ++i) { - VmaSuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[i]; - - // Only free suballocations can be registered in m_FreeSuballocationsBySize. - VMA_VALIDATE(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE); - // They must be sorted by size ascending. - VMA_VALIDATE(suballocItem->size >= lastSize); - - lastSize = suballocItem->size; + const VmaSuballocation& suballoc = suballocations1st[i]; + VMA_VALIDATE(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE && + suballoc.userData == VMA_NULL); } - // Check if totals match calculated values. - VMA_VALIDATE(ValidateFreeSuballocationList()); - VMA_VALIDATE(calculatedOffset == GetSize()); - VMA_VALIDATE(calculatedSumFreeSize == m_SumFreeSize); - VMA_VALIDATE(calculatedFreeCount == m_FreeCount); - - return true; -} - -void VmaBlockMetadata_Generic::AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const -{ - const uint32_t rangeCount = (uint32_t)m_Suballocations.size(); - inoutStats.statistics.blockCount++; - inoutStats.statistics.blockBytes += GetSize(); + size_t nullItem1stCount = m_1stNullItemsBeginCount; - for (const auto& suballoc : m_Suballocations) + for (size_t i = m_1stNullItemsBeginCount; i < suballoc1stCount; ++i) { - if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE) - VmaAddDetailedStatisticsAllocation(inoutStats, suballoc.size); - else - VmaAddDetailedStatisticsUnusedRange(inoutStats, suballoc.size); - } -} - -void VmaBlockMetadata_Generic::AddStatistics(VmaStatistics& inoutStats) const -{ - inoutStats.blockCount++; - inoutStats.allocationCount += (uint32_t)m_Suballocations.size() - m_FreeCount; - inoutStats.blockBytes += GetSize(); - inoutStats.allocationBytes += GetSize() - m_SumFreeSize; -} + const VmaSuballocation& suballoc = suballocations1st[i]; + const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); -#if VMA_STATS_STRING_ENABLED -void VmaBlockMetadata_Generic::PrintDetailedMap(class VmaJsonWriter& json, uint32_t mapRefCount) const -{ - PrintDetailedMap_Begin(json, - m_SumFreeSize, // unusedBytes - m_Suballocations.size() - (size_t)m_FreeCount, // allocationCount - m_FreeCount, // unusedRangeCount - mapRefCount); + VmaAllocation const alloc = (VmaAllocation)suballoc.userData; + if (!IsVirtual()) + { + VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE)); + } + VMA_VALIDATE(suballoc.offset >= offset); + VMA_VALIDATE(i >= m_1stNullItemsBeginCount || currFree); - for (const auto& suballoc : m_Suballocations) - { - if (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE) + if (!currFree) { - PrintDetailedMap_UnusedRange(json, suballoc.offset, suballoc.size); + if (!IsVirtual()) + { + VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == suballoc.offset + 1); + VMA_VALIDATE(alloc->GetSize() == suballoc.size); + } + sumUsedSize += suballoc.size; } else { - PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.size, suballoc.userData); + ++nullItem1stCount; } + + offset = suballoc.offset + suballoc.size + debugMargin; } + VMA_VALIDATE(nullItem1stCount == m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount); - PrintDetailedMap_End(json); -} -#endif // VMA_STATS_STRING_ENABLED + if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) + { + const size_t suballoc2ndCount = suballocations2nd.size(); + size_t nullItem2ndCount = 0; + for (size_t i = suballoc2ndCount; i--; ) + { + const VmaSuballocation& suballoc = suballocations2nd[i]; + const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); -bool VmaBlockMetadata_Generic::CreateAllocationRequest( - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - bool upperAddress, - VmaSuballocationType allocType, - uint32_t strategy, - VmaAllocationRequest* pAllocationRequest) -{ - VMA_ASSERT(allocSize > 0); - VMA_ASSERT(!upperAddress); - VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE); - VMA_ASSERT(pAllocationRequest != VMA_NULL); - VMA_HEAVY_ASSERT(Validate()); - - allocSize = AlignAllocationSize(allocSize); - - pAllocationRequest->type = VmaAllocationRequestType::Normal; - pAllocationRequest->size = allocSize; - - const VkDeviceSize debugMargin = GetDebugMargin(); - - // There is not enough total free space in this block to fulfill the request: Early return. - if (m_SumFreeSize < allocSize + debugMargin) - { - return false; - } - - // New algorithm, efficiently searching freeSuballocationsBySize. - const size_t freeSuballocCount = m_FreeSuballocationsBySize.size(); - if (freeSuballocCount > 0) - { - if (strategy == 0 || - strategy == VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT) - { - // Find first free suballocation with size not less than allocSize + debugMargin. - VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess( - m_FreeSuballocationsBySize.data(), - m_FreeSuballocationsBySize.data() + freeSuballocCount, - allocSize + debugMargin, - VmaSuballocationItemSizeLess()); - size_t index = it - m_FreeSuballocationsBySize.data(); - for (; index < freeSuballocCount; ++index) + VmaAllocation const alloc = (VmaAllocation)suballoc.userData; + if (!IsVirtual()) { - if (CheckAllocation( - allocSize, - allocAlignment, - allocType, - m_FreeSuballocationsBySize[index], - &pAllocationRequest->allocHandle)) - { - pAllocationRequest->item = m_FreeSuballocationsBySize[index]; - return true; - } + VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE)); } - } - else if (strategy == VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET) - { - for (VmaSuballocationList::iterator it = m_Suballocations.begin(); - it != m_Suballocations.end(); - ++it) + VMA_VALIDATE(suballoc.offset >= offset); + + if (!currFree) { - if (it->type == VMA_SUBALLOCATION_TYPE_FREE && CheckAllocation( - allocSize, - allocAlignment, - allocType, - it, - &pAllocationRequest->allocHandle)) + if (!IsVirtual()) { - pAllocationRequest->item = it; - return true; + VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == suballoc.offset + 1); + VMA_VALIDATE(alloc->GetSize() == suballoc.size); } + sumUsedSize += suballoc.size; } - } - else - { - VMA_ASSERT(strategy & (VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT | VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT )); - // Search staring from biggest suballocations. - for (size_t index = freeSuballocCount; index--; ) + else { - if (CheckAllocation( - allocSize, - allocAlignment, - allocType, - m_FreeSuballocationsBySize[index], - &pAllocationRequest->allocHandle)) - { - pAllocationRequest->item = m_FreeSuballocationsBySize[index]; - return true; - } + ++nullItem2ndCount; } - } - } - - return false; -} -VkResult VmaBlockMetadata_Generic::CheckCorruption(const void* pBlockData) -{ - for (auto& suballoc : m_Suballocations) - { - if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE) - { - if (!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size)) - { - VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!"); - return VK_ERROR_UNKNOWN_COPY; - } + offset = suballoc.offset + suballoc.size + debugMargin; } - } - - return VK_SUCCESS; -} -void VmaBlockMetadata_Generic::Alloc( - const VmaAllocationRequest& request, - VmaSuballocationType type, - void* userData) -{ - VMA_ASSERT(request.type == VmaAllocationRequestType::Normal); - VMA_ASSERT(request.item != m_Suballocations.end()); - VmaSuballocation& suballoc = *request.item; - // Given suballocation is a free block. - VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); - - // Given offset is inside this suballocation. - VMA_ASSERT((VkDeviceSize)request.allocHandle - 1 >= suballoc.offset); - const VkDeviceSize paddingBegin = (VkDeviceSize)request.allocHandle - suballoc.offset - 1; - VMA_ASSERT(suballoc.size >= paddingBegin + request.size); - const VkDeviceSize paddingEnd = suballoc.size - paddingBegin - request.size; - - // Unregister this free suballocation from m_FreeSuballocationsBySize and update - // it to become used. - UnregisterFreeSuballocation(request.item); - - suballoc.offset = (VkDeviceSize)request.allocHandle - 1; - suballoc.size = request.size; - suballoc.type = type; - suballoc.userData = userData; - - // If there are any free bytes remaining at the end, insert new free suballocation after current one. - if (paddingEnd) - { - VmaSuballocation paddingSuballoc = {}; - paddingSuballoc.offset = suballoc.offset + suballoc.size; - paddingSuballoc.size = paddingEnd; - paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE; - VmaSuballocationList::iterator next = request.item; - ++next; - const VmaSuballocationList::iterator paddingEndItem = - m_Suballocations.insert(next, paddingSuballoc); - RegisterFreeSuballocation(paddingEndItem); + VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount); } - // If there are any free bytes remaining at the beginning, insert new free suballocation before current one. - if (paddingBegin) - { - VmaSuballocation paddingSuballoc = {}; - paddingSuballoc.offset = suballoc.offset - paddingBegin; - paddingSuballoc.size = paddingBegin; - paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE; - const VmaSuballocationList::iterator paddingBeginItem = - m_Suballocations.insert(request.item, paddingSuballoc); - RegisterFreeSuballocation(paddingBeginItem); - } + VMA_VALIDATE(offset <= GetSize()); + VMA_VALIDATE(m_SumFreeSize == GetSize() - sumUsedSize); - // Update totals. - m_FreeCount = m_FreeCount - 1; - if (paddingBegin > 0) - { - ++m_FreeCount; - } - if (paddingEnd > 0) - { - ++m_FreeCount; - } - m_SumFreeSize -= request.size; + return true; } -void VmaBlockMetadata_Generic::GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) +size_t VmaBlockMetadata_Linear::GetAllocationCount() const { - outInfo.offset = (VkDeviceSize)allocHandle - 1; - const VmaSuballocation& suballoc = *FindAtOffset(outInfo.offset); - outInfo.size = suballoc.size; - outInfo.pUserData = suballoc.userData; + return AccessSuballocations1st().size() - m_1stNullItemsBeginCount - m_1stNullItemsMiddleCount + + AccessSuballocations2nd().size() - m_2ndNullItemsCount; } -void* VmaBlockMetadata_Generic::GetAllocationUserData(VmaAllocHandle allocHandle) const +size_t VmaBlockMetadata_Linear::GetFreeRegionsCount() const { - return FindAtOffset((VkDeviceSize)allocHandle - 1)->userData; + // Function only used for defragmentation, which is disabled for this algorithm + VMA_ASSERT(0); + return SIZE_MAX; } -VmaAllocHandle VmaBlockMetadata_Generic::GetAllocationListBegin() const +void VmaBlockMetadata_Linear::AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const { - if (IsEmpty()) - return VK_NULL_HANDLE; + const VkDeviceSize size = GetSize(); + const SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + const size_t suballoc1stCount = suballocations1st.size(); + const size_t suballoc2ndCount = suballocations2nd.size(); - for (const auto& suballoc : m_Suballocations) - { - if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE) - return (VmaAllocHandle)(suballoc.offset + 1); - } - VMA_ASSERT(false && "Should contain at least 1 allocation!"); - return VK_NULL_HANDLE; -} + inoutStats.statistics.blockCount++; + inoutStats.statistics.blockBytes += size; -VmaAllocHandle VmaBlockMetadata_Generic::GetNextAllocation(VmaAllocHandle prevAlloc) const -{ - VmaSuballocationList::const_iterator prev = FindAtOffset((VkDeviceSize)prevAlloc - 1); + VkDeviceSize lastOffset = 0; - for (VmaSuballocationList::const_iterator it = ++prev; it != m_Suballocations.end(); ++it) + if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) { - if (it->type != VMA_SUBALLOCATION_TYPE_FREE) - return (VmaAllocHandle)(it->offset + 1); - } - return VK_NULL_HANDLE; -} - -void VmaBlockMetadata_Generic::Clear() -{ - const VkDeviceSize size = GetSize(); + const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset; + size_t nextAlloc2ndIndex = 0; + while (lastOffset < freeSpace2ndTo1stEnd) + { + // Find next non-null allocation or move nextAllocIndex to the end. + while (nextAlloc2ndIndex < suballoc2ndCount && + suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL) + { + ++nextAlloc2ndIndex; + } - VMA_ASSERT(IsVirtual()); - m_FreeCount = 1; - m_SumFreeSize = size; - m_Suballocations.clear(); - m_FreeSuballocationsBySize.clear(); + // Found non-null allocation. + if (nextAlloc2ndIndex < suballoc2ndCount) + { + const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex]; - VmaSuballocation suballoc = {}; - suballoc.offset = 0; - suballoc.size = size; - suballoc.type = VMA_SUBALLOCATION_TYPE_FREE; - m_Suballocations.push_back(suballoc); + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset; + VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); + } - m_FreeSuballocationsBySize.push_back(m_Suballocations.begin()); -} + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + VmaAddDetailedStatisticsAllocation(inoutStats, suballoc.size); -void VmaBlockMetadata_Generic::SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) -{ - VmaSuballocation& suballoc = *FindAtOffset((VkDeviceSize)allocHandle - 1); - suballoc.userData = userData; -} + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + ++nextAlloc2ndIndex; + } + // We are at the end. + else + { + // There is free space from lastOffset to freeSpace2ndTo1stEnd. + if (lastOffset < freeSpace2ndTo1stEnd) + { + const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset; + VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); + } -void VmaBlockMetadata_Generic::DebugLogAllAllocations() const -{ - for (const auto& suballoc : m_Suballocations) - { - if (suballoc.type != VMA_SUBALLOCATION_TYPE_FREE) - DebugLogAllocation(suballoc.offset, suballoc.size, suballoc.userData); + // End of loop. + lastOffset = freeSpace2ndTo1stEnd; + } + } } -} - -VmaSuballocationList::iterator VmaBlockMetadata_Generic::FindAtOffset(VkDeviceSize offset) const -{ - VMA_HEAVY_ASSERT(!m_Suballocations.empty()); - const VkDeviceSize last = m_Suballocations.rbegin()->offset; - if (last == offset) - return m_Suballocations.rbegin().drop_const(); - const VkDeviceSize first = m_Suballocations.begin()->offset; - if (first == offset) - return m_Suballocations.begin().drop_const(); - const size_t suballocCount = m_Suballocations.size(); - const VkDeviceSize step = (last - first + m_Suballocations.begin()->size) / suballocCount; - auto findSuballocation = [&](auto begin, auto end) -> VmaSuballocationList::iterator + size_t nextAlloc1stIndex = m_1stNullItemsBeginCount; + const VkDeviceSize freeSpace1stTo2ndEnd = + m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size; + while (lastOffset < freeSpace1stTo2ndEnd) { - for (auto suballocItem = begin; - suballocItem != end; - ++suballocItem) + // Find next non-null allocation or move nextAllocIndex to the end. + while (nextAlloc1stIndex < suballoc1stCount && + suballocations1st[nextAlloc1stIndex].userData == VMA_NULL) { - if (suballocItem->offset == offset) - return suballocItem.drop_const(); + ++nextAlloc1stIndex; } - VMA_ASSERT(false && "Not found!"); - return m_Suballocations.end().drop_const(); - }; - // If requested offset is closer to the end of range, search from the end - if (offset - first > suballocCount * step / 2) - { - return findSuballocation(m_Suballocations.rbegin(), m_Suballocations.rend()); - } - return findSuballocation(m_Suballocations.begin(), m_Suballocations.end()); -} - -bool VmaBlockMetadata_Generic::ValidateFreeSuballocationList() const -{ - VkDeviceSize lastSize = 0; - for (size_t i = 0, count = m_FreeSuballocationsBySize.size(); i < count; ++i) - { - const VmaSuballocationList::iterator it = m_FreeSuballocationsBySize[i]; - - VMA_VALIDATE(it->type == VMA_SUBALLOCATION_TYPE_FREE); - VMA_VALIDATE(it->size >= lastSize); - lastSize = it->size; - } - return true; -} - -bool VmaBlockMetadata_Generic::CheckAllocation( - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - VmaSuballocationType allocType, - VmaSuballocationList::const_iterator suballocItem, - VmaAllocHandle* pAllocHandle) const -{ - VMA_ASSERT(allocSize > 0); - VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE); - VMA_ASSERT(suballocItem != m_Suballocations.cend()); - VMA_ASSERT(pAllocHandle != VMA_NULL); - - const VkDeviceSize debugMargin = GetDebugMargin(); - const VkDeviceSize bufferImageGranularity = GetBufferImageGranularity(); - - const VmaSuballocation& suballoc = *suballocItem; - VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); - - // Size of this suballocation is too small for this request: Early return. - if (suballoc.size < allocSize) - { - return false; - } - // Start from offset equal to beginning of this suballocation. - VkDeviceSize offset = suballoc.offset + (suballocItem == m_Suballocations.cbegin() ? 0 : GetDebugMargin()); + // Found non-null allocation. + if (nextAlloc1stIndex < suballoc1stCount) + { + const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex]; - // Apply debugMargin from the end of previous alloc. - if (debugMargin > 0) - { - offset += debugMargin; - } + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset; + VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); + } - // Apply alignment. - offset = VmaAlignUp(offset, allocAlignment); + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + VmaAddDetailedStatisticsAllocation(inoutStats, suballoc.size); - // Check previous suballocations for BufferImageGranularity conflicts. - // Make bigger alignment if necessary. - if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment) - { - bool bufferImageGranularityConflict = false; - VmaSuballocationList::const_iterator prevSuballocItem = suballocItem; - while (prevSuballocItem != m_Suballocations.cbegin()) + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + ++nextAlloc1stIndex; + } + // We are at the end. + else { - --prevSuballocItem; - const VmaSuballocation& prevSuballoc = *prevSuballocItem; - if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, offset, bufferImageGranularity)) + // There is free space from lastOffset to freeSpace1stTo2ndEnd. + if (lastOffset < freeSpace1stTo2ndEnd) { - if (VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType)) - { - bufferImageGranularityConflict = true; - break; - } + const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset; + VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); } - else - // Already on previous page. - break; - } - if (bufferImageGranularityConflict) - { - offset = VmaAlignUp(offset, bufferImageGranularity); - } - } - - // Calculate padding at the beginning based on current offset. - const VkDeviceSize paddingBegin = offset - suballoc.offset; - // Fail if requested size plus margin after is bigger than size of this suballocation. - if (paddingBegin + allocSize + debugMargin > suballoc.size) - { - return false; + // End of loop. + lastOffset = freeSpace1stTo2ndEnd; + } } - // Check next suballocations for BufferImageGranularity conflicts. - // If conflict exists, allocation cannot be made here. - if (allocSize % bufferImageGranularity || offset % bufferImageGranularity) + if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) { - VmaSuballocationList::const_iterator nextSuballocItem = suballocItem; - ++nextSuballocItem; - while (nextSuballocItem != m_Suballocations.cend()) + size_t nextAlloc2ndIndex = suballocations2nd.size() - 1; + while (lastOffset < size) { - const VmaSuballocation& nextSuballoc = *nextSuballocItem; - if (VmaBlocksOnSamePage(offset, allocSize, nextSuballoc.offset, bufferImageGranularity)) + // Find next non-null allocation or move nextAllocIndex to the end. + while (nextAlloc2ndIndex != SIZE_MAX && + suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL) { - if (VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type)) - { - return false; - } - } - else - { - // Already on next page. - break; - } - ++nextSuballocItem; - } - } - - *pAllocHandle = (VmaAllocHandle)(offset + 1); - // All tests passed: Success. pAllocHandle is already filled. - return true; -} - -void VmaBlockMetadata_Generic::MergeFreeWithNext(VmaSuballocationList::iterator item) -{ - VMA_ASSERT(item != m_Suballocations.end()); - VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE); - - VmaSuballocationList::iterator nextItem = item; - ++nextItem; - VMA_ASSERT(nextItem != m_Suballocations.end()); - VMA_ASSERT(nextItem->type == VMA_SUBALLOCATION_TYPE_FREE); - - item->size += nextItem->size; - --m_FreeCount; - m_Suballocations.erase(nextItem); -} - -VmaSuballocationList::iterator VmaBlockMetadata_Generic::FreeSuballocation(VmaSuballocationList::iterator suballocItem) -{ - // Change this suballocation to be marked as free. - VmaSuballocation& suballoc = *suballocItem; - suballoc.type = VMA_SUBALLOCATION_TYPE_FREE; - suballoc.userData = VMA_NULL; - - // Update totals. - ++m_FreeCount; - m_SumFreeSize += suballoc.size; - - // Merge with previous and/or next suballocation if it's also free. - bool mergeWithNext = false; - bool mergeWithPrev = false; - - VmaSuballocationList::iterator nextItem = suballocItem; - ++nextItem; - if ((nextItem != m_Suballocations.end()) && (nextItem->type == VMA_SUBALLOCATION_TYPE_FREE)) - { - mergeWithNext = true; - } - - VmaSuballocationList::iterator prevItem = suballocItem; - if (suballocItem != m_Suballocations.begin()) - { - --prevItem; - if (prevItem->type == VMA_SUBALLOCATION_TYPE_FREE) - { - mergeWithPrev = true; - } - } - - if (mergeWithNext) - { - UnregisterFreeSuballocation(nextItem); - MergeFreeWithNext(suballocItem); - } - - if (mergeWithPrev) - { - UnregisterFreeSuballocation(prevItem); - MergeFreeWithNext(prevItem); - RegisterFreeSuballocation(prevItem); - return prevItem; - } - else - { - RegisterFreeSuballocation(suballocItem); - return suballocItem; - } -} - -void VmaBlockMetadata_Generic::RegisterFreeSuballocation(VmaSuballocationList::iterator item) -{ - VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE); - VMA_ASSERT(item->size > 0); - - // You may want to enable this validation at the beginning or at the end of - // this function, depending on what do you want to check. - VMA_HEAVY_ASSERT(ValidateFreeSuballocationList()); - - if (m_FreeSuballocationsBySize.empty()) - { - m_FreeSuballocationsBySize.push_back(item); - } - else - { - VmaVectorInsertSorted(m_FreeSuballocationsBySize, item); - } - - //VMA_HEAVY_ASSERT(ValidateFreeSuballocationList()); -} - -void VmaBlockMetadata_Generic::UnregisterFreeSuballocation(VmaSuballocationList::iterator item) -{ - VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE); - VMA_ASSERT(item->size > 0); - - // You may want to enable this validation at the beginning or at the end of - // this function, depending on what do you want to check. - VMA_HEAVY_ASSERT(ValidateFreeSuballocationList()); - - VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess( - m_FreeSuballocationsBySize.data(), - m_FreeSuballocationsBySize.data() + m_FreeSuballocationsBySize.size(), - item, - VmaSuballocationItemSizeLess()); - for (size_t index = it - m_FreeSuballocationsBySize.data(); - index < m_FreeSuballocationsBySize.size(); - ++index) - { - if (m_FreeSuballocationsBySize[index] == item) - { - VmaVectorRemove(m_FreeSuballocationsBySize, index); - return; - } - VMA_ASSERT((m_FreeSuballocationsBySize[index]->size == item->size) && "Not found."); - } - VMA_ASSERT(0 && "Not found."); - - //VMA_HEAVY_ASSERT(ValidateFreeSuballocationList()); -} -#endif // _VMA_BLOCK_METADATA_GENERIC_FUNCTIONS -#endif // _VMA_BLOCK_METADATA_GENERIC -#endif // #if 0 - -#ifndef _VMA_BLOCK_METADATA_LINEAR -/* -Allocations and their references in internal data structure look like this: - -if(m_2ndVectorMode == SECOND_VECTOR_EMPTY): - - 0 +-------+ - | | - | | - | | - +-------+ - | Alloc | 1st[m_1stNullItemsBeginCount] - +-------+ - | Alloc | 1st[m_1stNullItemsBeginCount + 1] - +-------+ - | ... | - +-------+ - | Alloc | 1st[1st.size() - 1] - +-------+ - | | - | | - | | -GetSize() +-------+ - -if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER): - - 0 +-------+ - | Alloc | 2nd[0] - +-------+ - | Alloc | 2nd[1] - +-------+ - | ... | - +-------+ - | Alloc | 2nd[2nd.size() - 1] - +-------+ - | | - | | - | | - +-------+ - | Alloc | 1st[m_1stNullItemsBeginCount] - +-------+ - | Alloc | 1st[m_1stNullItemsBeginCount + 1] - +-------+ - | ... | - +-------+ - | Alloc | 1st[1st.size() - 1] - +-------+ - | | -GetSize() +-------+ - -if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK): - - 0 +-------+ - | | - | | - | | - +-------+ - | Alloc | 1st[m_1stNullItemsBeginCount] - +-------+ - | Alloc | 1st[m_1stNullItemsBeginCount + 1] - +-------+ - | ... | - +-------+ - | Alloc | 1st[1st.size() - 1] - +-------+ - | | - | | - | | - +-------+ - | Alloc | 2nd[2nd.size() - 1] - +-------+ - | ... | - +-------+ - | Alloc | 2nd[1] - +-------+ - | Alloc | 2nd[0] -GetSize() +-------+ - -*/ -class VmaBlockMetadata_Linear : public VmaBlockMetadata -{ - VMA_CLASS_NO_COPY(VmaBlockMetadata_Linear) -public: - VmaBlockMetadata_Linear(const VkAllocationCallbacks* pAllocationCallbacks, - VkDeviceSize bufferImageGranularity, bool isVirtual); - virtual ~VmaBlockMetadata_Linear() = default; - - VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize; } - bool IsEmpty() const override { return GetAllocationCount() == 0; } - VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; } - - void Init(VkDeviceSize size) override; - bool Validate() const override; - size_t GetAllocationCount() const override; - size_t GetFreeRegionsCount() const override; - - void AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const override; - void AddStatistics(VmaStatistics& inoutStats) const override; - -#if VMA_STATS_STRING_ENABLED - void PrintDetailedMap(class VmaJsonWriter& json) const override; -#endif - - bool CreateAllocationRequest( - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - bool upperAddress, - VmaSuballocationType allocType, - uint32_t strategy, - VmaAllocationRequest* pAllocationRequest) override; - - VkResult CheckCorruption(const void* pBlockData) override; - - void Alloc( - const VmaAllocationRequest& request, - VmaSuballocationType type, - void* userData) override; - - void Free(VmaAllocHandle allocHandle) override; - void GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) override; - void* GetAllocationUserData(VmaAllocHandle allocHandle) const override; - VmaAllocHandle GetAllocationListBegin() const override; - VmaAllocHandle GetNextAllocation(VmaAllocHandle prevAlloc) const override; - VkDeviceSize GetNextFreeRegionSize(VmaAllocHandle alloc) const override; - void Clear() override; - void SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) override; - void DebugLogAllAllocations() const override; - -private: - /* - There are two suballocation vectors, used in ping-pong way. - The one with index m_1stVectorIndex is called 1st. - The one with index (m_1stVectorIndex ^ 1) is called 2nd. - 2nd can be non-empty only when 1st is not empty. - When 2nd is not empty, m_2ndVectorMode indicates its mode of operation. - */ - typedef VmaVector> SuballocationVectorType; - - enum SECOND_VECTOR_MODE - { - SECOND_VECTOR_EMPTY, - /* - Suballocations in 2nd vector are created later than the ones in 1st, but they - all have smaller offset. - */ - SECOND_VECTOR_RING_BUFFER, - /* - Suballocations in 2nd vector are upper side of double stack. - They all have offsets higher than those in 1st vector. - Top of this stack means smaller offsets, but higher indices in this vector. - */ - SECOND_VECTOR_DOUBLE_STACK, - }; - - VkDeviceSize m_SumFreeSize; - SuballocationVectorType m_Suballocations0, m_Suballocations1; - uint32_t m_1stVectorIndex; - SECOND_VECTOR_MODE m_2ndVectorMode; - // Number of items in 1st vector with hAllocation = null at the beginning. - size_t m_1stNullItemsBeginCount; - // Number of other items in 1st vector with hAllocation = null somewhere in the middle. - size_t m_1stNullItemsMiddleCount; - // Number of items in 2nd vector with hAllocation = null. - size_t m_2ndNullItemsCount; - - SuballocationVectorType& AccessSuballocations1st() { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; } - SuballocationVectorType& AccessSuballocations2nd() { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; } - const SuballocationVectorType& AccessSuballocations1st() const { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; } - const SuballocationVectorType& AccessSuballocations2nd() const { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; } - - VmaSuballocation& FindSuballocation(VkDeviceSize offset) const; - bool ShouldCompact1st() const; - void CleanupAfterFree(); - - bool CreateAllocationRequest_LowerAddress( - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - VmaSuballocationType allocType, - uint32_t strategy, - VmaAllocationRequest* pAllocationRequest); - bool CreateAllocationRequest_UpperAddress( - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - VmaSuballocationType allocType, - uint32_t strategy, - VmaAllocationRequest* pAllocationRequest); -}; - -#ifndef _VMA_BLOCK_METADATA_LINEAR_FUNCTIONS -VmaBlockMetadata_Linear::VmaBlockMetadata_Linear(const VkAllocationCallbacks* pAllocationCallbacks, - VkDeviceSize bufferImageGranularity, bool isVirtual) - : VmaBlockMetadata(pAllocationCallbacks, bufferImageGranularity, isVirtual), - m_SumFreeSize(0), - m_Suballocations0(VmaStlAllocator(pAllocationCallbacks)), - m_Suballocations1(VmaStlAllocator(pAllocationCallbacks)), - m_1stVectorIndex(0), - m_2ndVectorMode(SECOND_VECTOR_EMPTY), - m_1stNullItemsBeginCount(0), - m_1stNullItemsMiddleCount(0), - m_2ndNullItemsCount(0) {} - -void VmaBlockMetadata_Linear::Init(VkDeviceSize size) -{ - VmaBlockMetadata::Init(size); - m_SumFreeSize = size; -} - -bool VmaBlockMetadata_Linear::Validate() const -{ - const SuballocationVectorType& suballocations1st = AccessSuballocations1st(); - const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); - - VMA_VALIDATE(suballocations2nd.empty() == (m_2ndVectorMode == SECOND_VECTOR_EMPTY)); - VMA_VALIDATE(!suballocations1st.empty() || - suballocations2nd.empty() || - m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER); - - if (!suballocations1st.empty()) - { - // Null item at the beginning should be accounted into m_1stNullItemsBeginCount. - VMA_VALIDATE(suballocations1st[m_1stNullItemsBeginCount].type != VMA_SUBALLOCATION_TYPE_FREE); - // Null item at the end should be just pop_back(). - VMA_VALIDATE(suballocations1st.back().type != VMA_SUBALLOCATION_TYPE_FREE); - } - if (!suballocations2nd.empty()) - { - // Null item at the end should be just pop_back(). - VMA_VALIDATE(suballocations2nd.back().type != VMA_SUBALLOCATION_TYPE_FREE); - } - - VMA_VALIDATE(m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount <= suballocations1st.size()); - VMA_VALIDATE(m_2ndNullItemsCount <= suballocations2nd.size()); - - VkDeviceSize sumUsedSize = 0; - const size_t suballoc1stCount = suballocations1st.size(); - const VkDeviceSize debugMargin = GetDebugMargin(); - VkDeviceSize offset = 0; - - if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) - { - const size_t suballoc2ndCount = suballocations2nd.size(); - size_t nullItem2ndCount = 0; - for (size_t i = 0; i < suballoc2ndCount; ++i) - { - const VmaSuballocation& suballoc = suballocations2nd[i]; - const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); - - VmaAllocation const alloc = (VmaAllocation)suballoc.userData; - if (!IsVirtual()) - { - VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE)); - } - VMA_VALIDATE(suballoc.offset >= offset); - - if (!currFree) - { - if (!IsVirtual()) - { - VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == suballoc.offset + 1); - VMA_VALIDATE(alloc->GetSize() == suballoc.size); - } - sumUsedSize += suballoc.size; - } - else - { - ++nullItem2ndCount; - } - - offset = suballoc.offset + suballoc.size + debugMargin; - } - - VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount); - } - - for (size_t i = 0; i < m_1stNullItemsBeginCount; ++i) - { - const VmaSuballocation& suballoc = suballocations1st[i]; - VMA_VALIDATE(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE && - suballoc.userData == VMA_NULL); - } - - size_t nullItem1stCount = m_1stNullItemsBeginCount; - - for (size_t i = m_1stNullItemsBeginCount; i < suballoc1stCount; ++i) - { - const VmaSuballocation& suballoc = suballocations1st[i]; - const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); - - VmaAllocation const alloc = (VmaAllocation)suballoc.userData; - if (!IsVirtual()) - { - VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE)); - } - VMA_VALIDATE(suballoc.offset >= offset); - VMA_VALIDATE(i >= m_1stNullItemsBeginCount || currFree); - - if (!currFree) - { - if (!IsVirtual()) - { - VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == suballoc.offset + 1); - VMA_VALIDATE(alloc->GetSize() == suballoc.size); - } - sumUsedSize += suballoc.size; - } - else - { - ++nullItem1stCount; - } - - offset = suballoc.offset + suballoc.size + debugMargin; - } - VMA_VALIDATE(nullItem1stCount == m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount); - - if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) - { - const size_t suballoc2ndCount = suballocations2nd.size(); - size_t nullItem2ndCount = 0; - for (size_t i = suballoc2ndCount; i--; ) - { - const VmaSuballocation& suballoc = suballocations2nd[i]; - const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE); - - VmaAllocation const alloc = (VmaAllocation)suballoc.userData; - if (!IsVirtual()) - { - VMA_VALIDATE(currFree == (alloc == VK_NULL_HANDLE)); - } - VMA_VALIDATE(suballoc.offset >= offset); - - if (!currFree) - { - if (!IsVirtual()) - { - VMA_VALIDATE((VkDeviceSize)alloc->GetAllocHandle() == suballoc.offset + 1); - VMA_VALIDATE(alloc->GetSize() == suballoc.size); - } - sumUsedSize += suballoc.size; - } - else - { - ++nullItem2ndCount; - } - - offset = suballoc.offset + suballoc.size + debugMargin; - } - - VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount); - } - - VMA_VALIDATE(offset <= GetSize()); - VMA_VALIDATE(m_SumFreeSize == GetSize() - sumUsedSize); - - return true; -} - -size_t VmaBlockMetadata_Linear::GetAllocationCount() const -{ - return AccessSuballocations1st().size() - m_1stNullItemsBeginCount - m_1stNullItemsMiddleCount + - AccessSuballocations2nd().size() - m_2ndNullItemsCount; -} - -size_t VmaBlockMetadata_Linear::GetFreeRegionsCount() const -{ - // Function only used for defragmentation, which is disabled for this algorithm - VMA_ASSERT(0); - return SIZE_MAX; -} - -void VmaBlockMetadata_Linear::AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const -{ - const VkDeviceSize size = GetSize(); - const SuballocationVectorType& suballocations1st = AccessSuballocations1st(); - const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); - const size_t suballoc1stCount = suballocations1st.size(); - const size_t suballoc2ndCount = suballocations2nd.size(); - - inoutStats.statistics.blockCount++; - inoutStats.statistics.blockBytes += size; - - VkDeviceSize lastOffset = 0; - - if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) - { - const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset; - size_t nextAlloc2ndIndex = 0; - while (lastOffset < freeSpace2ndTo1stEnd) - { - // Find next non-null allocation or move nextAllocIndex to the end. - while (nextAlloc2ndIndex < suballoc2ndCount && - suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL) - { - ++nextAlloc2ndIndex; - } - - // Found non-null allocation. - if (nextAlloc2ndIndex < suballoc2ndCount) - { - const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex]; - - // 1. Process free space before this allocation. - if (lastOffset < suballoc.offset) - { - // There is free space from lastOffset to suballoc.offset. - const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset; - VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); - } - - // 2. Process this allocation. - // There is allocation with suballoc.offset, suballoc.size. - VmaAddDetailedStatisticsAllocation(inoutStats, suballoc.size); - - // 3. Prepare for next iteration. - lastOffset = suballoc.offset + suballoc.size; - ++nextAlloc2ndIndex; - } - // We are at the end. - else - { - // There is free space from lastOffset to freeSpace2ndTo1stEnd. - if (lastOffset < freeSpace2ndTo1stEnd) - { - const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset; - VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); - } - - // End of loop. - lastOffset = freeSpace2ndTo1stEnd; - } - } - } - - size_t nextAlloc1stIndex = m_1stNullItemsBeginCount; - const VkDeviceSize freeSpace1stTo2ndEnd = - m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size; - while (lastOffset < freeSpace1stTo2ndEnd) - { - // Find next non-null allocation or move nextAllocIndex to the end. - while (nextAlloc1stIndex < suballoc1stCount && - suballocations1st[nextAlloc1stIndex].userData == VMA_NULL) - { - ++nextAlloc1stIndex; - } - - // Found non-null allocation. - if (nextAlloc1stIndex < suballoc1stCount) - { - const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex]; - - // 1. Process free space before this allocation. - if (lastOffset < suballoc.offset) - { - // There is free space from lastOffset to suballoc.offset. - const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset; - VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); - } - - // 2. Process this allocation. - // There is allocation with suballoc.offset, suballoc.size. - VmaAddDetailedStatisticsAllocation(inoutStats, suballoc.size); - - // 3. Prepare for next iteration. - lastOffset = suballoc.offset + suballoc.size; - ++nextAlloc1stIndex; - } - // We are at the end. - else - { - // There is free space from lastOffset to freeSpace1stTo2ndEnd. - if (lastOffset < freeSpace1stTo2ndEnd) - { - const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset; - VmaAddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); - } - - // End of loop. - lastOffset = freeSpace1stTo2ndEnd; - } - } - - if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) - { - size_t nextAlloc2ndIndex = suballocations2nd.size() - 1; - while (lastOffset < size) - { - // Find next non-null allocation or move nextAllocIndex to the end. - while (nextAlloc2ndIndex != SIZE_MAX && - suballocations2nd[nextAlloc2ndIndex].userData == VMA_NULL) - { - --nextAlloc2ndIndex; + --nextAlloc2ndIndex; } // Found non-null allocation. @@ -8263,7 +7686,7 @@ void VmaBlockMetadata_Linear::PrintDetailedMap(class VmaJsonWriter& json) const // We are at the end. else { - if (lastOffset < size) + if (lastOffset < freeSpace1stTo2ndEnd) { // There is free space from lastOffset to freeSpace1stTo2ndEnd. ++unusedRangeCount; @@ -8489,6 +7912,10 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest( VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE); VMA_ASSERT(pAllocationRequest != VMA_NULL); VMA_HEAVY_ASSERT(Validate()); + + if(allocSize > GetSize()) + return false; + pAllocationRequest->size = allocSize; return upperAddress ? CreateAllocationRequest_UpperAddress( @@ -8915,95 +8342,14 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest_LowerAddress( SuballocationVectorType& suballocations1st = AccessSuballocations1st(); SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); - if (m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) - { - // Try to allocate at the end of 1st vector. - - VkDeviceSize resultBaseOffset = 0; - if (!suballocations1st.empty()) - { - const VmaSuballocation& lastSuballoc = suballocations1st.back(); - resultBaseOffset = lastSuballoc.offset + lastSuballoc.size + debugMargin; - } - - // Start from offset equal to beginning of free space. - VkDeviceSize resultOffset = resultBaseOffset; - - // Apply alignment. - resultOffset = VmaAlignUp(resultOffset, allocAlignment); - - // Check previous suballocations for BufferImageGranularity conflicts. - // Make bigger alignment if necessary. - if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations1st.empty()) - { - bool bufferImageGranularityConflict = false; - for (size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; ) - { - const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex]; - if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity)) - { - if (VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType)) - { - bufferImageGranularityConflict = true; - break; - } - } - else - // Already on previous page. - break; - } - if (bufferImageGranularityConflict) - { - resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity); - } - } - - const VkDeviceSize freeSpaceEnd = m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? - suballocations2nd.back().offset : blockSize; - - // There is enough free space at the end after alignment. - if (resultOffset + allocSize + debugMargin <= freeSpaceEnd) - { - // Check next suballocations for BufferImageGranularity conflicts. - // If conflict exists, allocation cannot be made here. - if ((allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity) && m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) - { - for (size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; ) - { - const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex]; - if (VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity)) - { - if (VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type)) - { - return false; - } - } - else - { - // Already on previous page. - break; - } - } - } - - // All tests passed: Success. - pAllocationRequest->allocHandle = (VmaAllocHandle)(resultOffset + 1); - // pAllocationRequest->item, customData unused. - pAllocationRequest->type = VmaAllocationRequestType::EndOf1st; - return true; - } - } - - // Wrap-around to end of 2nd vector. Try to allocate there, watching for the - // beginning of 1st vector as the end of free space. - if (m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) + if (m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) { - VMA_ASSERT(!suballocations1st.empty()); + // Try to allocate at the end of 1st vector. VkDeviceSize resultBaseOffset = 0; - if (!suballocations2nd.empty()) + if (!suballocations1st.empty()) { - const VmaSuballocation& lastSuballoc = suballocations2nd.back(); + const VmaSuballocation& lastSuballoc = suballocations1st.back(); resultBaseOffset = lastSuballoc.offset + lastSuballoc.size + debugMargin; } @@ -9015,12 +8361,12 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest_LowerAddress( // Check previous suballocations for BufferImageGranularity conflicts. // Make bigger alignment if necessary. - if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty()) + if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations1st.empty()) { bool bufferImageGranularityConflict = false; - for (size_t prevSuballocIndex = suballocations2nd.size(); prevSuballocIndex--; ) + for (size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; ) { - const VmaSuballocation& prevSuballoc = suballocations2nd[prevSuballocIndex]; + const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex]; if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity)) { if (VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType)) @@ -9039,21 +8385,19 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest_LowerAddress( } } - size_t index1st = m_1stNullItemsBeginCount; + const VkDeviceSize freeSpaceEnd = m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? + suballocations2nd.back().offset : blockSize; // There is enough free space at the end after alignment. - if ((index1st == suballocations1st.size() && resultOffset + allocSize + debugMargin <= blockSize) || - (index1st < suballocations1st.size() && resultOffset + allocSize + debugMargin <= suballocations1st[index1st].offset)) + if (resultOffset + allocSize + debugMargin <= freeSpaceEnd) { // Check next suballocations for BufferImageGranularity conflicts. // If conflict exists, allocation cannot be made here. - if (allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity) + if ((allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity) && m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) { - for (size_t nextSuballocIndex = index1st; - nextSuballocIndex < suballocations1st.size(); - nextSuballocIndex++) + for (size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; ) { - const VmaSuballocation& nextSuballoc = suballocations1st[nextSuballocIndex]; + const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex]; if (VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity)) { if (VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type)) @@ -9063,7 +8407,7 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest_LowerAddress( } else { - // Already on next page. + // Already on previous page. break; } } @@ -9071,839 +8415,215 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest_LowerAddress( // All tests passed: Success. pAllocationRequest->allocHandle = (VmaAllocHandle)(resultOffset + 1); - pAllocationRequest->type = VmaAllocationRequestType::EndOf2nd; // pAllocationRequest->item, customData unused. + pAllocationRequest->type = VmaAllocationRequestType::EndOf1st; return true; } } - return false; -} - -bool VmaBlockMetadata_Linear::CreateAllocationRequest_UpperAddress( - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - VmaSuballocationType allocType, - uint32_t strategy, - VmaAllocationRequest* pAllocationRequest) -{ - const VkDeviceSize blockSize = GetSize(); - const VkDeviceSize bufferImageGranularity = GetBufferImageGranularity(); - SuballocationVectorType& suballocations1st = AccessSuballocations1st(); - SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); - - if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) - { - VMA_ASSERT(0 && "Trying to use pool with linear algorithm as double stack, while it is already being used as ring buffer."); - return false; - } - - // Try to allocate before 2nd.back(), or end of block if 2nd.empty(). - if (allocSize > blockSize) - { - return false; - } - VkDeviceSize resultBaseOffset = blockSize - allocSize; - if (!suballocations2nd.empty()) + // Wrap-around to end of 2nd vector. Try to allocate there, watching for the + // beginning of 1st vector as the end of free space. + if (m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) { - const VmaSuballocation& lastSuballoc = suballocations2nd.back(); - resultBaseOffset = lastSuballoc.offset - allocSize; - if (allocSize > lastSuballoc.offset) - { - return false; - } - } - - // Start from offset equal to end of free space. - VkDeviceSize resultOffset = resultBaseOffset; - - const VkDeviceSize debugMargin = GetDebugMargin(); + VMA_ASSERT(!suballocations1st.empty()); - // Apply debugMargin at the end. - if (debugMargin > 0) - { - if (resultOffset < debugMargin) + VkDeviceSize resultBaseOffset = 0; + if (!suballocations2nd.empty()) { - return false; + const VmaSuballocation& lastSuballoc = suballocations2nd.back(); + resultBaseOffset = lastSuballoc.offset + lastSuballoc.size + debugMargin; } - resultOffset -= debugMargin; - } - // Apply alignment. - resultOffset = VmaAlignDown(resultOffset, allocAlignment); + // Start from offset equal to beginning of free space. + VkDeviceSize resultOffset = resultBaseOffset; - // Check next suballocations from 2nd for BufferImageGranularity conflicts. - // Make bigger alignment if necessary. - if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty()) - { - bool bufferImageGranularityConflict = false; - for (size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; ) - { - const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex]; - if (VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity)) - { - if (VmaIsBufferImageGranularityConflict(nextSuballoc.type, allocType)) - { - bufferImageGranularityConflict = true; - break; - } - } - else - // Already on previous page. - break; - } - if (bufferImageGranularityConflict) - { - resultOffset = VmaAlignDown(resultOffset, bufferImageGranularity); - } - } + // Apply alignment. + resultOffset = VmaAlignUp(resultOffset, allocAlignment); - // There is enough free space. - const VkDeviceSize endOf1st = !suballocations1st.empty() ? - suballocations1st.back().offset + suballocations1st.back().size : - 0; - if (endOf1st + debugMargin <= resultOffset) - { // Check previous suballocations for BufferImageGranularity conflicts. - // If conflict exists, allocation cannot be made here. - if (bufferImageGranularity > 1) - { - for (size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; ) - { - const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex]; - if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity)) - { - if (VmaIsBufferImageGranularityConflict(allocType, prevSuballoc.type)) - { - return false; - } - } - else - { - // Already on next page. - break; - } - } - } - - // All tests passed: Success. - pAllocationRequest->allocHandle = (VmaAllocHandle)(resultOffset + 1); - // pAllocationRequest->item unused. - pAllocationRequest->type = VmaAllocationRequestType::UpperAddress; - return true; - } - - return false; -} -#endif // _VMA_BLOCK_METADATA_LINEAR_FUNCTIONS -#endif // _VMA_BLOCK_METADATA_LINEAR - -#if 0 -#ifndef _VMA_BLOCK_METADATA_BUDDY -/* -- GetSize() is the original size of allocated memory block. -- m_UsableSize is this size aligned down to a power of two. - All allocations and calculations happen relative to m_UsableSize. -- GetUnusableSize() is the difference between them. - It is reported as separate, unused range, not available for allocations. - -Node at level 0 has size = m_UsableSize. -Each next level contains nodes with size 2 times smaller than current level. -m_LevelCount is the maximum number of levels to use in the current object. -*/ -class VmaBlockMetadata_Buddy : public VmaBlockMetadata -{ - VMA_CLASS_NO_COPY(VmaBlockMetadata_Buddy) -public: - VmaBlockMetadata_Buddy(const VkAllocationCallbacks* pAllocationCallbacks, - VkDeviceSize bufferImageGranularity, bool isVirtual); - virtual ~VmaBlockMetadata_Buddy(); - - size_t GetAllocationCount() const override { return m_AllocationCount; } - VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize + GetUnusableSize(); } - bool IsEmpty() const override { return m_Root->type == Node::TYPE_FREE; } - VkResult CheckCorruption(const void* pBlockData) override { return VK_ERROR_FEATURE_NOT_PRESENT; } - VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; } - void DebugLogAllAllocations() const override { DebugLogAllAllocationNode(m_Root, 0); } - - void Init(VkDeviceSize size) override; - bool Validate() const override; - - void AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const override; - void AddStatistics(VmaStatistics& inoutStats) const override; - -#if VMA_STATS_STRING_ENABLED - void PrintDetailedMap(class VmaJsonWriter& json, uint32_t mapRefCount) const override; -#endif - - bool CreateAllocationRequest( - VkDeviceSize allocSize, - VkDeviceSize allocAlignment, - bool upperAddress, - VmaSuballocationType allocType, - uint32_t strategy, - VmaAllocationRequest* pAllocationRequest) override; - - void Alloc( - const VmaAllocationRequest& request, - VmaSuballocationType type, - void* userData) override; - - void Free(VmaAllocHandle allocHandle) override; - void GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) override; - void* GetAllocationUserData(VmaAllocHandle allocHandle) const override; - VmaAllocHandle GetAllocationListBegin() const override; - VmaAllocHandle GetNextAllocation(VmaAllocHandle prevAlloc) const override; - void Clear() override; - void SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) override; - -private: - static const size_t MAX_LEVELS = 48; - - struct ValidationContext - { - size_t calculatedAllocationCount = 0; - size_t calculatedFreeCount = 0; - VkDeviceSize calculatedSumFreeSize = 0; - }; - struct Node - { - VkDeviceSize offset; - enum TYPE - { - TYPE_FREE, - TYPE_ALLOCATION, - TYPE_SPLIT, - TYPE_COUNT - } type; - Node* parent; - Node* buddy; - - union - { - struct - { - Node* prev; - Node* next; - } free; - struct - { - void* userData; - } allocation; - struct - { - Node* leftChild; - } split; - }; - }; - - // Size of the memory block aligned down to a power of two. - VkDeviceSize m_UsableSize; - uint32_t m_LevelCount; - VmaPoolAllocator m_NodeAllocator; - Node* m_Root; - struct - { - Node* front; - Node* back; - } m_FreeList[MAX_LEVELS]; - - // Number of nodes in the tree with type == TYPE_ALLOCATION. - size_t m_AllocationCount; - // Number of nodes in the tree with type == TYPE_FREE. - size_t m_FreeCount; - // Doesn't include space wasted due to internal fragmentation - allocation sizes are just aligned up to node sizes. - // Doesn't include unusable size. - VkDeviceSize m_SumFreeSize; - - VkDeviceSize GetUnusableSize() const { return GetSize() - m_UsableSize; } - VkDeviceSize LevelToNodeSize(uint32_t level) const { return m_UsableSize >> level; } - - VkDeviceSize AlignAllocationSize(VkDeviceSize size) const - { - if (!IsVirtual()) - { - size = VmaAlignUp(size, (VkDeviceSize)16); - } - return VmaNextPow2(size); - } - Node* FindAllocationNode(VkDeviceSize offset, uint32_t& outLevel) const; - void DeleteNodeChildren(Node* node); - bool ValidateNode(ValidationContext& ctx, const Node* parent, const Node* curr, uint32_t level, VkDeviceSize levelNodeSize) const; - uint32_t AllocSizeToLevel(VkDeviceSize allocSize) const; - void AddNodeToDetailedStatistics(VmaDetailedStatistics& inoutStats, const Node* node, VkDeviceSize levelNodeSize) const; - // Adds node to the front of FreeList at given level. - // node->type must be FREE. - // node->free.prev, next can be undefined. - void AddToFreeListFront(uint32_t level, Node* node); - // Removes node from FreeList at given level. - // node->type must be FREE. - // node->free.prev, next stay untouched. - void RemoveFromFreeList(uint32_t level, Node* node); - void DebugLogAllAllocationNode(Node* node, uint32_t level) const; - -#if VMA_STATS_STRING_ENABLED - void PrintDetailedMapNode(class VmaJsonWriter& json, const Node* node, VkDeviceSize levelNodeSize) const; -#endif -}; - -#ifndef _VMA_BLOCK_METADATA_BUDDY_FUNCTIONS -VmaBlockMetadata_Buddy::VmaBlockMetadata_Buddy(const VkAllocationCallbacks* pAllocationCallbacks, - VkDeviceSize bufferImageGranularity, bool isVirtual) - : VmaBlockMetadata(pAllocationCallbacks, bufferImageGranularity, isVirtual), - m_NodeAllocator(pAllocationCallbacks, 32), // firstBlockCapacity - m_Root(VMA_NULL), - m_AllocationCount(0), - m_FreeCount(1), - m_SumFreeSize(0) -{ - memset(m_FreeList, 0, sizeof(m_FreeList)); -} - -VmaBlockMetadata_Buddy::~VmaBlockMetadata_Buddy() -{ - DeleteNodeChildren(m_Root); - m_NodeAllocator.Free(m_Root); -} - -void VmaBlockMetadata_Buddy::Init(VkDeviceSize size) -{ - VmaBlockMetadata::Init(size); - - m_UsableSize = VmaPrevPow2(size); - m_SumFreeSize = m_UsableSize; - - // Calculate m_LevelCount. - const VkDeviceSize minNodeSize = IsVirtual() ? 1 : 16; - m_LevelCount = 1; - while (m_LevelCount < MAX_LEVELS && - LevelToNodeSize(m_LevelCount) >= minNodeSize) - { - ++m_LevelCount; - } - - Node* rootNode = m_NodeAllocator.Alloc(); - rootNode->offset = 0; - rootNode->type = Node::TYPE_FREE; - rootNode->parent = VMA_NULL; - rootNode->buddy = VMA_NULL; - - m_Root = rootNode; - AddToFreeListFront(0, rootNode); -} - -bool VmaBlockMetadata_Buddy::Validate() const -{ - // Validate tree. - ValidationContext ctx; - if (!ValidateNode(ctx, VMA_NULL, m_Root, 0, LevelToNodeSize(0))) - { - VMA_VALIDATE(false && "ValidateNode failed."); - } - VMA_VALIDATE(m_AllocationCount == ctx.calculatedAllocationCount); - VMA_VALIDATE(m_SumFreeSize == ctx.calculatedSumFreeSize); - - // Validate free node lists. - for (uint32_t level = 0; level < m_LevelCount; ++level) - { - VMA_VALIDATE(m_FreeList[level].front == VMA_NULL || - m_FreeList[level].front->free.prev == VMA_NULL); - - for (Node* node = m_FreeList[level].front; - node != VMA_NULL; - node = node->free.next) + // Make bigger alignment if necessary. + if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty()) { - VMA_VALIDATE(node->type == Node::TYPE_FREE); - - if (node->free.next == VMA_NULL) + bool bufferImageGranularityConflict = false; + for (size_t prevSuballocIndex = suballocations2nd.size(); prevSuballocIndex--; ) { - VMA_VALIDATE(m_FreeList[level].back == node); + const VmaSuballocation& prevSuballoc = suballocations2nd[prevSuballocIndex]; + if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity)) + { + if (VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType)) + { + bufferImageGranularityConflict = true; + break; + } + } + else + // Already on previous page. + break; } - else + if (bufferImageGranularityConflict) { - VMA_VALIDATE(node->free.next->free.prev == node); + resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity); } } - } - - // Validate that free lists ar higher levels are empty. - for (uint32_t level = m_LevelCount; level < MAX_LEVELS; ++level) - { - VMA_VALIDATE(m_FreeList[level].front == VMA_NULL && m_FreeList[level].back == VMA_NULL); - } - - return true; -} - -void VmaBlockMetadata_Buddy::AddDetailedStatistics(VmaDetailedStatistics& inoutStats) const -{ - inoutStats.statistics.blockCount++; - inoutStats.statistics.blockBytes += GetSize(); - - AddNodeToDetailedStatistics(inoutStats, m_Root, LevelToNodeSize(0)); - - const VkDeviceSize unusableSize = GetUnusableSize(); - if (unusableSize > 0) - VmaAddDetailedStatisticsUnusedRange(inoutStats, unusableSize); -} - -void VmaBlockMetadata_Buddy::AddStatistics(VmaStatistics& inoutStats) const -{ - inoutStats.blockCount++; - inoutStats.allocationCount += (uint32_t)m_AllocationCount; - inoutStats.blockBytes += GetSize(); - inoutStats.allocationBytes += GetSize() - m_SumFreeSize; -} - -#if VMA_STATS_STRING_ENABLED -void VmaBlockMetadata_Buddy::PrintDetailedMap(class VmaJsonWriter& json, uint32_t mapRefCount) const -{ - VmaDetailedStatistics stats; - VmaClearDetailedStatistics(stats); - AddDetailedStatistics(stats); - PrintDetailedMap_Begin( - json, - stats.statistics.blockBytes - stats.statistics.allocationBytes, - stats.statistics.allocationCount, - stats.unusedRangeCount, - mapRefCount); + size_t index1st = m_1stNullItemsBeginCount; - PrintDetailedMapNode(json, m_Root, LevelToNodeSize(0)); + // There is enough free space at the end after alignment. + if ((index1st == suballocations1st.size() && resultOffset + allocSize + debugMargin <= blockSize) || + (index1st < suballocations1st.size() && resultOffset + allocSize + debugMargin <= suballocations1st[index1st].offset)) + { + // Check next suballocations for BufferImageGranularity conflicts. + // If conflict exists, allocation cannot be made here. + if (allocSize % bufferImageGranularity || resultOffset % bufferImageGranularity) + { + for (size_t nextSuballocIndex = index1st; + nextSuballocIndex < suballocations1st.size(); + nextSuballocIndex++) + { + const VmaSuballocation& nextSuballoc = suballocations1st[nextSuballocIndex]; + if (VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity)) + { + if (VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type)) + { + return false; + } + } + else + { + // Already on next page. + break; + } + } + } - const VkDeviceSize unusableSize = GetUnusableSize(); - if (unusableSize > 0) - { - PrintDetailedMap_UnusedRange(json, - m_UsableSize, // offset - unusableSize); // size + // All tests passed: Success. + pAllocationRequest->allocHandle = (VmaAllocHandle)(resultOffset + 1); + pAllocationRequest->type = VmaAllocationRequestType::EndOf2nd; + // pAllocationRequest->item, customData unused. + return true; + } } - PrintDetailedMap_End(json); + return false; } -#endif // VMA_STATS_STRING_ENABLED -bool VmaBlockMetadata_Buddy::CreateAllocationRequest( +bool VmaBlockMetadata_Linear::CreateAllocationRequest_UpperAddress( VkDeviceSize allocSize, VkDeviceSize allocAlignment, - bool upperAddress, VmaSuballocationType allocType, uint32_t strategy, VmaAllocationRequest* pAllocationRequest) { - VMA_ASSERT(!upperAddress && "VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT can be used only with linear algorithm."); - - allocSize = AlignAllocationSize(allocSize); + const VkDeviceSize blockSize = GetSize(); + const VkDeviceSize bufferImageGranularity = GetBufferImageGranularity(); + SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); - // Simple way to respect bufferImageGranularity. May be optimized some day. - // Whenever it might be an OPTIMAL image... - if (allocType == VMA_SUBALLOCATION_TYPE_UNKNOWN || - allocType == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN || - allocType == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL) + if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) { - allocAlignment = VMA_MAX(allocAlignment, GetBufferImageGranularity()); - allocSize = VmaAlignUp(allocSize, GetBufferImageGranularity()); + VMA_ASSERT(0 && "Trying to use pool with linear algorithm as double stack, while it is already being used as ring buffer."); + return false; } - if (allocSize > m_UsableSize) + // Try to allocate before 2nd.back(), or end of block if 2nd.empty(). + if (allocSize > blockSize) { return false; } - - const uint32_t targetLevel = AllocSizeToLevel(allocSize); - for (uint32_t level = targetLevel; level--; ) + VkDeviceSize resultBaseOffset = blockSize - allocSize; + if (!suballocations2nd.empty()) { - for (Node* freeNode = m_FreeList[level].front; - freeNode != VMA_NULL; - freeNode = freeNode->free.next) + const VmaSuballocation& lastSuballoc = suballocations2nd.back(); + resultBaseOffset = lastSuballoc.offset - allocSize; + if (allocSize > lastSuballoc.offset) { - if (freeNode->offset % allocAlignment == 0) - { - pAllocationRequest->type = VmaAllocationRequestType::Normal; - pAllocationRequest->allocHandle = (VmaAllocHandle)(freeNode->offset + 1); - pAllocationRequest->size = allocSize; - pAllocationRequest->customData = (void*)(uintptr_t)level; - return true; - } + return false; } } - return false; -} - -void VmaBlockMetadata_Buddy::Alloc( - const VmaAllocationRequest& request, - VmaSuballocationType type, - void* userData) -{ - VMA_ASSERT(request.type == VmaAllocationRequestType::Normal); - - const uint32_t targetLevel = AllocSizeToLevel(request.size); - uint32_t currLevel = (uint32_t)(uintptr_t)request.customData; - - Node* currNode = m_FreeList[currLevel].front; - VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE); - const VkDeviceSize offset = (VkDeviceSize)request.allocHandle - 1; - while (currNode->offset != offset) - { - currNode = currNode->free.next; - VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE); - } - - // Go down, splitting free nodes. - while (currLevel < targetLevel) - { - // currNode is already first free node at currLevel. - // Remove it from list of free nodes at this currLevel. - RemoveFromFreeList(currLevel, currNode); - - const uint32_t childrenLevel = currLevel + 1; - - // Create two free sub-nodes. - Node* leftChild = m_NodeAllocator.Alloc(); - Node* rightChild = m_NodeAllocator.Alloc(); - - leftChild->offset = currNode->offset; - leftChild->type = Node::TYPE_FREE; - leftChild->parent = currNode; - leftChild->buddy = rightChild; - - rightChild->offset = currNode->offset + LevelToNodeSize(childrenLevel); - rightChild->type = Node::TYPE_FREE; - rightChild->parent = currNode; - rightChild->buddy = leftChild; - - // Convert current currNode to split type. - currNode->type = Node::TYPE_SPLIT; - currNode->split.leftChild = leftChild; - - // Add child nodes to free list. Order is important! - AddToFreeListFront(childrenLevel, rightChild); - AddToFreeListFront(childrenLevel, leftChild); - - ++m_FreeCount; - ++currLevel; - currNode = m_FreeList[currLevel].front; - - /* - We can be sure that currNode, as left child of node previously split, - also fulfills the alignment requirement. - */ - } - - // Remove from free list. - VMA_ASSERT(currLevel == targetLevel && - currNode != VMA_NULL && - currNode->type == Node::TYPE_FREE); - RemoveFromFreeList(currLevel, currNode); - - // Convert to allocation node. - currNode->type = Node::TYPE_ALLOCATION; - currNode->allocation.userData = userData; - - ++m_AllocationCount; - --m_FreeCount; - m_SumFreeSize -= request.size; -} - -void VmaBlockMetadata_Buddy::GetAllocationInfo(VmaAllocHandle allocHandle, VmaVirtualAllocationInfo& outInfo) -{ - uint32_t level = 0; - outInfo.offset = (VkDeviceSize)allocHandle - 1; - const Node* const node = FindAllocationNode(outInfo.offset, level); - outInfo.size = LevelToNodeSize(level); - outInfo.pUserData = node->allocation.userData; -} - -void* VmaBlockMetadata_Buddy::GetAllocationUserData(VmaAllocHandle allocHandle) const -{ - uint32_t level = 0; - const Node* const node = FindAllocationNode((VkDeviceSize)allocHandle - 1, level); - return node->allocation.userData; -} - -VmaAllocHandle VmaBlockMetadata_Buddy::GetAllocationListBegin() const -{ - // Function only used for defragmentation, which is disabled for this algorithm - return VK_NULL_HANDLE; -} - -VmaAllocHandle VmaBlockMetadata_Buddy::GetNextAllocation(VmaAllocHandle prevAlloc) const -{ - // Function only used for defragmentation, which is disabled for this algorithm - return VK_NULL_HANDLE; -} - -void VmaBlockMetadata_Buddy::DeleteNodeChildren(Node* node) -{ - if (node->type == Node::TYPE_SPLIT) - { - DeleteNodeChildren(node->split.leftChild->buddy); - DeleteNodeChildren(node->split.leftChild); - const VkAllocationCallbacks* allocationCallbacks = GetAllocationCallbacks(); - m_NodeAllocator.Free(node->split.leftChild->buddy); - m_NodeAllocator.Free(node->split.leftChild); - } -} - -void VmaBlockMetadata_Buddy::Clear() -{ - DeleteNodeChildren(m_Root); - m_Root->type = Node::TYPE_FREE; - m_AllocationCount = 0; - m_FreeCount = 1; - m_SumFreeSize = m_UsableSize; -} + // Start from offset equal to end of free space. + VkDeviceSize resultOffset = resultBaseOffset; -void VmaBlockMetadata_Buddy::SetAllocationUserData(VmaAllocHandle allocHandle, void* userData) -{ - uint32_t level = 0; - Node* const node = FindAllocationNode((VkDeviceSize)allocHandle - 1, level); - node->allocation.userData = userData; -} + const VkDeviceSize debugMargin = GetDebugMargin(); -VmaBlockMetadata_Buddy::Node* VmaBlockMetadata_Buddy::FindAllocationNode(VkDeviceSize offset, uint32_t& outLevel) const -{ - Node* node = m_Root; - VkDeviceSize nodeOffset = 0; - outLevel = 0; - VkDeviceSize levelNodeSize = LevelToNodeSize(0); - while (node->type == Node::TYPE_SPLIT) + // Apply debugMargin at the end. + if (debugMargin > 0) { - const VkDeviceSize nextLevelNodeSize = levelNodeSize >> 1; - if (offset < nodeOffset + nextLevelNodeSize) - { - node = node->split.leftChild; - } - else + if (resultOffset < debugMargin) { - node = node->split.leftChild->buddy; - nodeOffset += nextLevelNodeSize; + return false; } - ++outLevel; - levelNodeSize = nextLevelNodeSize; + resultOffset -= debugMargin; } - VMA_ASSERT(node != VMA_NULL && node->type == Node::TYPE_ALLOCATION); - return node; -} + // Apply alignment. + resultOffset = VmaAlignDown(resultOffset, allocAlignment); -bool VmaBlockMetadata_Buddy::ValidateNode(ValidationContext& ctx, const Node* parent, const Node* curr, uint32_t level, VkDeviceSize levelNodeSize) const -{ - VMA_VALIDATE(level < m_LevelCount); - VMA_VALIDATE(curr->parent == parent); - VMA_VALIDATE((curr->buddy == VMA_NULL) == (parent == VMA_NULL)); - VMA_VALIDATE(curr->buddy == VMA_NULL || curr->buddy->buddy == curr); - switch (curr->type) + // Check next suballocations from 2nd for BufferImageGranularity conflicts. + // Make bigger alignment if necessary. + if (bufferImageGranularity > 1 && bufferImageGranularity != allocAlignment && !suballocations2nd.empty()) { - case Node::TYPE_FREE: - // curr->free.prev, next are validated separately. - ctx.calculatedSumFreeSize += levelNodeSize; - ++ctx.calculatedFreeCount; - break; - case Node::TYPE_ALLOCATION: - ++ctx.calculatedAllocationCount; - if (!IsVirtual()) - { - VMA_VALIDATE(curr->allocation.userData != VMA_NULL); - } - break; - case Node::TYPE_SPLIT: - { - const uint32_t childrenLevel = level + 1; - const VkDeviceSize childrenLevelNodeSize = levelNodeSize >> 1; - const Node* const leftChild = curr->split.leftChild; - VMA_VALIDATE(leftChild != VMA_NULL); - VMA_VALIDATE(leftChild->offset == curr->offset); - if (!ValidateNode(ctx, curr, leftChild, childrenLevel, childrenLevelNodeSize)) + bool bufferImageGranularityConflict = false; + for (size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; ) { - VMA_VALIDATE(false && "ValidateNode for left child failed."); + const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex]; + if (VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity)) + { + if (VmaIsBufferImageGranularityConflict(nextSuballoc.type, allocType)) + { + bufferImageGranularityConflict = true; + break; + } + } + else + // Already on previous page. + break; } - const Node* const rightChild = leftChild->buddy; - VMA_VALIDATE(rightChild->offset == curr->offset + childrenLevelNodeSize); - if (!ValidateNode(ctx, curr, rightChild, childrenLevel, childrenLevelNodeSize)) + if (bufferImageGranularityConflict) { - VMA_VALIDATE(false && "ValidateNode for right child failed."); + resultOffset = VmaAlignDown(resultOffset, bufferImageGranularity); } } - break; - default: - return false; - } - - return true; -} - -uint32_t VmaBlockMetadata_Buddy::AllocSizeToLevel(VkDeviceSize allocSize) const -{ - // I know this could be optimized somehow e.g. by using std::log2p1 from C++20. - uint32_t level = 0; - VkDeviceSize currLevelNodeSize = m_UsableSize; - VkDeviceSize nextLevelNodeSize = currLevelNodeSize >> 1; - while (allocSize <= nextLevelNodeSize && level + 1 < m_LevelCount) - { - ++level; - currLevelNodeSize >>= 1; - nextLevelNodeSize >>= 1; - } - return level; -} - -void VmaBlockMetadata_Buddy::Free(VmaAllocHandle allocHandle) -{ - uint32_t level = 0; - Node* node = FindAllocationNode((VkDeviceSize)allocHandle - 1, level); - - ++m_FreeCount; - --m_AllocationCount; - m_SumFreeSize += LevelToNodeSize(level); - - node->type = Node::TYPE_FREE; - - // Join free nodes if possible. - while (level > 0 && node->buddy->type == Node::TYPE_FREE) - { - RemoveFromFreeList(level, node->buddy); - Node* const parent = node->parent; - - m_NodeAllocator.Free(node->buddy); - m_NodeAllocator.Free(node); - parent->type = Node::TYPE_FREE; - - node = parent; - --level; - --m_FreeCount; - } - - AddToFreeListFront(level, node); -} - -void VmaBlockMetadata_Buddy::AddNodeToDetailedStatistics(VmaDetailedStatistics& inoutStats, const Node* node, VkDeviceSize levelNodeSize) const -{ - switch (node->type) - { - case Node::TYPE_FREE: - VmaAddDetailedStatisticsUnusedRange(inoutStats, levelNodeSize); - break; - case Node::TYPE_ALLOCATION: - VmaAddDetailedStatisticsAllocation(inoutStats, levelNodeSize); - break; - case Node::TYPE_SPLIT: - { - const VkDeviceSize childrenNodeSize = levelNodeSize / 2; - const Node* const leftChild = node->split.leftChild; - AddNodeToDetailedStatistics(inoutStats, leftChild, childrenNodeSize); - const Node* const rightChild = leftChild->buddy; - AddNodeToDetailedStatistics(inoutStats, rightChild, childrenNodeSize); - } - break; - default: - VMA_ASSERT(0); - } -} - -void VmaBlockMetadata_Buddy::AddToFreeListFront(uint32_t level, Node* node) -{ - VMA_ASSERT(node->type == Node::TYPE_FREE); - - // List is empty. - Node* const frontNode = m_FreeList[level].front; - if (frontNode == VMA_NULL) - { - VMA_ASSERT(m_FreeList[level].back == VMA_NULL); - node->free.prev = node->free.next = VMA_NULL; - m_FreeList[level].front = m_FreeList[level].back = node; - } - else - { - VMA_ASSERT(frontNode->free.prev == VMA_NULL); - node->free.prev = VMA_NULL; - node->free.next = frontNode; - frontNode->free.prev = node; - m_FreeList[level].front = node; - } -} - -void VmaBlockMetadata_Buddy::RemoveFromFreeList(uint32_t level, Node* node) -{ - VMA_ASSERT(m_FreeList[level].front != VMA_NULL); - - // It is at the front. - if (node->free.prev == VMA_NULL) - { - VMA_ASSERT(m_FreeList[level].front == node); - m_FreeList[level].front = node->free.next; - } - else - { - Node* const prevFreeNode = node->free.prev; - VMA_ASSERT(prevFreeNode->free.next == node); - prevFreeNode->free.next = node->free.next; - } - - // It is at the back. - if (node->free.next == VMA_NULL) - { - VMA_ASSERT(m_FreeList[level].back == node); - m_FreeList[level].back = node->free.prev; - } - else - { - Node* const nextFreeNode = node->free.next; - VMA_ASSERT(nextFreeNode->free.prev == node); - nextFreeNode->free.prev = node->free.prev; - } -} -void VmaBlockMetadata_Buddy::DebugLogAllAllocationNode(Node* node, uint32_t level) const -{ - switch (node->type) - { - case Node::TYPE_FREE: - break; - case Node::TYPE_ALLOCATION: - DebugLogAllocation(node->offset, LevelToNodeSize(level), node->allocation.userData); - break; - case Node::TYPE_SPLIT: + // There is enough free space. + const VkDeviceSize endOf1st = !suballocations1st.empty() ? + suballocations1st.back().offset + suballocations1st.back().size : + 0; + if (endOf1st + debugMargin <= resultOffset) { - ++level; - DebugLogAllAllocationNode(node->split.leftChild, level); - DebugLogAllAllocationNode(node->split.leftChild->buddy, level); - } - break; - default: - VMA_ASSERT(0); - } -} + // Check previous suballocations for BufferImageGranularity conflicts. + // If conflict exists, allocation cannot be made here. + if (bufferImageGranularity > 1) + { + for (size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; ) + { + const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex]; + if (VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity)) + { + if (VmaIsBufferImageGranularityConflict(allocType, prevSuballoc.type)) + { + return false; + } + } + else + { + // Already on next page. + break; + } + } + } -#if VMA_STATS_STRING_ENABLED -void VmaBlockMetadata_Buddy::PrintDetailedMapNode(class VmaJsonWriter& json, const Node* node, VkDeviceSize levelNodeSize) const -{ - switch (node->type) - { - case Node::TYPE_FREE: - PrintDetailedMap_UnusedRange(json, node->offset, levelNodeSize); - break; - case Node::TYPE_ALLOCATION: - PrintDetailedMap_Allocation(json, node->offset, levelNodeSize, node->allocation.userData); - break; - case Node::TYPE_SPLIT: - { - const VkDeviceSize childrenNodeSize = levelNodeSize / 2; - const Node* const leftChild = node->split.leftChild; - PrintDetailedMapNode(json, leftChild, childrenNodeSize); - const Node* const rightChild = leftChild->buddy; - PrintDetailedMapNode(json, rightChild, childrenNodeSize); - } - break; - default: - VMA_ASSERT(0); + // All tests passed: Success. + pAllocationRequest->allocHandle = (VmaAllocHandle)(resultOffset + 1); + // pAllocationRequest->item unused. + pAllocationRequest->type = VmaAllocationRequestType::UpperAddress; + return true; } + + return false; } -#endif // VMA_STATS_STRING_ENABLED -#endif // _VMA_BLOCK_METADATA_BUDDY_FUNCTIONS -#endif // _VMA_BLOCK_METADATA_BUDDY -#endif // #if 0 +#endif // _VMA_BLOCK_METADATA_LINEAR_FUNCTIONS +#endif // _VMA_BLOCK_METADATA_LINEAR #ifndef _VMA_BLOCK_METADATA_TLSF // To not search current larger region if first allocation won't succeed and skip to smaller range @@ -9912,7 +8632,7 @@ void VmaBlockMetadata_Buddy::PrintDetailedMapNode(class VmaJsonWriter& json, con // VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT for fastest alloc time possible. class VmaBlockMetadata_TLSF : public VmaBlockMetadata { - VMA_CLASS_NO_COPY(VmaBlockMetadata_TLSF) + VMA_CLASS_NO_COPY_NO_MOVE(VmaBlockMetadata_TLSF) public: VmaBlockMetadata_TLSF(const VkAllocationCallbacks* pAllocationCallbacks, VkDeviceSize bufferImageGranularity, bool isVirtual); @@ -10074,7 +8794,7 @@ void VmaBlockMetadata_TLSF::Init(VkDeviceSize size) else m_ListsCount += 4; - m_MemoryClasses = memoryClass + 2; + m_MemoryClasses = memoryClass + uint8_t(2); memset(m_InnerIsFreeBitmap, 0, MAX_MEMORY_CLASSES * sizeof(uint32_t)); m_FreeList = vma_new_array(GetAllocationCallbacks(), Block*, m_ListsCount); @@ -10267,7 +8987,7 @@ bool VmaBlockMetadata_TLSF::CreateAllocationRequest( // Round up to the next block VkDeviceSize sizeForNextList = allocSize; - VkDeviceSize smallSizeStep = SMALL_BUFFER_SIZE / (IsVirtual() ? 1 << SECOND_LEVEL_INDEX : 4); + VkDeviceSize smallSizeStep = VkDeviceSize(SMALL_BUFFER_SIZE / (IsVirtual() ? 1 << SECOND_LEVEL_INDEX : 4)); if (allocSize > SMALL_BUFFER_SIZE) { sizeForNextList += (1ULL << (VMA_BITSCAN_MSB(allocSize) - SECOND_LEVEL_INDEX)); @@ -10277,8 +8997,8 @@ bool VmaBlockMetadata_TLSF::CreateAllocationRequest( else sizeForNextList += smallSizeStep; - uint32_t nextListIndex = 0; - uint32_t prevListIndex = 0; + uint32_t nextListIndex = m_ListsCount; + uint32_t prevListIndex = m_ListsCount; Block* nextListBlock = VMA_NULL; Block* prevListBlock = VMA_NULL; @@ -10676,7 +9396,7 @@ void VmaBlockMetadata_TLSF::DebugLogAllAllocations() const uint8_t VmaBlockMetadata_TLSF::SizeToMemoryClass(VkDeviceSize size) const { if (size > SMALL_BUFFER_SIZE) - return VMA_BITSCAN_MSB(size) - MEMORY_CLASS_SHIFT; + return uint8_t(VMA_BITSCAN_MSB(size) - MEMORY_CLASS_SHIFT); return 0; } @@ -10851,7 +9571,7 @@ Synchronized internally with a mutex. class VmaBlockVector { friend struct VmaDefragmentationContext_T; - VMA_CLASS_NO_COPY(VmaBlockVector) + VMA_CLASS_NO_COPY_NO_MOVE(VmaBlockVector) public: VmaBlockVector( VmaAllocator hAllocator, @@ -10970,7 +9690,7 @@ class VmaBlockVector #ifndef _VMA_DEFRAGMENTATION_CONTEXT struct VmaDefragmentationContext_T { - VMA_CLASS_NO_COPY(VmaDefragmentationContext_T) + VMA_CLASS_NO_COPY_NO_MOVE(VmaDefragmentationContext_T) public: VmaDefragmentationContext_T( VmaAllocator hAllocator, @@ -11020,6 +9740,8 @@ struct VmaDefragmentationContext_T const VkDeviceSize m_MaxPassBytes; const uint32_t m_MaxPassAllocations; + const PFN_vmaCheckDefragmentationBreakFunction m_BreakCallback; + void* m_BreakCallbackUserData; VmaStlAllocator m_MoveAllocator; VmaVector> m_Moves; @@ -11057,7 +9779,7 @@ struct VmaDefragmentationContext_T struct VmaPool_T { friend struct VmaPoolListItemTraits; - VMA_CLASS_NO_COPY(VmaPool_T) + VMA_CLASS_NO_COPY_NO_MOVE(VmaPool_T) public: VmaBlockVector m_BlockVector; VmaDedicatedAllocationList m_DedicatedAllocations; @@ -11099,6 +9821,9 @@ struct VmaPoolListItemTraits #ifndef _VMA_CURRENT_BUDGET_DATA struct VmaCurrentBudgetData { + VMA_CLASS_NO_COPY_NO_MOVE(VmaCurrentBudgetData) +public: + VMA_ATOMIC_UINT32 m_BlockCount[VK_MAX_MEMORY_HEAPS]; VMA_ATOMIC_UINT32 m_AllocationCount[VK_MAX_MEMORY_HEAPS]; VMA_ATOMIC_UINT64 m_BlockBytes[VK_MAX_MEMORY_HEAPS]; @@ -11167,7 +9892,7 @@ Thread-safe wrapper over VmaPoolAllocator free list, for allocation of VmaAlloca */ class VmaAllocationObjectAllocator { - VMA_CLASS_NO_COPY(VmaAllocationObjectAllocator) + VMA_CLASS_NO_COPY_NO_MOVE(VmaAllocationObjectAllocator) public: VmaAllocationObjectAllocator(const VkAllocationCallbacks* pAllocationCallbacks) : m_Allocator(pAllocationCallbacks, 1024) {} @@ -11197,7 +9922,7 @@ void VmaAllocationObjectAllocator::Free(VmaAllocation hAlloc) #ifndef _VMA_VIRTUAL_BLOCK_T struct VmaVirtualBlock_T { - VMA_CLASS_NO_COPY(VmaVirtualBlock_T) + VMA_CLASS_NO_COPY_NO_MOVE(VmaVirtualBlock_T) public: const bool m_AllocationCallbacksSpecified; const VkAllocationCallbacks m_AllocationCallbacks; @@ -11249,12 +9974,13 @@ VmaVirtualBlock_T::VmaVirtualBlock_T(const VmaVirtualBlockCreateInfo& createInfo VmaVirtualBlock_T::~VmaVirtualBlock_T() { - // Define macro VMA_DEBUG_LOG_FORMAT to receive the list of the unfreed allocations + // Define macro VMA_DEBUG_LOG_FORMAT or more specialized VMA_LEAK_LOG_FORMAT + // to receive the list of the unfreed allocations. if (!m_Metadata->IsEmpty()) m_Metadata->DebugLogAllAllocations(); // This is the most important assert in the entire library. // Hitting it means you have some memory leak - unreleased virtual allocations. - VMA_ASSERT(m_Metadata->IsEmpty() && "Some virtual allocations were not freed before destruction of this virtual block!"); + VMA_ASSERT_LEAK(m_Metadata->IsEmpty() && "Some virtual allocations were not freed before destruction of this virtual block!"); vma_delete(GetAllocationCallbacks(), m_Metadata); } @@ -11337,20 +10063,22 @@ void VmaVirtualBlock_T::BuildStatsString(bool detailedMap, VmaStringBuilder& sb) // Main allocator object. struct VmaAllocator_T { - VMA_CLASS_NO_COPY(VmaAllocator_T) + VMA_CLASS_NO_COPY_NO_MOVE(VmaAllocator_T) public: - bool m_UseMutex; - uint32_t m_VulkanApiVersion; + const bool m_UseMutex; + const uint32_t m_VulkanApiVersion; bool m_UseKhrDedicatedAllocation; // Can be set only if m_VulkanApiVersion < VK_MAKE_VERSION(1, 1, 0). bool m_UseKhrBindMemory2; // Can be set only if m_VulkanApiVersion < VK_MAKE_VERSION(1, 1, 0). bool m_UseExtMemoryBudget; bool m_UseAmdDeviceCoherentMemory; bool m_UseKhrBufferDeviceAddress; bool m_UseExtMemoryPriority; - VkDevice m_hDevice; - VkInstance m_hInstance; - bool m_AllocationCallbacksSpecified; - VkAllocationCallbacks m_AllocationCallbacks; + bool m_UseKhrMaintenance4; + bool m_UseKhrMaintenance5; + const VkDevice m_hDevice; + const VkInstance m_hInstance; + const bool m_AllocationCallbacksSpecified; + const VkAllocationCallbacks m_AllocationCallbacks; VmaDeviceMemoryCallbacks m_DeviceMemoryCallbacks; VmaAllocationObjectAllocator m_AllocationObjectAllocator; @@ -11431,7 +10159,7 @@ struct VmaAllocator_T VkResult FindMemoryTypeIndex( uint32_t memoryTypeBits, const VmaAllocationCreateInfo* pAllocationCreateInfo, - VkFlags bufImgUsage, // VkBufferCreateInfo::usage or VkImageCreateInfo::usage. UINT32_MAX if unknown. + VmaBufferImageUsage bufImgUsage, uint32_t* pMemoryTypeIndex) const; // Main allocation function. @@ -11441,7 +10169,7 @@ struct VmaAllocator_T bool prefersDedicatedAllocation, VkBuffer dedicatedBuffer, VkImage dedicatedImage, - VkFlags dedicatedBufferImageUsage, // UINT32_MAX if unknown. + VmaBufferImageUsage dedicatedBufferImageUsage, const VmaAllocationCreateInfo& createInfo, VmaSuballocationType suballocType, size_t allocationCount, @@ -11462,6 +10190,7 @@ struct VmaAllocator_T #endif void GetAllocationInfo(VmaAllocation hAllocation, VmaAllocationInfo* pAllocationInfo); + void GetAllocationInfo2(VmaAllocation hAllocation, VmaAllocationInfo2* pAllocationInfo); VkResult CreatePool(const VmaPoolCreateInfo* pCreateInfo, VmaPool* pPool); void DestroyPool(VmaPool pool); @@ -11515,6 +10244,17 @@ struct VmaAllocator_T const VkDeviceSize* offsets, const VkDeviceSize* sizes, VMA_CACHE_OPERATION op); + VkResult CopyMemoryToAllocation( + const void* pSrcHostPointer, + VmaAllocation dstAllocation, + VkDeviceSize dstAllocationLocalOffset, + VkDeviceSize size); + VkResult CopyAllocationToMemory( + VmaAllocation srcAllocation, + VkDeviceSize srcAllocationLocalOffset, + void* pDstHostPointer, + VkDeviceSize size); + void FillAllocation(const VmaAllocation hAllocation, uint8_t pattern); /* @@ -11574,7 +10314,7 @@ struct VmaAllocator_T bool dedicatedPreferred, VkBuffer dedicatedBuffer, VkImage dedicatedImage, - VkFlags dedicatedBufferImageUsage, + VmaBufferImageUsage dedicatedBufferImageUsage, const VmaAllocationCreateInfo& createInfo, uint32_t memTypeIndex, VmaSuballocationType suballocType, @@ -11611,10 +10351,10 @@ struct VmaAllocator_T float priority, VkBuffer dedicatedBuffer, VkImage dedicatedImage, - VkFlags dedicatedBufferImageUsage, + VmaBufferImageUsage dedicatedBufferImageUsage, size_t allocationCount, VmaAllocation* pAllocations, - const void* pNextChain = nullptr); + const void* pNextChain = VMA_NULL); void FreeDedicatedMemory(const VmaAllocation allocation); @@ -11702,8 +10442,8 @@ VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(VmaAllocator hAllocator) VmaDeviceMemoryBlock::~VmaDeviceMemoryBlock() { - VMA_ASSERT(m_MapCount == 0 && "VkDeviceMemory block is being destroyed while it is still mapped."); - VMA_ASSERT(m_hMemory == VK_NULL_HANDLE); + VMA_ASSERT_LEAK(m_MapCount == 0 && "VkDeviceMemory block is being destroyed while it is still mapped."); + VMA_ASSERT_LEAK(m_hMemory == VK_NULL_HANDLE); } void VmaDeviceMemoryBlock::Init( @@ -11743,14 +10483,15 @@ void VmaDeviceMemoryBlock::Init( void VmaDeviceMemoryBlock::Destroy(VmaAllocator allocator) { - // Define macro VMA_DEBUG_LOG_FORMAT to receive the list of the unfreed allocations + // Define macro VMA_DEBUG_LOG_FORMAT or more specialized VMA_LEAK_LOG_FORMAT + // to receive the list of the unfreed allocations. if (!m_pMetadata->IsEmpty()) m_pMetadata->DebugLogAllAllocations(); // This is the most important assert in the entire library. // Hitting it means you have some memory leak - unreleased VmaAllocation objects. - VMA_ASSERT(m_pMetadata->IsEmpty() && "Some allocations were not freed before destruction of this memory block!"); + VMA_ASSERT_LEAK(m_pMetadata->IsEmpty() && "Some allocations were not freed before destruction of this memory block!"); - VMA_ASSERT(m_hMemory != VK_NULL_HANDLE); + VMA_ASSERT_LEAK(m_hMemory != VK_NULL_HANDLE); allocator->FreeVulkanMemory(m_MemoryTypeIndex, m_pMetadata->GetSize(), m_hMemory); m_hMemory = VK_NULL_HANDLE; @@ -11788,7 +10529,7 @@ bool VmaDeviceMemoryBlock::Validate() const VkResult VmaDeviceMemoryBlock::CheckCorruption(VmaAllocator hAllocator) { - void* pData = nullptr; + void* pData = VMA_NULL; VkResult res = Map(hAllocator, 1, &pData); if (res != VK_SUCCESS) { @@ -11811,11 +10552,11 @@ VkResult VmaDeviceMemoryBlock::Map(VmaAllocator hAllocator, uint32_t count, void VmaMutexLock lock(m_MapAndBindMutex, hAllocator->m_UseMutex); const uint32_t oldTotalMapCount = m_MapCount + m_MappingHysteresis.GetExtraMapping(); - m_MappingHysteresis.PostMap(); if (oldTotalMapCount != 0) { - m_MapCount += count; VMA_ASSERT(m_pMappedData != VMA_NULL); + m_MappingHysteresis.PostMap(); + m_MapCount += count; if (ppData != VMA_NULL) { *ppData = m_pMappedData; @@ -11833,11 +10574,13 @@ VkResult VmaDeviceMemoryBlock::Map(VmaAllocator hAllocator, uint32_t count, void &m_pMappedData); if (result == VK_SUCCESS) { + VMA_ASSERT(m_pMappedData != VMA_NULL); + m_MappingHysteresis.PostMap(); + m_MapCount = count; if (ppData != VMA_NULL) { *ppData = m_pMappedData; } - m_MapCount = count; } return result; } @@ -11954,15 +10697,11 @@ VmaAllocation_T::VmaAllocation_T(bool mappingAllowed) { if(mappingAllowed) m_Flags |= (uint8_t)FLAG_MAPPING_ALLOWED; - -#if VMA_STATS_STRING_ENABLED - m_BufferImageUsage = 0; -#endif } VmaAllocation_T::~VmaAllocation_T() { - VMA_ASSERT(m_MapCount == 0 && "Allocation was not unmapped before destruction."); + VMA_ASSERT_LEAK(m_MapCount == 0 && "Allocation was not unmapped before destruction."); // Check if owned string was freed. VMA_ASSERT(m_pName == VMA_NULL); @@ -12040,11 +10779,11 @@ uint8_t VmaAllocation_T::SwapBlockAllocation(VmaAllocator hAllocator, VmaAllocat m_BlockAllocation.m_Block->Unmap(hAllocator, m_MapCount); m_BlockAllocation.m_Block->m_pMetadata->SetAllocationUserData(m_BlockAllocation.m_AllocHandle, allocation); - VMA_SWAP(m_BlockAllocation, allocation->m_BlockAllocation); + std::swap(m_BlockAllocation, allocation->m_BlockAllocation); m_BlockAllocation.m_Block->m_pMetadata->SetAllocationUserData(m_BlockAllocation.m_AllocHandle, this); #if VMA_STATS_STRING_ENABLED - VMA_SWAP(m_BufferImageUsage, allocation->m_BufferImageUsage); + std::swap(m_BufferImageUsage, allocation->m_BufferImageUsage); #endif return m_MapCount; } @@ -12219,12 +10958,6 @@ void VmaAllocation_T::DedicatedAllocUnmap(VmaAllocator hAllocator) } #if VMA_STATS_STRING_ENABLED -void VmaAllocation_T::InitBufferImageUsage(uint32_t bufferImageUsage) -{ - VMA_ASSERT(m_BufferImageUsage == 0); - m_BufferImageUsage = bufferImageUsage; -} - void VmaAllocation_T::PrintParameters(class VmaJsonWriter& json) const { json.WriteString("Type"); @@ -12233,7 +10966,7 @@ void VmaAllocation_T::PrintParameters(class VmaJsonWriter& json) const json.WriteString("Size"); json.WriteNumber(m_Size); json.WriteString("Usage"); - json.WriteNumber(m_BufferImageUsage); + json.WriteNumber(m_BufferImageUsage.Value); // It may be uint32_t or uint64_t. if (m_pUserData != VMA_NULL) { @@ -12451,7 +11184,7 @@ VkResult VmaBlockVector::AllocatePage( pCurrBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation); if (res == VK_SUCCESS) { - VMA_DEBUG_LOG_FORMAT(" Returned from last block #%u", pCurrBlock->GetId()); + VMA_DEBUG_LOG_FORMAT(" Returned from last block #%" PRIu32, pCurrBlock->GetId()); IncrementallySortBlocks(); return VK_SUCCESS; } @@ -12487,7 +11220,7 @@ VkResult VmaBlockVector::AllocatePage( pCurrBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation); if (res == VK_SUCCESS) { - VMA_DEBUG_LOG_FORMAT(" Returned from existing block #%u", pCurrBlock->GetId()); + VMA_DEBUG_LOG_FORMAT(" Returned from existing block #%" PRIu32, pCurrBlock->GetId()); IncrementallySortBlocks(); return VK_SUCCESS; } @@ -12506,7 +11239,7 @@ VkResult VmaBlockVector::AllocatePage( pCurrBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation); if (res == VK_SUCCESS) { - VMA_DEBUG_LOG_FORMAT(" Returned from existing block #%u", pCurrBlock->GetId()); + VMA_DEBUG_LOG_FORMAT(" Returned from existing block #%" PRIu32, pCurrBlock->GetId()); IncrementallySortBlocks(); return VK_SUCCESS; } @@ -12523,7 +11256,7 @@ VkResult VmaBlockVector::AllocatePage( VkResult res = AllocateFromBlock(pCurrBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation); if (res == VK_SUCCESS) { - VMA_DEBUG_LOG_FORMAT(" Returned from existing block #%u", pCurrBlock->GetId()); + VMA_DEBUG_LOG_FORMAT(" Returned from existing block #%" PRIu32, pCurrBlock->GetId()); IncrementallySortBlocks(); return VK_SUCCESS; } @@ -12590,7 +11323,7 @@ VkResult VmaBlockVector::AllocatePage( pBlock, size, alignment, createInfo.flags, createInfo.pUserData, suballocType, strategy, pAllocation); if (res == VK_SUCCESS) { - VMA_DEBUG_LOG_FORMAT(" Created new block #%u Size=%llu", pBlock->GetId(), newBlockSize); + VMA_DEBUG_LOG_FORMAT(" Created new block #%" PRIu32 " Size=%" PRIu64, pBlock->GetId(), newBlockSize); IncrementallySortBlocks(); return VK_SUCCESS; } @@ -12639,7 +11372,7 @@ void VmaBlockVector::Free(const VmaAllocation hAllocation) pBlock->PostFree(m_hAllocator); VMA_HEAVY_ASSERT(pBlock->Validate()); - VMA_DEBUG_LOG_FORMAT(" Freed from MemoryTypeIndex=%u", m_MemoryTypeIndex); + VMA_DEBUG_LOG_FORMAT(" Freed from MemoryTypeIndex=%" PRIu32, m_MemoryTypeIndex); const bool canDeleteBlock = m_Blocks.size() > m_MinBlockCount; // pBlock became empty after this deallocation. @@ -12672,7 +11405,7 @@ void VmaBlockVector::Free(const VmaAllocation hAllocation) // lock, for performance reason. if (pBlockToDelete != VMA_NULL) { - VMA_DEBUG_LOG_FORMAT(" Deleted empty block #%u", pBlockToDelete->GetId()); + VMA_DEBUG_LOG_FORMAT(" Deleted empty block #%" PRIu32, pBlockToDelete->GetId()); pBlockToDelete->Destroy(m_hAllocator); vma_delete(m_hAllocator, pBlockToDelete); } @@ -12719,7 +11452,7 @@ void VmaBlockVector::IncrementallySortBlocks() { if (m_Blocks[i - 1]->m_pMetadata->GetSumFreeSize() > m_Blocks[i]->m_pMetadata->GetSumFreeSize()) { - VMA_SWAP(m_Blocks[i - 1], m_Blocks[i]); + std::swap(m_Blocks[i - 1], m_Blocks[i]); return; } } @@ -12947,6 +11680,8 @@ VmaDefragmentationContext_T::VmaDefragmentationContext_T( const VmaDefragmentationInfo& info) : m_MaxPassBytes(info.maxBytesPerPass == 0 ? VK_WHOLE_SIZE : info.maxBytesPerPass), m_MaxPassAllocations(info.maxAllocationsPerPass == 0 ? UINT32_MAX : info.maxAllocationsPerPass), + m_BreakCallback(info.pfnBreakCallback), + m_BreakCallbackUserData(info.pBreakCallbackUserData), m_MoveAllocator(hAllocator->GetAllocationCallbacks()), m_Moves(m_MoveAllocator) { @@ -13201,29 +11936,24 @@ VkResult VmaDefragmentationContext_T::DefragmentPassEnd(VmaDefragmentationPassMo m_PassStats.bytesFreed += freedBlockSize; } - switch (m_Algorithm) + if(m_Algorithm == VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT && + m_AlgorithmState != VMA_NULL) { - case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT: - { - if (m_AlgorithmState != VMA_NULL) + // Avoid unnecessary tries to allocate when new free block is available + StateExtensive& state = reinterpret_cast(m_AlgorithmState)[vectorIndex]; + if (state.firstFreeBlock != SIZE_MAX) { - // Avoid unnecessary tries to allocate when new free block is available - StateExtensive& state = reinterpret_cast(m_AlgorithmState)[vectorIndex]; - if (state.firstFreeBlock != SIZE_MAX) + const size_t diff = prevCount - currentCount; + if (state.firstFreeBlock >= diff) { - const size_t diff = prevCount - currentCount; - if (state.firstFreeBlock >= diff) - { - state.firstFreeBlock -= diff; - if (state.firstFreeBlock != 0) - state.firstFreeBlock -= vector->GetBlock(state.firstFreeBlock - 1)->m_pMetadata->IsEmpty(); - } - else - state.firstFreeBlock = 0; + state.firstFreeBlock -= diff; + if (state.firstFreeBlock != 0) + state.firstFreeBlock -= vector->GetBlock(state.firstFreeBlock - 1)->m_pMetadata->IsEmpty(); } + else + state.firstFreeBlock = 0; } } - } } moveInfo.moveCount = 0; moveInfo.pMoves = VMA_NULL; @@ -13259,13 +11989,13 @@ VkResult VmaDefragmentationContext_T::DefragmentPassEnd(VmaDefragmentationPassMo { if (vector->GetBlock(i) == block.block) { - VMA_SWAP(vector->m_Blocks[i], vector->m_Blocks[vector->GetBlockCount() - ++m_ImmovableBlockCount]); + std::swap(vector->m_Blocks[i], vector->m_Blocks[vector->GetBlockCount() - ++m_ImmovableBlockCount]); if (state.firstFreeBlock != SIZE_MAX) { if (i + 1 < state.firstFreeBlock) { if (state.firstFreeBlock > 1) - VMA_SWAP(vector->m_Blocks[i], vector->m_Blocks[--state.firstFreeBlock]); + std::swap(vector->m_Blocks[i], vector->m_Blocks[--state.firstFreeBlock]); else --state.firstFreeBlock; } @@ -13292,7 +12022,7 @@ VkResult VmaDefragmentationContext_T::DefragmentPassEnd(VmaDefragmentationPassMo { if (vector->GetBlock(i) == block.block) { - VMA_SWAP(vector->m_Blocks[i], vector->m_Blocks[m_ImmovableBlockCount++]); + std::swap(vector->m_Blocks[i], vector->m_Blocks[m_ImmovableBlockCount++]); break; } } @@ -13347,6 +12077,10 @@ VmaDefragmentationContext_T::MoveAllocationData VmaDefragmentationContext_T::Get VmaDefragmentationContext_T::CounterStatus VmaDefragmentationContext_T::CheckCounters(VkDeviceSize bytes) { + // Check custom criteria if exists + if (m_BreakCallback && m_BreakCallback(m_BreakCallbackUserData)) + return CounterStatus::End; + // Ignore allocation if will exceed max size for copy if (m_PassStats.bytesMoved + bytes > m_MaxPassBytes) { @@ -13355,6 +12089,8 @@ VmaDefragmentationContext_T::CounterStatus VmaDefragmentationContext_T::CheckCou else return CounterStatus::End; } + else + m_IgnoredAllocs = 0; return CounterStatus::Pass; } @@ -13714,7 +12450,7 @@ bool VmaDefragmentationContext_T::ComputeDefragmentation_Extensive(VmaBlockVecto { // Full clear performed already if (prevMoveCount != m_Moves.size() && freeMetadata->GetNextAllocation(handle) == VK_NULL_HANDLE) - reinterpret_cast(m_AlgorithmState)[index] = last; + vectorState.firstFreeBlock = last; return true; } } @@ -13784,6 +12520,7 @@ bool VmaDefragmentationContext_T::ComputeDefragmentation_Extensive(VmaBlockVecto } else break; + VMA_FALLTHROUGH; // Fallthrough } case StateExtensive::Operation::MoveBuffers: { @@ -13808,6 +12545,7 @@ bool VmaDefragmentationContext_T::ComputeDefragmentation_Extensive(VmaBlockVecto } else break; + VMA_FALLTHROUGH; // Fallthrough } case StateExtensive::Operation::MoveAll: { @@ -13940,6 +12678,9 @@ VmaPool_T::VmaPool_T( VmaPool_T::~VmaPool_T() { VMA_ASSERT(m_PrevPool == VMA_NULL && m_NextPool == VMA_NULL); + + const VkAllocationCallbacks* allocs = m_BlockVector.GetAllocator()->GetAllocationCallbacks(); + VmaFreeString(allocs, m_Name); } void VmaPool_T::SetName(const char* pName) @@ -13968,6 +12709,8 @@ VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) : m_UseAmdDeviceCoherentMemory((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT) != 0), m_UseKhrBufferDeviceAddress((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT) != 0), m_UseExtMemoryPriority((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT) != 0), + m_UseKhrMaintenance4((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT) != 0), + m_UseKhrMaintenance5((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT) != 0), m_hDevice(pCreateInfo->device), m_hInstance(pCreateInfo->instance), m_AllocationCallbacksSpecified(pCreateInfo->pAllocationCallbacks != VMA_NULL), @@ -14047,6 +12790,18 @@ VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) : VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT is set but required extension is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro."); } #endif +#if !(VMA_KHR_MAINTENANCE4) + if(m_UseKhrMaintenance4) + { + VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT is set but required extension is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro."); + } +#endif +#if !(VMA_KHR_MAINTENANCE5) + if(m_UseKhrMaintenance5) + { + VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT is set but required extension is not available in your Vulkan header or its support in VMA has been disabled by a preprocessor macro."); + } +#endif memset(&m_DeviceMemoryCallbacks, 0 ,sizeof(m_DeviceMemoryCallbacks)); memset(&m_PhysicalDeviceProperties, 0, sizeof(m_PhysicalDeviceProperties)); @@ -14125,7 +12880,7 @@ VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) : GetMemoryTypeMinAlignment(memTypeIndex), // minAllocationAlignment VMA_NULL); // // pMemoryAllocateNext // No need to call m_pBlockVectors[memTypeIndex][blockVectorTypeIndex]->CreateMinBlocks here, - // becase minBlockCount is 0. + // because minBlockCount is 0. } } } @@ -14205,6 +12960,12 @@ void VmaAllocator_T::ImportVulkanFunctions_Static() m_VulkanFunctions.vkGetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2)vkGetImageMemoryRequirements2; m_VulkanFunctions.vkBindBufferMemory2KHR = (PFN_vkBindBufferMemory2)vkBindBufferMemory2; m_VulkanFunctions.vkBindImageMemory2KHR = (PFN_vkBindImageMemory2)vkBindImageMemory2; + } +#endif + +#if VMA_VULKAN_VERSION >= 1001000 + if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) + { m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties2KHR = (PFN_vkGetPhysicalDeviceMemoryProperties2)vkGetPhysicalDeviceMemoryProperties2; } #endif @@ -14257,11 +13018,11 @@ void VmaAllocator_T::ImportVulkanFunctions_Custom(const VmaVulkanFunctions* pVul VMA_COPY_IF_NOT_NULL(vkBindImageMemory2KHR); #endif -#if VMA_MEMORY_BUDGET +#if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000 VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceMemoryProperties2KHR); #endif -#if VMA_VULKAN_VERSION >= 1003000 +#if VMA_KHR_MAINTENANCE4 || VMA_VULKAN_VERSION >= 1003000 VMA_COPY_IF_NOT_NULL(vkGetDeviceBufferMemoryRequirements); VMA_COPY_IF_NOT_NULL(vkGetDeviceImageMemoryRequirements); #endif @@ -14312,7 +13073,17 @@ void VmaAllocator_T::ImportVulkanFunctions_Dynamic() VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements2KHR, PFN_vkGetImageMemoryRequirements2, "vkGetImageMemoryRequirements2"); VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory2KHR, PFN_vkBindBufferMemory2, "vkBindBufferMemory2"); VMA_FETCH_DEVICE_FUNC(vkBindImageMemory2KHR, PFN_vkBindImageMemory2, "vkBindImageMemory2"); - VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2, "vkGetPhysicalDeviceMemoryProperties2"); + } +#endif + +#if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000 + if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) + { + VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2KHR, "vkGetPhysicalDeviceMemoryProperties2"); + } + else if(m_UseExtMemoryBudget) + { + VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2KHR, "vkGetPhysicalDeviceMemoryProperties2KHR"); } #endif @@ -14332,8 +13103,12 @@ void VmaAllocator_T::ImportVulkanFunctions_Dynamic() } #endif // #if VMA_BIND_MEMORY2 -#if VMA_MEMORY_BUDGET - if(m_UseExtMemoryBudget) +#if VMA_MEMORY_BUDGET || VMA_VULKAN_VERSION >= 1001000 + if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) + { + VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2KHR, "vkGetPhysicalDeviceMemoryProperties2"); + } + else if(m_UseExtMemoryBudget) { VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2KHR, "vkGetPhysicalDeviceMemoryProperties2KHR"); } @@ -14346,6 +13121,13 @@ void VmaAllocator_T::ImportVulkanFunctions_Dynamic() VMA_FETCH_DEVICE_FUNC(vkGetDeviceImageMemoryRequirements, PFN_vkGetDeviceImageMemoryRequirements, "vkGetDeviceImageMemoryRequirements"); } #endif +#if VMA_KHR_MAINTENANCE4 + if(m_UseKhrMaintenance4) + { + VMA_FETCH_DEVICE_FUNC(vkGetDeviceBufferMemoryRequirements, PFN_vkGetDeviceBufferMemoryRequirementsKHR, "vkGetDeviceBufferMemoryRequirementsKHR"); + VMA_FETCH_DEVICE_FUNC(vkGetDeviceImageMemoryRequirements, PFN_vkGetDeviceImageMemoryRequirementsKHR, "vkGetDeviceImageMemoryRequirementsKHR"); + } +#endif #undef VMA_FETCH_DEVICE_FUNC #undef VMA_FETCH_INSTANCE_FUNC @@ -14396,13 +13178,12 @@ void VmaAllocator_T::ValidateVulkanFunctions() } #endif -#if VMA_VULKAN_VERSION >= 1003000 - if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 3, 0)) - { - VMA_ASSERT(m_VulkanFunctions.vkGetDeviceBufferMemoryRequirements != VMA_NULL); - VMA_ASSERT(m_VulkanFunctions.vkGetDeviceImageMemoryRequirements != VMA_NULL); - } -#endif + // Not validating these due to suspected driver bugs with these function + // pointers being null despite correct extension or Vulkan version is enabled. + // See issue #397. Their usage in VMA is optional anyway. + // + // VMA_ASSERT(m_VulkanFunctions.vkGetDeviceBufferMemoryRequirements != VMA_NULL); + // VMA_ASSERT(m_VulkanFunctions.vkGetDeviceImageMemoryRequirements != VMA_NULL); } VkDeviceSize VmaAllocator_T::CalcPreferredBlockSize(uint32_t memTypeIndex) @@ -14420,7 +13201,7 @@ VkResult VmaAllocator_T::AllocateMemoryOfType( bool dedicatedPreferred, VkBuffer dedicatedBuffer, VkImage dedicatedImage, - VkFlags dedicatedBufferImageUsage, + VmaBufferImageUsage dedicatedBufferImageUsage, const VmaAllocationCreateInfo& createInfo, uint32_t memTypeIndex, VmaSuballocationType suballocType, @@ -14430,7 +13211,7 @@ VkResult VmaAllocator_T::AllocateMemoryOfType( VmaAllocation* pAllocations) { VMA_ASSERT(pAllocations != VMA_NULL); - VMA_DEBUG_LOG_FORMAT(" AllocateMemory: MemoryTypeIndex=%u, AllocationCount=%zu, Size=%llu", memTypeIndex, allocationCount, size); + VMA_DEBUG_LOG_FORMAT(" AllocateMemory: MemoryTypeIndex=%" PRIu32 ", AllocationCount=%zu, Size=%" PRIu64, memTypeIndex, allocationCount, size); VmaAllocationCreateInfo finalCreateInfo = createInfo; VkResult res = CalcMemTypeParams( @@ -14574,7 +13355,7 @@ VkResult VmaAllocator_T::AllocateDedicatedMemory( float priority, VkBuffer dedicatedBuffer, VkImage dedicatedImage, - VkFlags dedicatedBufferImageUsage, + VmaBufferImageUsage dedicatedBufferImageUsage, size_t allocationCount, VmaAllocation* pAllocations, const void* pNextChain) @@ -14614,8 +13395,8 @@ VkResult VmaAllocator_T::AllocateDedicatedMemory( bool canContainBufferWithDeviceAddress = true; if(dedicatedBuffer != VK_NULL_HANDLE) { - canContainBufferWithDeviceAddress = dedicatedBufferImageUsage == UINT32_MAX || // Usage flags unknown - (dedicatedBufferImageUsage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT) != 0; + canContainBufferWithDeviceAddress = dedicatedBufferImageUsage == VmaBufferImageUsage::UNKNOWN || + dedicatedBufferImageUsage.Contains(VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT); } else if(dedicatedImage != VK_NULL_HANDLE) { @@ -14676,7 +13457,7 @@ VkResult VmaAllocator_T::AllocateDedicatedMemory( { dedicatedAllocations.Register(pAllocations[allocIndex]); } - VMA_DEBUG_LOG_FORMAT(" Allocated DedicatedMemory Count=%zu, MemoryTypeIndex=#%u", allocationCount, memTypeIndex); + VMA_DEBUG_LOG_FORMAT(" Allocated DedicatedMemory Count=%zu, MemoryTypeIndex=#%" PRIu32, allocationCount, memTypeIndex); } else { @@ -14827,7 +13608,7 @@ void VmaAllocator_T::GetImageMemoryRequirements( VkResult VmaAllocator_T::FindMemoryTypeIndex( uint32_t memoryTypeBits, const VmaAllocationCreateInfo* pAllocationCreateInfo, - VkFlags bufImgUsage, + VmaBufferImageUsage bufImgUsage, uint32_t* pMemoryTypeIndex) const { memoryTypeBits &= GetGlobalMemoryTypeBits(); @@ -14982,7 +13763,7 @@ VkResult VmaAllocator_T::AllocateMemory( bool prefersDedicatedAllocation, VkBuffer dedicatedBuffer, VkImage dedicatedImage, - VkFlags dedicatedBufferImageUsage, + VmaBufferImageUsage dedicatedBufferImageUsage, const VmaAllocationCreateInfo& createInfo, VmaSuballocationType suballocType, size_t allocationCount, @@ -15232,9 +14013,28 @@ void VmaAllocator_T::GetAllocationInfo(VmaAllocation hAllocation, VmaAllocationI pAllocationInfo->pName = hAllocation->GetName(); } +void VmaAllocator_T::GetAllocationInfo2(VmaAllocation hAllocation, VmaAllocationInfo2* pAllocationInfo) +{ + GetAllocationInfo(hAllocation, &pAllocationInfo->allocationInfo); + + switch (hAllocation->GetType()) + { + case VmaAllocation_T::ALLOCATION_TYPE_BLOCK: + pAllocationInfo->blockSize = hAllocation->GetBlock()->m_pMetadata->GetSize(); + pAllocationInfo->dedicatedMemory = VK_FALSE; + break; + case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: + pAllocationInfo->blockSize = pAllocationInfo->allocationInfo.size; + pAllocationInfo->dedicatedMemory = VK_TRUE; + break; + default: + VMA_ASSERT(0); + } +} + VkResult VmaAllocator_T::CreatePool(const VmaPoolCreateInfo* pCreateInfo, VmaPool* pPool) { - VMA_DEBUG_LOG_FORMAT(" CreatePool: MemoryTypeIndex=%u, flags=%u", pCreateInfo->memoryTypeIndex, pCreateInfo->flags); + VMA_DEBUG_LOG_FORMAT(" CreatePool: MemoryTypeIndex=%" PRIu32 ", flags=%" PRIu32, pCreateInfo->memoryTypeIndex, pCreateInfo->flags); VmaPoolCreateInfo newCreateInfo = *pCreateInfo; @@ -15535,6 +14335,7 @@ VkResult VmaAllocator_T::Map(VmaAllocation hAllocation, void** ppData) } return res; } + VMA_FALLTHROUGH; // Fallthrough case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: return hAllocation->DedicatedAllocMap(this, ppData); default: @@ -15568,7 +14369,7 @@ VkResult VmaAllocator_T::BindBufferMemory( VkBuffer hBuffer, const void* pNext) { - VkResult res = VK_ERROR_UNKNOWN; + VkResult res = VK_ERROR_UNKNOWN_COPY; switch(hAllocation->GetType()) { case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: @@ -15593,7 +14394,7 @@ VkResult VmaAllocator_T::BindImageMemory( VkImage hImage, const void* pNext) { - VkResult res = VK_ERROR_UNKNOWN; + VkResult res = VK_ERROR_UNKNOWN_COPY; switch(hAllocation->GetType()) { case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED: @@ -15679,6 +14480,43 @@ VkResult VmaAllocator_T::FlushOrInvalidateAllocations( return res; } +VkResult VmaAllocator_T::CopyMemoryToAllocation( + const void* pSrcHostPointer, + VmaAllocation dstAllocation, + VkDeviceSize dstAllocationLocalOffset, + VkDeviceSize size) +{ + void* dstMappedData = VMA_NULL; + VkResult res = Map(dstAllocation, &dstMappedData); + if(res == VK_SUCCESS) + { + memcpy((char*)dstMappedData + dstAllocationLocalOffset, pSrcHostPointer, (size_t)size); + Unmap(dstAllocation); + res = FlushOrInvalidateAllocation(dstAllocation, dstAllocationLocalOffset, size, VMA_CACHE_FLUSH); + } + return res; +} + +VkResult VmaAllocator_T::CopyAllocationToMemory( + VmaAllocation srcAllocation, + VkDeviceSize srcAllocationLocalOffset, + void* pDstHostPointer, + VkDeviceSize size) +{ + void* srcMappedData = VMA_NULL; + VkResult res = Map(srcAllocation, &srcMappedData); + if(res == VK_SUCCESS) + { + res = FlushOrInvalidateAllocation(srcAllocation, srcAllocationLocalOffset, size, VMA_CACHE_INVALIDATE); + if(res == VK_SUCCESS) + { + memcpy(pDstHostPointer, (const char*)srcMappedData + srcAllocationLocalOffset, (size_t)size); + Unmap(srcAllocation); + } + } + return res; +} + void VmaAllocator_T::FreeDedicatedMemory(const VmaAllocation allocation) { VMA_ASSERT(allocation && allocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED); @@ -15713,7 +14551,7 @@ void VmaAllocator_T::FreeDedicatedMemory(const VmaAllocation allocation) m_Budget.RemoveAllocation(MemoryTypeIndexToHeapIndex(allocation->GetMemoryTypeIndex()), allocation->GetSize()); m_AllocationObjectAllocator.Free(allocation); - VMA_DEBUG_LOG_FORMAT(" Freed DedicatedMemory MemoryTypeIndex=%u", memTypeIndex); + VMA_DEBUG_LOG_FORMAT(" Freed DedicatedMemory MemoryTypeIndex=%" PRIu32, memTypeIndex); } uint32_t VmaAllocator_T::CalculateGpuDefragmentationMemoryTypeBits() const @@ -16298,7 +15136,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndex( VMA_ASSERT(pAllocationCreateInfo != VMA_NULL); VMA_ASSERT(pMemoryTypeIndex != VMA_NULL); - return allocator->FindMemoryTypeIndex(memoryTypeBits, pAllocationCreateInfo, UINT32_MAX, pMemoryTypeIndex); + return allocator->FindMemoryTypeIndex(memoryTypeBits, pAllocationCreateInfo, VmaBufferImageUsage::UNKNOWN, pMemoryTypeIndex); } VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo( @@ -16316,21 +15154,22 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo( const VmaVulkanFunctions* funcs = &allocator->GetVulkanFunctions(); VkResult res; -#if VMA_VULKAN_VERSION >= 1003000 +#if VMA_KHR_MAINTENANCE4 || VMA_VULKAN_VERSION >= 1003000 if(funcs->vkGetDeviceBufferMemoryRequirements) { // Can query straight from VkBufferCreateInfo :) - VkDeviceBufferMemoryRequirements devBufMemReq = {VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS}; + VkDeviceBufferMemoryRequirementsKHR devBufMemReq = {VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR}; devBufMemReq.pCreateInfo = pBufferCreateInfo; VkMemoryRequirements2 memReq = {VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2}; (*funcs->vkGetDeviceBufferMemoryRequirements)(hDev, &devBufMemReq, &memReq); res = allocator->FindMemoryTypeIndex( - memReq.memoryRequirements.memoryTypeBits, pAllocationCreateInfo, pBufferCreateInfo->usage, pMemoryTypeIndex); + memReq.memoryRequirements.memoryTypeBits, pAllocationCreateInfo, + VmaBufferImageUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5), pMemoryTypeIndex); } else -#endif // #if VMA_VULKAN_VERSION >= 1003000 +#endif // VMA_KHR_MAINTENANCE4 || VMA_VULKAN_VERSION >= 1003000 { // Must create a dummy buffer to query :( VkBuffer hBuffer = VK_NULL_HANDLE; @@ -16342,7 +15181,8 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo( funcs->vkGetBufferMemoryRequirements(hDev, hBuffer, &memReq); res = allocator->FindMemoryTypeIndex( - memReq.memoryTypeBits, pAllocationCreateInfo, pBufferCreateInfo->usage, pMemoryTypeIndex); + memReq.memoryTypeBits, pAllocationCreateInfo, + VmaBufferImageUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5), pMemoryTypeIndex); funcs->vkDestroyBuffer( hDev, hBuffer, allocator->GetAllocationCallbacks()); @@ -16366,11 +15206,11 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo( const VmaVulkanFunctions* funcs = &allocator->GetVulkanFunctions(); VkResult res; -#if VMA_VULKAN_VERSION >= 1003000 +#if VMA_KHR_MAINTENANCE4 || VMA_VULKAN_VERSION >= 1003000 if(funcs->vkGetDeviceImageMemoryRequirements) { // Can query straight from VkImageCreateInfo :) - VkDeviceImageMemoryRequirements devImgMemReq = {VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS}; + VkDeviceImageMemoryRequirementsKHR devImgMemReq = {VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR}; devImgMemReq.pCreateInfo = pImageCreateInfo; VMA_ASSERT(pImageCreateInfo->tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT_COPY && (pImageCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT_COPY) == 0 && "Cannot use this VkImageCreateInfo with vmaFindMemoryTypeIndexForImageInfo as I don't know what to pass as VkDeviceImageMemoryRequirements::planeAspect."); @@ -16379,10 +15219,11 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo( (*funcs->vkGetDeviceImageMemoryRequirements)(hDev, &devImgMemReq, &memReq); res = allocator->FindMemoryTypeIndex( - memReq.memoryRequirements.memoryTypeBits, pAllocationCreateInfo, pImageCreateInfo->usage, pMemoryTypeIndex); + memReq.memoryRequirements.memoryTypeBits, pAllocationCreateInfo, + VmaBufferImageUsage(*pImageCreateInfo), pMemoryTypeIndex); } else -#endif // #if VMA_VULKAN_VERSION >= 1003000 +#endif // VMA_KHR_MAINTENANCE4 || VMA_VULKAN_VERSION >= 1003000 { // Must create a dummy image to query :( VkImage hImage = VK_NULL_HANDLE; @@ -16394,7 +15235,8 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo( funcs->vkGetImageMemoryRequirements(hDev, hImage, &memReq); res = allocator->FindMemoryTypeIndex( - memReq.memoryTypeBits, pAllocationCreateInfo, pImageCreateInfo->usage, pMemoryTypeIndex); + memReq.memoryTypeBits, pAllocationCreateInfo, + VmaBufferImageUsage(*pImageCreateInfo), pMemoryTypeIndex); funcs->vkDestroyImage( hDev, hImage, allocator->GetAllocationCallbacks()); @@ -16517,7 +15359,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory( false, // prefersDedicatedAllocation VK_NULL_HANDLE, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage - UINT32_MAX, // dedicatedBufferImageUsage + VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage *pCreateInfo, VMA_SUBALLOCATION_TYPE_UNKNOWN, 1, // allocationCount @@ -16556,7 +15398,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages( false, // prefersDedicatedAllocation VK_NULL_HANDLE, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage - UINT32_MAX, // dedicatedBufferImageUsage + VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage *pCreateInfo, VMA_SUBALLOCATION_TYPE_UNKNOWN, allocationCount, @@ -16599,7 +15441,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer( prefersDedicatedAllocation, buffer, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage - UINT32_MAX, // dedicatedBufferImageUsage + VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage *pCreateInfo, VMA_SUBALLOCATION_TYPE_BUFFER, 1, // allocationCount @@ -16638,7 +15480,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage( prefersDedicatedAllocation, VK_NULL_HANDLE, // dedicatedBuffer image, // dedicatedImage - UINT32_MAX, // dedicatedBufferImageUsage + VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage *pCreateInfo, VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN, 1, // allocationCount @@ -16703,6 +15545,18 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo( allocator->GetAllocationInfo(allocation, pAllocationInfo); } +VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo2( + VmaAllocator allocator, + VmaAllocation allocation, + VmaAllocationInfo2* pAllocationInfo) +{ + VMA_ASSERT(allocator && allocation && pAllocationInfo); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + allocator->GetAllocationInfo2(allocation, pAllocationInfo); +} + VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationUserData( VmaAllocator allocator, VmaAllocation allocation, @@ -16768,9 +15622,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocation( VMA_DEBUG_GLOBAL_MUTEX_LOCK - const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_FLUSH); - - return res; + return allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_FLUSH); } VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocation( @@ -16785,9 +15637,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocation( VMA_DEBUG_GLOBAL_MUTEX_LOCK - const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_INVALIDATE); - - return res; + return allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_INVALIDATE); } VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocations( @@ -16810,9 +15660,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocations( VMA_DEBUG_GLOBAL_MUTEX_LOCK - const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_FLUSH); - - return res; + return allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_FLUSH); } VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocations( @@ -16835,9 +15683,49 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocations( VMA_DEBUG_GLOBAL_MUTEX_LOCK - const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_INVALIDATE); + return allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_INVALIDATE); +} - return res; +VMA_CALL_PRE VkResult VMA_CALL_POST vmaCopyMemoryToAllocation( + VmaAllocator allocator, + const void* pSrcHostPointer, + VmaAllocation dstAllocation, + VkDeviceSize dstAllocationLocalOffset, + VkDeviceSize size) +{ + VMA_ASSERT(allocator && pSrcHostPointer && dstAllocation); + + if(size == 0) + { + return VK_SUCCESS; + } + + VMA_DEBUG_LOG("vmaCopyMemoryToAllocation"); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + return allocator->CopyMemoryToAllocation(pSrcHostPointer, dstAllocation, dstAllocationLocalOffset, size); +} + +VMA_CALL_PRE VkResult VMA_CALL_POST vmaCopyAllocationToMemory( + VmaAllocator allocator, + VmaAllocation srcAllocation, + VkDeviceSize srcAllocationLocalOffset, + void* pDstHostPointer, + VkDeviceSize size) +{ + VMA_ASSERT(allocator && srcAllocation && pDstHostPointer); + + if(size == 0) + { + return VK_SUCCESS; + } + + VMA_DEBUG_LOG("vmaCopyAllocationToMemory"); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + return allocator->CopyAllocationToMemory(srcAllocation, srcAllocationLocalOffset, pDstHostPointer, size); } VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption( @@ -17029,7 +15917,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer( prefersDedicatedAllocation, *pBuffer, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage - pBufferCreateInfo->usage, // dedicatedBufferImageUsage + VmaBufferImageUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5), // dedicatedBufferImageUsage *pAllocationCreateInfo, VMA_SUBALLOCATION_TYPE_BUFFER, 1, // allocationCount @@ -17046,7 +15934,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer( { // All steps succeeded. #if VMA_STATS_STRING_ENABLED - (*pAllocation)->InitBufferImageUsage(pBufferCreateInfo->usage); + (*pAllocation)->InitBufferUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5); #endif if(pAllocationInfo != VMA_NULL) { @@ -17124,7 +16012,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment( prefersDedicatedAllocation, *pBuffer, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage - pBufferCreateInfo->usage, // dedicatedBufferImageUsage + VmaBufferImageUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5), // dedicatedBufferImageUsage *pAllocationCreateInfo, VMA_SUBALLOCATION_TYPE_BUFFER, 1, // allocationCount @@ -17141,7 +16029,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment( { // All steps succeeded. #if VMA_STATS_STRING_ENABLED - (*pAllocation)->InitBufferImageUsage(pBufferCreateInfo->usage); + (*pAllocation)->InitBufferUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5); #endif if(pAllocationInfo != VMA_NULL) { @@ -17300,7 +16188,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage( prefersDedicatedAllocation, VK_NULL_HANDLE, // dedicatedBuffer *pImage, // dedicatedImage - pImageCreateInfo->usage, // dedicatedBufferImageUsage + VmaBufferImageUsage(*pImageCreateInfo), // dedicatedBufferImageUsage *pAllocationCreateInfo, suballocType, 1, // allocationCount @@ -17317,7 +16205,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage( { // All steps succeeded. #if VMA_STATS_STRING_ENABLED - (*pAllocation)->InitBufferImageUsage(pImageCreateInfo->usage); + (*pAllocation)->InitImageUsage(*pImageCreateInfo); #endif if(pAllocationInfo != VMA_NULL) { @@ -17556,13 +16444,14 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeVirtualBlockStatsString(VmaVirtualBlock V \section quick_start_project_setup Project setup Vulkan Memory Allocator comes in form of a "stb-style" single header file. -You don't need to build it as a separate library project. -You can add this file directly to your project and submit it to code repository next to your other source files. +While you can pull the entire repository e.g. as Git module, there is also Cmake script provided, +you don't need to build it as a separate library project. +You can add file "vk_mem_alloc.h" directly to your project and submit it to code repository next to your other source files. "Single header" doesn't mean that everything is contained in C/C++ declarations, like it tends to be in case of inline functions or C++ templates. It means that implementation is bundled with interface in a single file and needs to be extracted using preprocessor macro. -If you don't do it properly, you will get linker errors. +If you don't do it properly, it will result in linker errors. To do it properly: @@ -17576,33 +16465,46 @@ To do it properly: #include "vk_mem_alloc.h" \endcode -It may be a good idea to create dedicated CPP file just for this purpose. +It may be a good idea to create dedicated CPP file just for this purpose, e.g. "VmaUsage.cpp". This library includes header ``, which in turn includes `` on Windows. If you need some specific macros defined before including these headers (like `WIN32_LEAN_AND_MEAN` or `WINVER` for Windows, `VK_USE_PLATFORM_WIN32_KHR` for Vulkan), you must define them before every `#include` of this library. +It may be a good idea to create a dedicate header file for this purpose, e.g. "VmaUsage.h", +that will be included in other source files instead of VMA header directly. This library is written in C++, but has C-compatible interface. -Thus you can include and use vk_mem_alloc.h in C or C++ code, but full +Thus, you can include and use "vk_mem_alloc.h" in C or C++ code, but full implementation with `VMA_IMPLEMENTATION` macro must be compiled as C++, NOT as C. -Some features of C++14 are used. STL containers, RTTI, or C++ exceptions are not used. +Some features of C++14 are used and required. Features of C++20 are used optionally when available. +Some headers of standard C and C++ library are used, but STL containers, RTTI, or C++ exceptions are not used. \section quick_start_initialization Initialization +VMA offers library interface in a style similar to Vulkan, with object handles like #VmaAllocation, +structures describing parameters of objects to be created like #VmaAllocationCreateInfo, +and errors codes returned from functions using `VkResult` type. + +The first and the main object that needs to be created is #VmaAllocator. +It represents the initialization of the entire library. +Only one such object should be created per `VkDevice`. +You should create it at program startup, after `VkDevice` was created, and before any device memory allocator needs to be made. +It must be destroyed before `VkDevice` is destroyed. + At program startup: --# Initialize Vulkan to have `VkPhysicalDevice`, `VkDevice` and `VkInstance` object. --# Fill VmaAllocatorCreateInfo structure and create #VmaAllocator object by - calling vmaCreateAllocator(). +-# Initialize Vulkan to have `VkInstance`, `VkPhysicalDevice`, `VkDevice` object. +-# Fill VmaAllocatorCreateInfo structure and call vmaCreateAllocator() to create #VmaAllocator object. Only members `physicalDevice`, `device`, `instance` are required. However, you should inform the library which Vulkan version do you use by setting VmaAllocatorCreateInfo::vulkanApiVersion and which extensions did you enable -by setting VmaAllocatorCreateInfo::flags (like #VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT for VK_KHR_buffer_device_address). +by setting VmaAllocatorCreateInfo::flags. Otherwise, VMA would use only features of Vulkan 1.0 core with no extensions. +See below for details. \subsection quick_start_initialization_selecting_vulkan_version Selecting Vulkan version @@ -17648,7 +16550,25 @@ You may need to configure importing Vulkan functions. There are 3 ways to do thi - Define `VMA_STATIC_VULKAN_FUNCTIONS` and `VMA_DYNAMIC_VULKAN_FUNCTIONS` to 0. - Pass these pointers via structure #VmaVulkanFunctions. -Example for case 2: +\subsection quick_start_initialization_enabling_extensions Enabling extensions + +VMA can automatically use following Vulkan extensions. +If you found them available on the selected physical device and you enabled them +while creating `VkInstance` / `VkDevice` object, inform VMA about their availability +by setting appropriate flags in VmaAllocatorCreateInfo::flags. + +Vulkan extension | VMA flag +------------------------------|----------------------------------------------------- +VK_KHR_dedicated_allocation | #VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT +VK_KHR_bind_memory2 | #VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT +VK_KHR_maintenance4 | #VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT +VK_KHR_maintenance5 | #VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT +VK_EXT_memory_budget | #VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT +VK_KHR_buffer_device_address | #VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT +VK_EXT_memory_priority | #VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT +VK_AMD_device_coherent_memory | #VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT + +Example with fetching pointers to Vulkan functions dynamically: \code #define VMA_STATIC_VULKAN_FUNCTIONS 0 @@ -17662,6 +16582,7 @@ vulkanFunctions.vkGetInstanceProcAddr = &vkGetInstanceProcAddr; vulkanFunctions.vkGetDeviceProcAddr = &vkGetDeviceProcAddr; VmaAllocatorCreateInfo allocatorCreateInfo = {}; +allocatorCreateInfo.flags = VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT; allocatorCreateInfo.vulkanApiVersion = VK_API_VERSION_1_2; allocatorCreateInfo.physicalDevice = physicalDevice; allocatorCreateInfo.device = device; @@ -17670,9 +16591,24 @@ allocatorCreateInfo.pVulkanFunctions = &vulkanFunctions; VmaAllocator allocator; vmaCreateAllocator(&allocatorCreateInfo, &allocator); + +// Entire program... + +// At the end, don't forget to: +vmaDestroyAllocator(allocator); \endcode +\subsection quick_start_initialization_other_config Other configuration options + +There are additional configuration options available through preprocessor macros that you can define +before including VMA header and through parameters passed in #VmaAllocatorCreateInfo. +They include a possibility to use your own callbacks for host memory allocations (`VkAllocationCallbacks`), +callbacks for device memory allocations (instead of `vkAllocateMemory`, `vkFreeMemory`), +or your custom `VMA_ASSERT` macro, among others. +For more information, see: @ref configuration. + + \section quick_start_resource_allocation Resource allocation When you want to create a buffer or image: @@ -17695,13 +16631,19 @@ VmaAllocation allocation; vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr); \endcode -Don't forget to destroy your objects when no longer needed: +Don't forget to destroy your buffer and allocation objects when no longer needed: \code vmaDestroyBuffer(allocator, buffer, allocation); -vmaDestroyAllocator(allocator); \endcode +If you need to map the buffer, you must set flag +#VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT +in VmaAllocationCreateInfo::flags. +There are many additional parameters that can control the choice of memory type to be used for the allocation +and other features. +For more information, see documentation chapters: @ref choosing_memory_type, @ref memory_mapping. + \page choosing_memory_type Choosing memory type @@ -17724,10 +16666,10 @@ You can also combine multiple methods. vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(). For binding you should use functions: vmaBindBufferMemory(), vmaBindImageMemory() or their extended versions: vmaBindBufferMemory2(), vmaBindImageMemory2(). --# **This is the easiest and recommended way to use this library:** - If you want to create a buffer or an image, allocate memory for it and bind +-# If you want to create a buffer or an image, allocate memory for it, and bind them together, all in one call, you can use function vmaCreateBuffer(), vmaCreateImage(). + This is the easiest and recommended way to use this library! When using 3. or 4., the library internally queries Vulkan for memory types supported for that buffer or image (function `vkGetBufferMemoryRequirements()`) @@ -17795,6 +16737,7 @@ vmaCreateBuffer(allocator, &stagingBufferInfo, &stagingAllocInfo, &stagingBuffer \endcode For more examples of creating different kinds of resources, see chapter \ref usage_patterns. +See also: @ref memory_mapping. Usage values `VMA_MEMORY_USAGE_AUTO*` are legal to use only when the library knows about the resource being created by having `VkBufferCreateInfo` / `VkImageCreateInfo` passed, @@ -17806,7 +16749,7 @@ memory type, as described below. Old usage values (`VMA_MEMORY_USAGE_GPU_ONLY`, `VMA_MEMORY_USAGE_CPU_ONLY`, `VMA_MEMORY_USAGE_CPU_TO_GPU`, `VMA_MEMORY_USAGE_GPU_TO_CPU`, `VMA_MEMORY_USAGE_CPU_COPY`) are still available and work same way as in previous versions of the library -for backward compatibility, but they are not recommended. +for backward compatibility, but they are deprecated. \section choosing_memory_type_required_preferred_flags Required and preferred flags @@ -17836,8 +16779,8 @@ plus some extra "magic" (heuristics). \section choosing_memory_type_explicit_memory_types Explicit memory types -If you inspected memory types available on the physical device and you have -a preference for memory types that you want to use, you can fill member +If you inspected memory types available on the physical device and you have +a preference for memory types that you want to use, you can fill member VmaAllocationCreateInfo::memoryTypeBits. It is a bit mask, where each bit set means that a memory type with that index is allowed to be used for the allocation. Special value 0, just like `UINT32_MAX`, means there are no @@ -17859,6 +16802,21 @@ VmaAllocation allocation; vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr); \endcode +You can also use this parameter to exclude some memory types. +If you inspect memory heaps and types available on the current physical device and +you determine that for some reason you don't want to use a specific memory type for the allocation, +you can enable automatic memory type selection but exclude certain memory type or types +by setting all bits of `memoryTypeBits` to 1 except the ones you choose. + +\code +// ... +uint32_t excludedMemoryTypeIndex = 2; +VmaAllocationCreateInfo allocInfo = {}; +allocInfo.usage = VMA_MEMORY_USAGE_AUTO; +allocInfo.memoryTypeBits = ~(1u << excludedMemoryTypeIndex); +// ... +\endcode + \section choosing_memory_type_custom_memory_pools Custom memory pools @@ -17897,6 +16855,7 @@ You can use them directly with memory allocated by this library, but it is not recommended because of following issue: Mapping the same `VkDeviceMemory` block multiple times is illegal - only one mapping at a time is allowed. This includes mapping disjoint regions. Mapping is not reference-counted internally by Vulkan. +It is also not thread-safe. Because of this, Vulkan Memory Allocator provides following facilities: \note If you want to be able to map an allocation, you need to specify one of the flags @@ -17904,11 +16863,44 @@ Because of this, Vulkan Memory Allocator provides following facilities: in VmaAllocationCreateInfo::flags. These flags are required for an allocation to be mappable when using #VMA_MEMORY_USAGE_AUTO or other `VMA_MEMORY_USAGE_AUTO*` enum values. For other usage values they are ignored and every such allocation made in `HOST_VISIBLE` memory type is mappable, -but they can still be used for consistency. +but these flags can still be used for consistency. + +\section memory_mapping_copy_functions Copy functions + +The easiest way to copy data from a host pointer to an allocation is to use convenience function vmaCopyMemoryToAllocation(). +It automatically maps the Vulkan memory temporarily (if not already mapped), performs `memcpy`, +and calls `vkFlushMappedMemoryRanges` (if required - if memory type is not `HOST_COHERENT`). + +It is also the safest one, because using `memcpy` avoids a risk of accidentally introducing memory reads +(e.g. by doing `pMappedVectors[i] += v`), which may be very slow on memory types that are not `HOST_CACHED`. + +\code +struct ConstantBuffer +{ + ... +}; +ConstantBuffer constantBufferData = ... + +VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +bufCreateInfo.size = sizeof(ConstantBuffer); +bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; +allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; + +VkBuffer buf; +VmaAllocation alloc; +vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr); + +vmaCopyMemoryToAllocation(allocator, &constantBufferData, alloc, 0, sizeof(ConstantBuffer)); +\endcode + +Copy in the other direction - from an allocation to a host pointer can be performed the same way using function vmaCopyAllocationToMemory(). \section memory_mapping_mapping_functions Mapping functions -The library provides following functions for mapping of a specific #VmaAllocation: vmaMapMemory(), vmaUnmapMemory(). +The library provides following functions for mapping of a specific allocation: vmaMapMemory(), vmaUnmapMemory(). They are safer and more convenient to use than standard Vulkan functions. You can map an allocation multiple times simultaneously - mapping is reference-counted internally. You can also map different allocations simultaneously regardless of whether they use the same `VkDeviceMemory` block. @@ -18169,6 +17161,12 @@ vkDestroyImage(allocator, img2, nullptr); vkDestroyImage(allocator, img1, nullptr); \endcode +VMA also provides convenience functions that create a buffer or image and bind it to memory +represented by an existing #VmaAllocation: +vmaCreateAliasingBuffer(), vmaCreateAliasingBuffer2(), +vmaCreateAliasingImage(), vmaCreateAliasingImage2(). +Versions with "2" offer additional parameter `allocationLocalOffset`. + Remember that using resources that alias in memory requires proper synchronization. You need to issue a memory barrier to make sure commands that use `img1` and `img2` don't overlap on GPU timeline. @@ -18198,6 +17196,7 @@ A memory pool contains a number of `VkDeviceMemory` blocks. The library automatically creates and manages default pool for each memory type available on the device. Default memory pool automatically grows in size. Size of allocated blocks is also variable and managed automatically. +You are using default pools whenever you leave VmaAllocationCreateInfo::pool = null. You can create custom pool and allocate memory out of it. It can be useful if you want to: @@ -18269,13 +17268,6 @@ It is supported only when VmaPoolCreateInfo::blockSize = 0. To use this feature, set VmaAllocationCreateInfo::pool to the pointer to your custom pool and VmaAllocationCreateInfo::flags to #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. -\note Excessive use of custom pools is a common mistake when using this library. -Custom pools may be useful for special purposes - when you want to -keep certain type of resources separate e.g. to reserve minimum amount of memory -for them or limit maximum amount of memory they can occupy. For most -resources this is not needed and so it is not recommended to create #VmaPool -objects and allocations out of them. Allocating from the default pool is sufficient. - \section custom_memory_pools_MemTypeIndex Choosing memory type index @@ -18310,6 +17302,51 @@ When creating buffers/images allocated in that pool, provide following parameter - VmaAllocationCreateInfo: You don't need to pass same parameters. Fill only `pool` member. Other members are ignored anyway. + +\section custom_memory_pools_when_not_use When not to use custom pools + +Custom pools are commonly overused by VMA users. +While it may feel natural to keep some logical groups of resources separate in memory, +in most cases it does more harm than good. +Using custom pool shouldn't be your first choice. +Instead, please make all allocations from default pools first and only use custom pools +if you can prove and measure that it is beneficial in some way, +e.g. it results in lower memory usage, better performance, etc. + +Using custom pools has disadvantages: + +- Each pool has its own collection of `VkDeviceMemory` blocks. + Some of them may be partially or even completely empty. + Spreading allocations across multiple pools increases the amount of wasted (allocated but unbound) memory. +- You must manually choose specific memory type to be used by a custom pool (set as VmaPoolCreateInfo::memoryTypeIndex). + When using default pools, best memory type for each of your allocations can be selected automatically + using a carefully design algorithm that works across all kinds of GPUs. +- If an allocation from a custom pool at specific memory type fails, entire allocation operation returns failure. + When using default pools, VMA tries another compatible memory type. +- If you set VmaPoolCreateInfo::blockSize != 0, each memory block has the same size, + while default pools start from small blocks and only allocate next blocks larger and larger + up to the preferred block size. + +Many of the common concerns can be addressed in a different way than using custom pools: + +- If you want to keep your allocations of certain size (small versus large) or certain lifetime (transient versus long lived) + separate, you likely don't need to. + VMA uses a high quality allocation algorithm that manages memory well in various cases. + Please measure and check if using custom pools provides a benefit. +- If you want to keep your images and buffers separate, you don't need to. + VMA respects `bufferImageGranularity` limit automatically. +- If you want to keep your mapped and not mapped allocations separate, you don't need to. + VMA respects `nonCoherentAtomSize` limit automatically. + It also maps only those `VkDeviceMemory` blocks that need to map any allocation. + It even tries to keep mappable and non-mappable allocations in separate blocks to minimize the amount of mapped memory. +- If you want to choose a custom size for the default memory block, you can set it globally instead + using VmaAllocatorCreateInfo::preferredLargeHeapBlockSize. +- If you want to select specific memory type for your allocation, + you can set VmaAllocationCreateInfo::memoryTypeBits to `(1u << myMemoryTypeIndex)` instead. +- If you need to create a buffer with certain minimum alignment, you can still do it + using default pools with dedicated function vmaCreateBufferWithAlignment(). + + \section linear_algorithm Linear allocation algorithm Each Vulkan memory block managed by this library has accompanying metadata that @@ -18920,22 +17957,35 @@ Margin validation (corruption detection) works only for memory types that are `HOST_VISIBLE` and `HOST_COHERENT`. -\page opengl_interop OpenGL Interop +\section debugging_memory_usage_leak_detection Leak detection features + +At allocation and allocator destruction time VMA checks for unfreed and unmapped blocks using +`VMA_ASSERT_LEAK()`. This macro defaults to an assertion, triggering a typically fatal error in Debug +builds, and doing nothing in Release builds. You can provide your own definition of `VMA_ASSERT_LEAK()` +to change this behavior. + +At memory block destruction time VMA lists out all unfreed allocations using the `VMA_LEAK_LOG_FORMAT()` +macro, which defaults to `VMA_DEBUG_LOG_FORMAT`, which in turn defaults to a no-op. +If you're having trouble with leaks - for example, the aforementioned assertion triggers, but you don't +quite know \em why -, overriding this macro to print out the the leaking blocks, combined with assigning +individual names to allocations using vmaSetAllocationName(), can greatly aid in fixing them. -VMA provides some features that help with interoperability with OpenGL. +\page other_api_interop Interop with other graphics APIs + +VMA provides some features that help with interoperability with other graphics APIs, e.g. OpenGL. \section opengl_interop_exporting_memory Exporting memory -If you want to attach `VkExportMemoryAllocateInfoKHR` structure to `pNext` chain of memory allocations made by the library: +If you want to attach `VkExportMemoryAllocateInfoKHR` or other structure to `pNext` chain of memory allocations made by the library: -It is recommended to create \ref custom_memory_pools for such allocations. +You can create \ref custom_memory_pools for such allocations. Define and fill in your `VkExportMemoryAllocateInfoKHR` structure and attach it to VmaPoolCreateInfo::pMemoryAllocateNext while creating the custom pool. Please note that the structure must remain alive and unchanged for the whole lifetime of the #VmaPool, not only while creating it, as no copy of the structure is made, but its original pointer is used for each allocation instead. -If you want to export all memory allocated by the library from certain memory types, +If you want to export all memory allocated by VMA from certain memory types, also dedicated allocations or other allocations made from default pools, an alternative solution is to fill in VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes. It should point to an array with `VkExternalMemoryHandleTypeFlagsKHR` to be automatically passed by the library @@ -18952,7 +18002,7 @@ Buffers or images exported to a different API like OpenGL may require a differen higher than the one used by the library automatically, queried from functions like `vkGetBufferMemoryRequirements`. To impose such alignment: -It is recommended to create \ref custom_memory_pools for such allocations. +You can create \ref custom_memory_pools for such allocations. Set VmaPoolCreateInfo::minAllocationAlignment member to the minimum alignment required for each allocation to be made out of this pool. The alignment actually used will be the maximum of this member and the alignment returned for the specific buffer or image @@ -18963,8 +18013,17 @@ use special function vmaCreateBufferWithAlignment(), which takes additional para Note the problem of alignment affects only resources placed inside bigger `VkDeviceMemory` blocks and not dedicated allocations, as these, by definition, always have alignment = 0 because the resource is bound to the beginning of its dedicated block. +You can ensure that an allocation is created as dedicated by using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. Contrary to Direct3D 12, Vulkan doesn't have a concept of alignment of the entire memory block passed on its allocation. +\section opengl_interop_extended_allocation_information Extended allocation information + +If you want to rely on VMA to allocate your buffers and images inside larger memory blocks, +but you need to know the size of the entire block and whether the allocation was made +with its own dedicated memory, use function vmaGetAllocationInfo2() to retrieve +extended allocation information in structure #VmaAllocationInfo2. + + \page usage_patterns Recommended usage patterns @@ -19405,7 +18464,7 @@ vmaCreateImage(allocator, &imgCreateInfo, &allocCreateInfo, &img, &alloc, nullpt `priority` member is ignored in the following situations: - Allocations created in custom pools: They inherit the priority, along with all other allocation parameters - from the parametrs passed in #VmaPoolCreateInfo when the pool was created. + from the parameters passed in #VmaPoolCreateInfo when the pool was created. - Allocations created in default pools: They inherit the priority from the parameters VMA used when creating default pools, which means `priority == 0.5f`. diff --git a/deps/VulkanMemoryAllocator/src/CMakeLists.txt b/deps/VulkanMemoryAllocator/src/CMakeLists.txt index 53fa4eb..0284a63 100644 --- a/deps/VulkanMemoryAllocator/src/CMakeLists.txt +++ b/deps/VulkanMemoryAllocator/src/CMakeLists.txt @@ -1,107 +1,95 @@ -set(CMAKE_DEBUG_POSTFIX d) -set(CMAKE_RELWITHDEBINFO_POSTFIX rd) -set(CMAKE_MINSIZEREL_POSTFIX s) +# +# Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# + +if (NOT WIN32) + message(STATUS "VmaSample application is only supported on Windows") + return() +endif() -add_library(VulkanMemoryAllocator +option(VMA_STATIC_VULKAN_FUNCTIONS "Link statically with Vulkan API" ON) +option(VMA_DYNAMIC_VULKAN_FUNCTIONS "Fetch pointers to Vulkan functions internally (no static linking)" OFF) +option(VMA_DEBUG_ALWAYS_DEDICATED_MEMORY "Every allocation will have its own memory block" OFF) +option(VMA_DEBUG_INITIALIZE_ALLOCATIONS "Automatically fill new allocations and destroyed allocations with some bit pattern" OFF) +option(VMA_DEBUG_GLOBAL_MUTEX "Enable single mutex protecting all entry calls to the library" OFF) +option(VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT "Never exceed VkPhysicalDeviceLimits::maxMemoryAllocationCount and return error" OFF) + +message(STATUS "VMA_STATIC_VULKAN_FUNCTIONS = ${VMA_STATIC_VULKAN_FUNCTIONS}") +message(STATUS "VMA_DYNAMIC_VULKAN_FUNCTIONS = ${VMA_DYNAMIC_VULKAN_FUNCTIONS}") +message(STATUS "VMA_DEBUG_ALWAYS_DEDICATED_MEMORY = ${VMA_DEBUG_ALWAYS_DEDICATED_MEMORY}") +message(STATUS "VMA_DEBUG_INITIALIZE_ALLOCATIONS = ${VMA_DEBUG_INITIALIZE_ALLOCATIONS}") +message(STATUS "VMA_DEBUG_GLOBAL_MUTEX = ${VMA_DEBUG_GLOBAL_MUTEX}") +message(STATUS "VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT = ${VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT}") + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +find_package(Vulkan REQUIRED) + +add_executable(VmaSample) +target_sources(VmaSample PRIVATE + Common.cpp + Common.h + SparseBindingTest.cpp + SparseBindingTest.h + Tests.cpp + Tests.h VmaUsage.cpp VmaUsage.h - ${PROJECT_SOURCE_DIR}/include/vk_mem_alloc.h + VulkanSample.cpp + ../include/vk_mem_alloc.h ) -if (MSVC) - # Provides MSVC users nicer debugging support - target_sources(VulkanMemoryAllocator PRIVATE ${CMAKE_CURRENT_LIST_DIR}/vk_mem_alloc.natvis) +# Only link to Vulkan library if static linking is used, but always add Vulkan headers directory +if(VMA_STATIC_VULKAN_FUNCTIONS) + target_link_libraries(VmaSample PUBLIC Vulkan::Vulkan) +else() + target_link_libraries(VmaSample PUBLIC Vulkan::Headers) endif() -set_target_properties( - VulkanMemoryAllocator PROPERTIES - - CXX_EXTENSIONS OFF - # Use C++14 - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED ON -) - -target_include_directories(VulkanMemoryAllocator PUBLIC - $ -) - -# Only link to Vulkan if static linking is used -if(${VMA_STATIC_VULKAN_FUNCTIONS}) - target_link_libraries(VulkanMemoryAllocator PUBLIC Vulkan::Vulkan) -endif() +target_link_libraries(VmaSample PRIVATE GPUOpen::VulkanMemoryAllocator) -target_compile_definitions( - VulkanMemoryAllocator - - PUBLIC +target_compile_definitions(VmaSample PUBLIC VMA_STATIC_VULKAN_FUNCTIONS=$ VMA_DYNAMIC_VULKAN_FUNCTIONS=$ VMA_DEBUG_ALWAYS_DEDICATED_MEMORY=$ VMA_DEBUG_INITIALIZE_ALLOCATIONS=$ VMA_DEBUG_GLOBAL_MUTEX=$ VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT=$ - VMA_RECORDING_ENABLED=$ ) -#include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/install_target.cmake) - -if(VMA_BUILD_SAMPLE) - if(WIN32) - set(VMA_SAMPLE_SOURCE_FILES - Common.cpp - Common.h - SparseBindingTest.cpp - SparseBindingTest.h - Tests.cpp - Tests.h - VulkanSample.cpp - ) - - add_executable(VmaSample ${VMA_SAMPLE_SOURCE_FILES}) - add_dependencies(VmaSample VulkanMemoryAllocator VmaSampleShaders) - - if(MSVC) - # Use Unicode instead of multibyte set - add_compile_definitions(UNICODE _UNICODE) - - # Add C++ warnings and security checks - add_compile_options(/permissive- /sdl /W3) - - # Enable multithreaded compiling - target_compile_options(VmaSample PRIVATE "/MP") +# Provides MSVC users nicer debugging support +target_sources(VmaSample PRIVATE vk_mem_alloc.natvis) - # Set VmaSample as startup project - set_property(DIRECTORY "${PROJECT_SOURCE_DIR}" PROPERTY VS_STARTUP_PROJECT "VmaSample") +add_subdirectory(Shaders) +add_dependencies(VmaSample VmaSampleShaders) - # Set working directory for Visual Studio debugger - set_target_properties( - VmaSample - PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/bin" - ) - endif() +# Use Unicode instead of multibyte set +add_compile_definitions(UNICODE _UNICODE) - set_target_properties( - VmaSample PROPERTIES +# Add C++ warnings and security checks +add_compile_options(/permissive- /sdl /W3) - CXX_EXTENSIONS OFF - # Use C++14 - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED ON - ) +# Set VmaSample as startup project +set_property(DIRECTORY "${PROJECT_SOURCE_DIR}" PROPERTY VS_STARTUP_PROJECT "VmaSample") - target_link_libraries( - VmaSample - PRIVATE - - VulkanMemoryAllocator - Vulkan::Vulkan - ) - else() - message(STATUS "VmaSample application is not supported to Linux") - endif() -endif() - -if(VMA_BUILD_SAMPLE_SHADERS) - add_subdirectory(Shaders) -endif() +set_target_properties(VmaSample PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/bin") diff --git a/deps/VulkanMemoryAllocator/src/Common.cpp b/deps/VulkanMemoryAllocator/src/Common.cpp index 21ae4f6..986c846 100644 --- a/deps/VulkanMemoryAllocator/src/Common.cpp +++ b/deps/VulkanMemoryAllocator/src/Common.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/deps/VulkanMemoryAllocator/src/Common.h b/deps/VulkanMemoryAllocator/src/Common.h index 114e827..a6b8bf1 100644 --- a/deps/VulkanMemoryAllocator/src/Common.h +++ b/deps/VulkanMemoryAllocator/src/Common.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/deps/VulkanMemoryAllocator/src/Shaders/CMakeLists.txt b/deps/VulkanMemoryAllocator/src/Shaders/CMakeLists.txt new file mode 100644 index 0000000..f85ab78 --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/Shaders/CMakeLists.txt @@ -0,0 +1,32 @@ +# This file will only be executed if VMA_BUILD_SAMPLE_SHADERS is set to ON + +find_program(GLSL_VALIDATOR glslangValidator REQUIRED) + +if(NOT GLSL_VALIDATOR) + message(FATAL_ERROR "glslangValidator not found!") +endif() + +set(SHADERS + Shader.vert + Shader.frag + SparseBindingTest.comp +) + +# Compile each shader using glslangValidator +foreach(SHADER ${SHADERS}) + get_filename_component(FILE_NAME ${SHADER} NAME) + + # Put the .spv files into the bin folder + set(SPIRV ${PROJECT_SOURCE_DIR}/bin/${FILE_NAME}.spv) + + add_custom_command( + OUTPUT ${SPIRV} + # Use the same file name and append .spv to the compiled shader + COMMAND ${GLSL_VALIDATOR} -V ${CMAKE_CURRENT_SOURCE_DIR}/${SHADER} -o ${SPIRV} + DEPENDS ${SHADER} + ) + + list(APPEND SPIRV_FILES ${SPIRV}) +endforeach() + +add_custom_target(VmaSampleShaders ALL DEPENDS ${SPIRV_FILES}) diff --git a/deps/VulkanMemoryAllocator/src/Shaders/CompileShaders.bat b/deps/VulkanMemoryAllocator/src/Shaders/CompileShaders.bat new file mode 100644 index 0000000..5d9d815 --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/Shaders/CompileShaders.bat @@ -0,0 +1,4 @@ +%VULKAN_SDK%/Bin32/glslangValidator.exe -V -o ../../bin/Shader.vert.spv Shader.vert +%VULKAN_SDK%/Bin32/glslangValidator.exe -V -o ../../bin/Shader.frag.spv Shader.frag +%VULKAN_SDK%/Bin32/glslangValidator.exe -V -o ../../bin/SparseBindingTest.comp.spv SparseBindingTest.comp +pause diff --git a/deps/VulkanMemoryAllocator/src/Shaders/Shader.frag b/deps/VulkanMemoryAllocator/src/Shaders/Shader.frag new file mode 100644 index 0000000..2dc7cad --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/Shaders/Shader.frag @@ -0,0 +1,37 @@ +// +// Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#version 450 +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 0) in vec3 inColor; +layout(location = 1) in vec2 inTexCoord; + +layout(location = 0) out vec4 outColor; + +layout(binding = 1) uniform sampler2D texSampler; + +void main() +{ + outColor = texture(texSampler, inTexCoord); + outColor.rgb *= inColor; +} diff --git a/deps/VulkanMemoryAllocator/src/Shaders/Shader.vert b/deps/VulkanMemoryAllocator/src/Shaders/Shader.vert new file mode 100644 index 0000000..b868a65 --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/Shaders/Shader.vert @@ -0,0 +1,42 @@ +// +// Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#version 450 +#extension GL_ARB_separate_shader_objects : enable + +layout(push_constant) uniform UniformBufferObject +{ + mat4 ModelViewProj; +} ubo; + +layout(location = 0) in vec3 inPosition; +layout(location = 1) in vec3 inColor; +layout(location = 2) in vec2 inTexCoord; + +layout(location = 0) out vec3 outColor; +layout(location = 1) out vec2 outTexCoord; + +void main() { + gl_Position = ubo.ModelViewProj * vec4(inPosition, 1.0); + outColor = inColor; + outTexCoord = inTexCoord; +} diff --git a/deps/VulkanMemoryAllocator/src/Shaders/SparseBindingTest.comp b/deps/VulkanMemoryAllocator/src/Shaders/SparseBindingTest.comp new file mode 100644 index 0000000..5f07316 --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/Shaders/SparseBindingTest.comp @@ -0,0 +1,44 @@ +// +// Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#version 450 +#extension GL_ARB_separate_shader_objects : enable + +layout(local_size_x=1, local_size_y=1, local_size_z=1) in; + +layout(binding=0) uniform sampler2D img; +layout(binding=1) buffer buf +{ + uint bufValues[]; +}; + +void main() +{ + ivec2 xy = ivec2(bufValues[gl_GlobalInvocationID.x * 3], + bufValues[gl_GlobalInvocationID.x * 3 + 1]); + vec4 color = texture(img, xy); + bufValues[gl_GlobalInvocationID.x * 3 + 2] = + uint(color.r * 255.0) << 24 | + uint(color.g * 255.0) << 16 | + uint(color.b * 255.0) << 8 | + uint(color.a * 255.0); +} diff --git a/deps/VulkanMemoryAllocator/src/SparseBindingTest.cpp b/deps/VulkanMemoryAllocator/src/SparseBindingTest.cpp new file mode 100644 index 0000000..e49f603 --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/SparseBindingTest.cpp @@ -0,0 +1,597 @@ +// +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "Common.h" +#include "SparseBindingTest.h" + +#ifdef _WIN32 + +//////////////////////////////////////////////////////////////////////////////// +// External imports + +extern VkDevice g_hDevice; +extern VmaAllocator g_hAllocator; +extern uint32_t g_FrameIndex; +extern bool g_SparseBindingEnabled; +extern VkQueue g_hSparseBindingQueue; +extern VkFence g_ImmediateFence; +extern VkCommandBuffer g_hTemporaryCommandBuffer; + +void BeginSingleTimeCommands(); +void EndSingleTimeCommands(); +void SaveAllocatorStatsToFile(const wchar_t* filePath, bool detailed = true); +void LoadShader(std::vector& out, const char* fileName); + +//////////////////////////////////////////////////////////////////////////////// +// Class definitions + +static uint32_t CalculateMipMapCount(uint32_t width, uint32_t height, uint32_t depth) +{ + uint32_t mipMapCount = 1; + while(width > 1 || height > 1 || depth > 1) + { + ++mipMapCount; + width /= 2; + height /= 2; + depth /= 2; + } + return mipMapCount; +} + +class BaseImage +{ +public: + virtual void Init(RandomNumberGenerator& rand) = 0; + virtual ~BaseImage(); + + const VkImageCreateInfo& GetCreateInfo() const { return m_CreateInfo; } + + void TestContent(RandomNumberGenerator& rand); + +protected: + VkImageCreateInfo m_CreateInfo = {}; + VkImage m_Image = VK_NULL_HANDLE; + + void FillImageCreateInfo(RandomNumberGenerator& rand); + void UploadContent(); + void ValidateContent(RandomNumberGenerator& rand); +}; + +class TraditionalImage : public BaseImage +{ +public: + virtual void Init(RandomNumberGenerator& rand); + virtual ~TraditionalImage(); + +private: + VmaAllocation m_Allocation = VK_NULL_HANDLE; +}; + +class SparseBindingImage : public BaseImage +{ +public: + virtual void Init(RandomNumberGenerator& rand); + virtual ~SparseBindingImage(); + +private: + std::vector m_Allocations; +}; + +//////////////////////////////////////////////////////////////////////////////// +// class BaseImage + +BaseImage::~BaseImage() +{ + if(m_Image) + { + vkDestroyImage(g_hDevice, m_Image, nullptr); + } +} + +void BaseImage::TestContent(RandomNumberGenerator& rand) +{ + printf("Validating content of %u x %u texture...\n", + m_CreateInfo.extent.width, m_CreateInfo.extent.height); + UploadContent(); + ValidateContent(rand); +} + +void BaseImage::FillImageCreateInfo(RandomNumberGenerator& rand) +{ + constexpr uint32_t imageSizeMin = 8; + constexpr uint32_t imageSizeMax = 2048; + + const bool useMipMaps = rand.Generate() % 2 != 0; + + ZeroMemory(&m_CreateInfo, sizeof(m_CreateInfo)); + m_CreateInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; + m_CreateInfo.imageType = VK_IMAGE_TYPE_2D; + m_CreateInfo.extent.width = rand.Generate() % (imageSizeMax - imageSizeMin) + imageSizeMin; + m_CreateInfo.extent.height = rand.Generate() % (imageSizeMax - imageSizeMin) + imageSizeMin; + m_CreateInfo.extent.depth = 1; + m_CreateInfo.mipLevels = useMipMaps ? + CalculateMipMapCount(m_CreateInfo.extent.width, m_CreateInfo.extent.height, m_CreateInfo.extent.depth) : 1; + m_CreateInfo.arrayLayers = 1; + m_CreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + m_CreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + m_CreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + m_CreateInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT; + m_CreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + m_CreateInfo.flags = 0; +} + +void BaseImage::UploadContent() +{ + VkBufferCreateInfo srcBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + srcBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + srcBufCreateInfo.size = 4 * m_CreateInfo.extent.width * m_CreateInfo.extent.height; + + VmaAllocationCreateInfo srcBufAllocCreateInfo = {}; + srcBufAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + srcBufAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; + + VkBuffer srcBuf = nullptr; + VmaAllocation srcBufAlloc = nullptr; + VmaAllocationInfo srcAllocInfo = {}; + TEST( vmaCreateBuffer(g_hAllocator, &srcBufCreateInfo, &srcBufAllocCreateInfo, &srcBuf, &srcBufAlloc, &srcAllocInfo) == VK_SUCCESS ); + + // Fill texels with: r = x % 255, g = u % 255, b = 13, a = 25 + uint32_t* srcBufPtr = (uint32_t*)srcAllocInfo.pMappedData; + for(uint32_t y = 0, sizeY = m_CreateInfo.extent.height; y < sizeY; ++y) + { + for(uint32_t x = 0, sizeX = m_CreateInfo.extent.width; x < sizeX; ++x, ++srcBufPtr) + { + const uint8_t r = (uint8_t)x; + const uint8_t g = (uint8_t)y; + const uint8_t b = 13; + const uint8_t a = 25; + *srcBufPtr = (uint32_t)r << 24 | (uint32_t)g << 16 | + (uint32_t)b << 8 | (uint32_t)a; + } + } + + BeginSingleTimeCommands(); + + // Barrier undefined to transfer dst. + { + VkImageMemoryBarrier barrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER }; + barrier.srcAccessMask = 0; + barrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; + barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; + barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; + barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.image = m_Image; + barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barrier.subresourceRange.baseArrayLayer = 0; + barrier.subresourceRange.baseMipLevel = 0; + barrier.subresourceRange.layerCount = 1; + barrier.subresourceRange.levelCount = 1; + + vkCmdPipelineBarrier(g_hTemporaryCommandBuffer, + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, // srcStageMask + VK_PIPELINE_STAGE_TRANSFER_BIT, // dstStageMask + 0, // dependencyFlags + 0, nullptr, // memoryBarriers + 0, nullptr, // bufferMemoryBarriers + 1, &barrier); // imageMemoryBarriers + } + + // CopyBufferToImage + { + VkBufferImageCopy region = {}; + region.bufferOffset = 0; + region.bufferRowLength = 0; // Zeros mean tightly packed. + region.bufferImageHeight = 0; // Zeros mean tightly packed. + region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + region.imageSubresource.mipLevel = 0; + region.imageSubresource.baseArrayLayer = 0; + region.imageSubresource.layerCount = 1; + region.imageOffset = { 0, 0, 0 }; + region.imageExtent = m_CreateInfo.extent; + vkCmdCopyBufferToImage(g_hTemporaryCommandBuffer, srcBuf, m_Image, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion); + } + + // Barrier transfer dst to fragment shader read only. + { + VkImageMemoryBarrier barrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER }; + barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; + barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; + barrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; + barrier.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.image = m_Image; + barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + barrier.subresourceRange.baseArrayLayer = 0; + barrier.subresourceRange.baseMipLevel = 0; + barrier.subresourceRange.layerCount = 1; + barrier.subresourceRange.levelCount = 1; + + vkCmdPipelineBarrier(g_hTemporaryCommandBuffer, + VK_PIPELINE_STAGE_TRANSFER_BIT, // srcStageMask + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, // dstStageMask + 0, // dependencyFlags + 0, nullptr, // memoryBarriers + 0, nullptr, // bufferMemoryBarriers + 1, &barrier); // imageMemoryBarriers + } + + EndSingleTimeCommands(); + + vmaDestroyBuffer(g_hAllocator, srcBuf, srcBufAlloc); +} + +void BaseImage::ValidateContent(RandomNumberGenerator& rand) +{ + /* + dstBuf has following layout: + For each of texels to be sampled, [0..valueCount): + struct { + in uint32_t pixelX; + in uint32_t pixelY; + out uint32_t pixelColor; + } + */ + + const uint32_t valueCount = 128; + + VkBufferCreateInfo dstBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + dstBufCreateInfo.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; + dstBufCreateInfo.size = valueCount * sizeof(uint32_t) * 3; + + VmaAllocationCreateInfo dstBufAllocCreateInfo = {}; + dstBufAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; + dstBufAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + VkBuffer dstBuf = nullptr; + VmaAllocation dstBufAlloc = nullptr; + VmaAllocationInfo dstBufAllocInfo = {}; + TEST( vmaCreateBuffer(g_hAllocator, &dstBufCreateInfo, &dstBufAllocCreateInfo, &dstBuf, &dstBufAlloc, &dstBufAllocInfo) == VK_SUCCESS ); + + // Fill dstBuf input data. + { + uint32_t* dstBufContent = (uint32_t*)dstBufAllocInfo.pMappedData; + for(uint32_t i = 0; i < valueCount; ++i) + { + const uint32_t x = rand.Generate() % m_CreateInfo.extent.width; + const uint32_t y = rand.Generate() % m_CreateInfo.extent.height; + dstBufContent[i * 3 ] = x; + dstBufContent[i * 3 + 1] = y; + dstBufContent[i * 3 + 2] = 0; + } + } + + VkSamplerCreateInfo samplerCreateInfo = { VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO }; + samplerCreateInfo.magFilter = VK_FILTER_NEAREST; + samplerCreateInfo.minFilter = VK_FILTER_NEAREST; + samplerCreateInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; + samplerCreateInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + samplerCreateInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + samplerCreateInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + samplerCreateInfo.unnormalizedCoordinates = VK_TRUE; + + VkSampler sampler = nullptr; + TEST( vkCreateSampler( g_hDevice, &samplerCreateInfo, nullptr, &sampler) == VK_SUCCESS ); + + VkDescriptorSetLayoutBinding bindings[2] = {}; + bindings[0].binding = 0; + bindings[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + bindings[0].descriptorCount = 1; + bindings[0].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; + bindings[0].pImmutableSamplers = &sampler; + bindings[1].binding = 1; + bindings[1].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER; + bindings[1].descriptorCount = 1; + bindings[1].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; + + VkDescriptorSetLayoutCreateInfo descSetLayoutCreateInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO }; + descSetLayoutCreateInfo.bindingCount = 2; + descSetLayoutCreateInfo.pBindings = bindings; + + VkDescriptorSetLayout descSetLayout = nullptr; + TEST( vkCreateDescriptorSetLayout(g_hDevice, &descSetLayoutCreateInfo, nullptr, &descSetLayout) == VK_SUCCESS ); + + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO }; + pipelineLayoutCreateInfo.setLayoutCount = 1; + pipelineLayoutCreateInfo.pSetLayouts = &descSetLayout; + + VkPipelineLayout pipelineLayout = nullptr; + TEST( vkCreatePipelineLayout(g_hDevice, &pipelineLayoutCreateInfo, nullptr, &pipelineLayout) == VK_SUCCESS ); + + std::vector shaderCode; + LoadShader(shaderCode, "SparseBindingTest.comp.spv"); + + VkShaderModuleCreateInfo shaderModuleCreateInfo = { VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO }; + shaderModuleCreateInfo.codeSize = shaderCode.size(); + shaderModuleCreateInfo.pCode = (const uint32_t*)shaderCode.data(); + + VkShaderModule shaderModule = nullptr; + TEST( vkCreateShaderModule(g_hDevice, &shaderModuleCreateInfo, nullptr, &shaderModule) == VK_SUCCESS ); + + VkComputePipelineCreateInfo pipelineCreateInfo = { VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO }; + pipelineCreateInfo.stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; + pipelineCreateInfo.stage.stage = VK_SHADER_STAGE_COMPUTE_BIT; + pipelineCreateInfo.stage.module = shaderModule; + pipelineCreateInfo.stage.pName = "main"; + pipelineCreateInfo.layout = pipelineLayout; + + VkPipeline pipeline = nullptr; + TEST( vkCreateComputePipelines(g_hDevice, nullptr, 1, &pipelineCreateInfo, nullptr, &pipeline) == VK_SUCCESS ); + + VkDescriptorPoolSize poolSizes[2] = {}; + poolSizes[0].type = bindings[0].descriptorType; + poolSizes[0].descriptorCount = bindings[0].descriptorCount; + poolSizes[1].type = bindings[1].descriptorType; + poolSizes[1].descriptorCount = bindings[1].descriptorCount; + + VkDescriptorPoolCreateInfo descPoolCreateInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO }; + descPoolCreateInfo.maxSets = 1; + descPoolCreateInfo.poolSizeCount = 2; + descPoolCreateInfo.pPoolSizes = poolSizes; + + VkDescriptorPool descPool = nullptr; + TEST( vkCreateDescriptorPool(g_hDevice, &descPoolCreateInfo, nullptr, &descPool) == VK_SUCCESS ); + + VkDescriptorSetAllocateInfo descSetAllocInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO }; + descSetAllocInfo.descriptorPool = descPool; + descSetAllocInfo.descriptorSetCount = 1; + descSetAllocInfo.pSetLayouts = &descSetLayout; + + VkDescriptorSet descSet = nullptr; + TEST( vkAllocateDescriptorSets(g_hDevice, &descSetAllocInfo, &descSet) == VK_SUCCESS ); + + VkImageViewCreateInfo imageViewCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO }; + imageViewCreateInfo.image = m_Image; + imageViewCreateInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; + imageViewCreateInfo.format = m_CreateInfo.format; + imageViewCreateInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + imageViewCreateInfo.subresourceRange.layerCount = 1; + imageViewCreateInfo.subresourceRange.levelCount = 1; + + VkImageView imageView = nullptr; + TEST( vkCreateImageView(g_hDevice, &imageViewCreateInfo, nullptr, &imageView) == VK_SUCCESS ); + + VkDescriptorImageInfo descImageInfo = {}; + descImageInfo.imageView = imageView; + descImageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + + VkDescriptorBufferInfo descBufferInfo = {}; + descBufferInfo.buffer = dstBuf; + descBufferInfo.offset = 0; + descBufferInfo.range = VK_WHOLE_SIZE; + + VkWriteDescriptorSet descWrites[2] = {}; + descWrites[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + descWrites[0].dstSet = descSet; + descWrites[0].dstBinding = bindings[0].binding; + descWrites[0].dstArrayElement = 0; + descWrites[0].descriptorCount = 1; + descWrites[0].descriptorType = bindings[0].descriptorType; + descWrites[0].pImageInfo = &descImageInfo; + descWrites[1].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + descWrites[1].dstSet = descSet; + descWrites[1].dstBinding = bindings[1].binding; + descWrites[1].dstArrayElement = 0; + descWrites[1].descriptorCount = 1; + descWrites[1].descriptorType = bindings[1].descriptorType; + descWrites[1].pBufferInfo = &descBufferInfo; + vkUpdateDescriptorSets(g_hDevice, 2, descWrites, 0, nullptr); + + BeginSingleTimeCommands(); + vkCmdBindPipeline(g_hTemporaryCommandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, pipeline); + vkCmdBindDescriptorSets(g_hTemporaryCommandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, pipelineLayout, 0, 1, &descSet, 0, nullptr); + vkCmdDispatch(g_hTemporaryCommandBuffer, valueCount, 1, 1); + EndSingleTimeCommands(); + + // Validate dstBuf output data. + { + const uint32_t* dstBufContent = (const uint32_t*)dstBufAllocInfo.pMappedData; + for(uint32_t i = 0; i < valueCount; ++i) + { + const uint32_t x = dstBufContent[i * 3 ]; + const uint32_t y = dstBufContent[i * 3 + 1]; + const uint32_t color = dstBufContent[i * 3 + 2]; + const uint8_t a = (uint8_t)(color >> 24); + const uint8_t b = (uint8_t)(color >> 16); + const uint8_t g = (uint8_t)(color >> 8); + const uint8_t r = (uint8_t)color; + TEST(r == (uint8_t)x && g == (uint8_t)y && b == 13 && a == 25); + } + } + + vkDestroyImageView(g_hDevice, imageView, nullptr); + vkDestroyDescriptorPool(g_hDevice, descPool, nullptr); + vmaDestroyBuffer(g_hAllocator, dstBuf, dstBufAlloc); + vkDestroyPipeline(g_hDevice, pipeline, nullptr); + vkDestroyShaderModule(g_hDevice, shaderModule, nullptr); + vkDestroyPipelineLayout(g_hDevice, pipelineLayout, nullptr); + vkDestroyDescriptorSetLayout(g_hDevice, descSetLayout, nullptr); + vkDestroySampler(g_hDevice, sampler, nullptr); +} + +//////////////////////////////////////////////////////////////////////////////// +// class TraditionalImage + +void TraditionalImage::Init(RandomNumberGenerator& rand) +{ + FillImageCreateInfo(rand); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + // Default BEST_FIT is clearly better. + //allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT; + + ERR_GUARD_VULKAN( vmaCreateImage(g_hAllocator, &m_CreateInfo, &allocCreateInfo, + &m_Image, &m_Allocation, nullptr) ); +} + +TraditionalImage::~TraditionalImage() +{ + if(m_Allocation) + { + vmaFreeMemory(g_hAllocator, m_Allocation); + } +} + +//////////////////////////////////////////////////////////////////////////////// +// class SparseBindingImage + +void SparseBindingImage::Init(RandomNumberGenerator& rand) +{ + assert(g_SparseBindingEnabled && g_hSparseBindingQueue); + + // Create image. + FillImageCreateInfo(rand); + m_CreateInfo.flags |= VK_IMAGE_CREATE_SPARSE_BINDING_BIT; + ERR_GUARD_VULKAN( vkCreateImage(g_hDevice, &m_CreateInfo, nullptr, &m_Image) ); + + // Get memory requirements. + VkMemoryRequirements imageMemReq; + vkGetImageMemoryRequirements(g_hDevice, m_Image, &imageMemReq); + + // This is just to silence validation layer warning. + // But it doesn't help. Looks like a bug in Vulkan validation layers. + // See: https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/364 + uint32_t sparseMemReqCount = 0; + vkGetImageSparseMemoryRequirements(g_hDevice, m_Image, &sparseMemReqCount, nullptr); + TEST(sparseMemReqCount <= 8); + VkSparseImageMemoryRequirements sparseMemReq[8]; + vkGetImageSparseMemoryRequirements(g_hDevice, m_Image, &sparseMemReqCount, sparseMemReq); + + // According to Vulkan specification, for sparse resources memReq.alignment is also page size. + const VkDeviceSize pageSize = imageMemReq.alignment; + const uint32_t pageCount = (uint32_t)ceil_div(imageMemReq.size, pageSize); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.preferredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + + VkMemoryRequirements pageMemReq = imageMemReq; + pageMemReq.size = pageSize; + + // Allocate and bind memory pages. + m_Allocations.resize(pageCount); + std::fill(m_Allocations.begin(), m_Allocations.end(), nullptr); + std::vector binds{pageCount}; + std::vector allocInfo{pageCount}; + ERR_GUARD_VULKAN( vmaAllocateMemoryPages(g_hAllocator, &pageMemReq, &allocCreateInfo, pageCount, m_Allocations.data(), allocInfo.data()) ); + + for(uint32_t i = 0; i < pageCount; ++i) + { + binds[i] = {}; + binds[i].resourceOffset = pageSize * i; + binds[i].size = pageSize; + binds[i].memory = allocInfo[i].deviceMemory; + binds[i].memoryOffset = allocInfo[i].offset; + } + + VkSparseImageOpaqueMemoryBindInfo imageBindInfo; + imageBindInfo.image = m_Image; + imageBindInfo.bindCount = pageCount; + imageBindInfo.pBinds = binds.data(); + + VkBindSparseInfo bindSparseInfo = { VK_STRUCTURE_TYPE_BIND_SPARSE_INFO }; + bindSparseInfo.pImageOpaqueBinds = &imageBindInfo; + bindSparseInfo.imageOpaqueBindCount = 1; + + ERR_GUARD_VULKAN( vkResetFences(g_hDevice, 1, &g_ImmediateFence) ); + ERR_GUARD_VULKAN( vkQueueBindSparse(g_hSparseBindingQueue, 1, &bindSparseInfo, g_ImmediateFence) ); + ERR_GUARD_VULKAN( vkWaitForFences(g_hDevice, 1, &g_ImmediateFence, VK_TRUE, UINT64_MAX) ); +} + +SparseBindingImage::~SparseBindingImage() +{ + vmaFreeMemoryPages(g_hAllocator, m_Allocations.size(), m_Allocations.data()); +} + +//////////////////////////////////////////////////////////////////////////////// +// Private functions + +//////////////////////////////////////////////////////////////////////////////// +// Public functions + +void TestSparseBinding() +{ + wprintf(L"TESTING SPARSE BINDING:\n"); + + struct ImageInfo + { + std::unique_ptr image; + uint32_t endFrame; + }; + std::vector images; + + constexpr uint32_t frameCount = 1000; + constexpr uint32_t imageLifeFramesMin = 1; + constexpr uint32_t imageLifeFramesMax = 400; + + RandomNumberGenerator rand(4652467); + + for(uint32_t frameIndex = 0; frameIndex < frameCount; ++frameIndex) + { + // Bump frame index. + ++g_FrameIndex; + vmaSetCurrentFrameIndex(g_hAllocator, g_FrameIndex); + + // Create one new, random image. + ImageInfo imageInfo; + //imageInfo.image = std::make_unique(); + imageInfo.image = std::make_unique(); + imageInfo.image->Init(rand); + imageInfo.endFrame = g_FrameIndex + rand.Generate() % (imageLifeFramesMax - imageLifeFramesMin) + imageLifeFramesMin; + images.push_back(std::move(imageInfo)); + + // Delete all images that expired. + for(size_t imageIndex = images.size(); imageIndex--; ) + { + if(g_FrameIndex >= images[imageIndex].endFrame) + { + images.erase(images.begin() + imageIndex); + } + } + } + + SaveAllocatorStatsToFile(L"SparseBindingTest.json"); + + // Choose biggest image. Test uploading and sampling. + BaseImage* biggestImage = nullptr; + for(size_t i = 0, count = images.size(); i < count; ++i) + { + if(!biggestImage || + images[i].image->GetCreateInfo().extent.width * images[i].image->GetCreateInfo().extent.height > + biggestImage->GetCreateInfo().extent.width * biggestImage->GetCreateInfo().extent.height) + { + biggestImage = images[i].image.get(); + } + } + assert(biggestImage); + + biggestImage->TestContent(rand); + + // Free remaining images. + images.clear(); + + wprintf(L"Done.\n"); +} + +#endif // #ifdef _WIN32 diff --git a/deps/VulkanMemoryAllocator/src/SparseBindingTest.h b/deps/VulkanMemoryAllocator/src/SparseBindingTest.h new file mode 100644 index 0000000..673e67d --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/SparseBindingTest.h @@ -0,0 +1,29 @@ +// +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#pragma once + +#ifdef _WIN32 + +void TestSparseBinding(); + +#endif // #ifdef _WIN32 diff --git a/deps/VulkanMemoryAllocator/src/Tests.cpp b/deps/VulkanMemoryAllocator/src/Tests.cpp new file mode 100644 index 0000000..796b84d --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/Tests.cpp @@ -0,0 +1,8350 @@ +// +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "Tests.h" +#include "VmaUsage.h" +#include "Common.h" +#include +#include +#include +#include + +#ifdef _WIN32 + +static const char* CODE_DESCRIPTION = "Foo"; +static constexpr VkDeviceSize KILOBYTE = 1024; +static constexpr VkDeviceSize MEGABYTE = 1024 * 1024; + +extern VkCommandBuffer g_hTemporaryCommandBuffer; +extern const VkAllocationCallbacks* g_Allocs; +extern bool VK_KHR_buffer_device_address_enabled; +extern bool VK_EXT_memory_priority_enabled; +extern bool VK_KHR_maintenance5_enabled; +extern PFN_vkGetBufferDeviceAddressKHR g_vkGetBufferDeviceAddressKHR; +void BeginSingleTimeCommands(); +void EndSingleTimeCommands(); +void SetDebugUtilsObjectName(VkObjectType type, uint64_t handle, const std::string&); + +#ifndef VMA_DEBUG_MARGIN + #define VMA_DEBUG_MARGIN 0 +#endif + +enum CONFIG_TYPE +{ + CONFIG_TYPE_MINIMUM, + CONFIG_TYPE_SMALL, + CONFIG_TYPE_AVERAGE, + CONFIG_TYPE_LARGE, + CONFIG_TYPE_MAXIMUM, + CONFIG_TYPE_COUNT +}; + +static constexpr CONFIG_TYPE ConfigType = CONFIG_TYPE_AVERAGE; + +enum class FREE_ORDER { FORWARD, BACKWARD, RANDOM, COUNT }; + +static const char* FREE_ORDER_NAMES[] = +{ + "FORWARD", + "BACKWARD", + "RANDOM", +}; + +// Copy of internal VmaAlgorithmToStr. +static const char* AlgorithmToStr(uint32_t algorithm) +{ + switch(algorithm) + { + case VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT: + return "Linear"; + case 0: + return "TLSF"; + default: + assert(0); + return ""; + } +} + +static const char* VirtualAlgorithmToStr(uint32_t algorithm) +{ + switch (algorithm) + { + case VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT: + return "Linear"; + case 0: + return "TLSF"; + default: + assert(0); + return ""; + } +} + +static const wchar_t* DefragmentationAlgorithmToStr(uint32_t algorithm) +{ + switch (algorithm) + { + case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT: + return L"Balanced"; + case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT: + return L"Fast"; + case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT: + return L"Full"; + case VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT: + return L"Extensive"; + case 0: + return L"Default"; + default: + assert(0); + return L""; + } +} + +static inline bool operator==(const VmaStatistics& lhs, const VmaStatistics& rhs) +{ + return lhs.allocationBytes == rhs.allocationBytes && + lhs.allocationCount == rhs.allocationCount && + lhs.blockBytes == rhs.blockBytes && + lhs.blockCount == rhs.blockCount; +} +static inline bool operator==(const VmaDetailedStatistics& lhs, const VmaDetailedStatistics& rhs) +{ + return lhs.statistics == rhs.statistics && + lhs.unusedRangeCount == rhs.unusedRangeCount && + lhs.allocationSizeMax == rhs.allocationSizeMax && + lhs.allocationSizeMin == rhs.allocationSizeMin && + lhs.unusedRangeSizeMax == rhs.unusedRangeSizeMax && + lhs.unusedRangeSizeMin == rhs.unusedRangeSizeMin; +} + +struct AllocationSize +{ + uint32_t Probability; + VkDeviceSize BufferSizeMin, BufferSizeMax; + uint32_t ImageSizeMin, ImageSizeMax; +}; + +struct Config +{ + uint32_t RandSeed; + VkDeviceSize BeginBytesToAllocate; + uint32_t AdditionalOperationCount; + VkDeviceSize MaxBytesToAllocate; + uint32_t MemUsageProbability[4]; // For VMA_MEMORY_USAGE_* + std::vector AllocationSizes; + uint32_t ThreadCount; + uint32_t ThreadsUsingCommonAllocationsProbabilityPercent; + FREE_ORDER FreeOrder; + VmaAllocationCreateFlags AllocationStrategy; // For VMA_ALLOCATION_CREATE_STRATEGY_* +}; + +struct Result +{ + duration TotalTime; + duration AllocationTimeMin, AllocationTimeAvg, AllocationTimeMax; + duration DeallocationTimeMin, DeallocationTimeAvg, DeallocationTimeMax; + VkDeviceSize TotalMemoryAllocated; + VkDeviceSize FreeRangeSizeAvg, FreeRangeSizeMax; +}; + +struct PoolTestConfig +{ + uint32_t RandSeed; + uint32_t ThreadCount; + VkDeviceSize PoolSize; + uint32_t FrameCount; + uint32_t TotalItemCount; + // Range for number of items used in each frame. + uint32_t UsedItemCountMin, UsedItemCountMax; + // Percent of items to make unused, and possibly make some others used in each frame. + uint32_t ItemsToMakeUnusedPercent; + std::vector AllocationSizes; + + VkDeviceSize CalcAvgResourceSize() const + { + uint32_t probabilitySum = 0; + VkDeviceSize sizeSum = 0; + for(size_t i = 0; i < AllocationSizes.size(); ++i) + { + const AllocationSize& allocSize = AllocationSizes[i]; + if(allocSize.BufferSizeMax > 0) + sizeSum += (allocSize.BufferSizeMin + allocSize.BufferSizeMax) / 2 * allocSize.Probability; + else + { + const VkDeviceSize avgDimension = (allocSize.ImageSizeMin + allocSize.ImageSizeMax) / 2; + sizeSum += avgDimension * avgDimension * 4 * allocSize.Probability; + } + probabilitySum += allocSize.Probability; + } + return sizeSum / probabilitySum; + } + + bool UsesBuffers() const + { + for(size_t i = 0; i < AllocationSizes.size(); ++i) + if(AllocationSizes[i].BufferSizeMax > 0) + return true; + return false; + } + + bool UsesImages() const + { + for(size_t i = 0; i < AllocationSizes.size(); ++i) + if(AllocationSizes[i].ImageSizeMax > 0) + return true; + return false; + } +}; + +struct PoolTestResult +{ + duration TotalTime; + duration AllocationTimeMin, AllocationTimeAvg, AllocationTimeMax; + duration DeallocationTimeMin, DeallocationTimeAvg, DeallocationTimeMax; + size_t FailedAllocationCount, FailedAllocationTotalSize; +}; + +static const uint32_t IMAGE_BYTES_PER_PIXEL = 1; + +uint32_t g_FrameIndex = 0; + +struct BufferInfo +{ + VkBuffer Buffer = VK_NULL_HANDLE; + VmaAllocation Allocation = VK_NULL_HANDLE; +}; + +static uint32_t MemoryTypeToHeap(uint32_t memoryTypeIndex) +{ + const VkPhysicalDeviceMemoryProperties* props; + vmaGetMemoryProperties(g_hAllocator, &props); + return props->memoryTypes[memoryTypeIndex].heapIndex; +} + +static uint32_t GetAllocationStrategyCount() +{ + switch(ConfigType) + { + case CONFIG_TYPE_MINIMUM: + case CONFIG_TYPE_SMALL: + return 1; + default: assert(0); + case CONFIG_TYPE_AVERAGE: + case CONFIG_TYPE_LARGE: + case CONFIG_TYPE_MAXIMUM: + return 2; + } +} + +static const char* GetAllocationStrategyName(VmaAllocationCreateFlags allocStrategy) +{ + switch(allocStrategy) + { + case VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT: return "MIN_MEMORY"; break; + case VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT: return "MIN_TIME"; break; + case 0: return "Default"; break; + default: assert(0); return ""; + } +} + +static const char* GetVirtualAllocationStrategyName(VmaVirtualAllocationCreateFlags allocStrategy) +{ + switch (allocStrategy) + { + case VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT: return "MIN_MEMORY"; break; + case VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT: return "MIN_TIME"; break; + case 0: return "Default"; break; + default: assert(0); return ""; + } +} + +static void InitResult(Result& outResult) +{ + outResult.TotalTime = duration::zero(); + outResult.AllocationTimeMin = duration::max(); + outResult.AllocationTimeAvg = duration::zero(); + outResult.AllocationTimeMax = duration::min(); + outResult.DeallocationTimeMin = duration::max(); + outResult.DeallocationTimeAvg = duration::zero(); + outResult.DeallocationTimeMax = duration::min(); + outResult.TotalMemoryAllocated = 0; + outResult.FreeRangeSizeAvg = 0; + outResult.FreeRangeSizeMax = 0; +} + +class TimeRegisterObj +{ +public: + TimeRegisterObj(duration& min, duration& sum, duration& max) : + m_Min(min), + m_Sum(sum), + m_Max(max), + m_TimeBeg(std::chrono::high_resolution_clock::now()) + { + } + + ~TimeRegisterObj() + { + duration d = std::chrono::high_resolution_clock::now() - m_TimeBeg; + m_Sum += d; + if(d < m_Min) m_Min = d; + if(d > m_Max) m_Max = d; + } + +private: + duration& m_Min; + duration& m_Sum; + duration& m_Max; + time_point m_TimeBeg; +}; + +struct PoolTestThreadResult +{ + duration AllocationTimeMin, AllocationTimeSum, AllocationTimeMax; + duration DeallocationTimeMin, DeallocationTimeSum, DeallocationTimeMax; + size_t AllocationCount, DeallocationCount; + size_t FailedAllocationCount, FailedAllocationTotalSize; +}; + +class AllocationTimeRegisterObj : public TimeRegisterObj +{ +public: + AllocationTimeRegisterObj(Result& result) : + TimeRegisterObj(result.AllocationTimeMin, result.AllocationTimeAvg, result.AllocationTimeMax) + { + } +}; + +class DeallocationTimeRegisterObj : public TimeRegisterObj +{ +public: + DeallocationTimeRegisterObj(Result& result) : + TimeRegisterObj(result.DeallocationTimeMin, result.DeallocationTimeAvg, result.DeallocationTimeMax) + { + } +}; + +class PoolAllocationTimeRegisterObj : public TimeRegisterObj +{ +public: + PoolAllocationTimeRegisterObj(PoolTestThreadResult& result) : + TimeRegisterObj(result.AllocationTimeMin, result.AllocationTimeSum, result.AllocationTimeMax) + { + } +}; + +class PoolDeallocationTimeRegisterObj : public TimeRegisterObj +{ +public: + PoolDeallocationTimeRegisterObj(PoolTestThreadResult& result) : + TimeRegisterObj(result.DeallocationTimeMin, result.DeallocationTimeSum, result.DeallocationTimeMax) + { + } +}; + +static void CurrentTimeToStr(std::string& out) +{ + time_t rawTime; time(&rawTime); + struct tm timeInfo; localtime_s(&timeInfo, &rawTime); + char timeStr[128]; + strftime(timeStr, _countof(timeStr), "%c", &timeInfo); + out = timeStr; +} + +VkResult MainTest(Result& outResult, const Config& config) +{ + assert(config.ThreadCount > 0); + + InitResult(outResult); + + RandomNumberGenerator mainRand{config.RandSeed}; + + time_point timeBeg = std::chrono::high_resolution_clock::now(); + + std::atomic allocationCount = 0; + VkResult res = VK_SUCCESS; + + uint32_t memUsageProbabilitySum = + config.MemUsageProbability[0] + config.MemUsageProbability[1] + + config.MemUsageProbability[2] + config.MemUsageProbability[3]; + assert(memUsageProbabilitySum > 0); + + uint32_t allocationSizeProbabilitySum = std::accumulate( + config.AllocationSizes.begin(), + config.AllocationSizes.end(), + 0u, + [](uint32_t sum, const AllocationSize& allocSize) { + return sum + allocSize.Probability; + }); + + struct Allocation + { + VkBuffer Buffer; + VkImage Image; + VmaAllocation Alloc; + }; + + std::vector commonAllocations; + std::mutex commonAllocationsMutex; + + auto Allocate = [&]( + VkDeviceSize bufferSize, + const VkExtent2D imageExtent, + RandomNumberGenerator& localRand, + VkDeviceSize& totalAllocatedBytes, + std::vector& allocations) -> VkResult + { + assert((bufferSize == 0) != (imageExtent.width == 0 && imageExtent.height == 0)); + + uint32_t memUsageIndex = 0; + uint32_t memUsageRand = localRand.Generate() % memUsageProbabilitySum; + while(memUsageRand >= config.MemUsageProbability[memUsageIndex]) + memUsageRand -= config.MemUsageProbability[memUsageIndex++]; + + VmaAllocationCreateInfo memReq = {}; + memReq.usage = (VmaMemoryUsage)(VMA_MEMORY_USAGE_GPU_ONLY + memUsageIndex); + memReq.flags |= config.AllocationStrategy; + + Allocation allocation = {}; + VmaAllocationInfo allocationInfo; + + // Buffer + if(bufferSize > 0) + { + assert(imageExtent.width == 0); + VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufferInfo.size = bufferSize; + bufferInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + + { + AllocationTimeRegisterObj timeRegisterObj{outResult}; + res = vmaCreateBuffer(g_hAllocator, &bufferInfo, &memReq, &allocation.Buffer, &allocation.Alloc, &allocationInfo); + } + } + // Image + else + { + VkImageCreateInfo imageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imageInfo.imageType = VK_IMAGE_TYPE_2D; + imageInfo.extent.width = imageExtent.width; + imageInfo.extent.height = imageExtent.height; + imageInfo.extent.depth = 1; + imageInfo.mipLevels = 1; + imageInfo.arrayLayers = 1; + imageInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imageInfo.tiling = memReq.usage == VMA_MEMORY_USAGE_GPU_ONLY ? + VK_IMAGE_TILING_OPTIMAL : + VK_IMAGE_TILING_LINEAR; + imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + switch(memReq.usage) + { + case VMA_MEMORY_USAGE_GPU_ONLY: + switch(localRand.Generate() % 3) + { + case 0: + imageInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + break; + case 1: + imageInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + break; + case 2: + imageInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT; + break; + } + break; + case VMA_MEMORY_USAGE_CPU_ONLY: + case VMA_MEMORY_USAGE_CPU_TO_GPU: + imageInfo.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT; + break; + case VMA_MEMORY_USAGE_GPU_TO_CPU: + imageInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT; + break; + } + imageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + imageInfo.flags = 0; + + { + AllocationTimeRegisterObj timeRegisterObj{outResult}; + res = vmaCreateImage(g_hAllocator, &imageInfo, &memReq, &allocation.Image, &allocation.Alloc, &allocationInfo); + } + } + + if(res == VK_SUCCESS) + { + ++allocationCount; + totalAllocatedBytes += allocationInfo.size; + bool useCommonAllocations = localRand.Generate() % 100 < config.ThreadsUsingCommonAllocationsProbabilityPercent; + if(useCommonAllocations) + { + std::unique_lock lock(commonAllocationsMutex); + commonAllocations.push_back(allocation); + } + else + allocations.push_back(allocation); + } + else + { + TEST(0); + } + return res; + }; + + auto GetNextAllocationSize = [&]( + VkDeviceSize& outBufSize, + VkExtent2D& outImageSize, + RandomNumberGenerator& localRand) + { + outBufSize = 0; + outImageSize = {0, 0}; + + uint32_t allocSizeIndex = 0; + uint32_t r = localRand.Generate() % allocationSizeProbabilitySum; + while(r >= config.AllocationSizes[allocSizeIndex].Probability) + r -= config.AllocationSizes[allocSizeIndex++].Probability; + + const AllocationSize& allocSize = config.AllocationSizes[allocSizeIndex]; + if(allocSize.BufferSizeMax > 0) + { + assert(allocSize.ImageSizeMax == 0); + if(allocSize.BufferSizeMax == allocSize.BufferSizeMin) + outBufSize = allocSize.BufferSizeMin; + else + { + outBufSize = allocSize.BufferSizeMin + localRand.Generate() % (allocSize.BufferSizeMax - allocSize.BufferSizeMin); + outBufSize = outBufSize / 16 * 16; + } + } + else + { + if(allocSize.ImageSizeMax == allocSize.ImageSizeMin) + outImageSize.width = outImageSize.height = allocSize.ImageSizeMax; + else + { + outImageSize.width = allocSize.ImageSizeMin + localRand.Generate() % (allocSize.ImageSizeMax - allocSize.ImageSizeMin); + outImageSize.height = allocSize.ImageSizeMin + localRand.Generate() % (allocSize.ImageSizeMax - allocSize.ImageSizeMin); + } + } + }; + + std::atomic numThreadsReachedMaxAllocations = 0; + HANDLE threadsFinishEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + + auto ThreadProc = [&](uint32_t randSeed) -> void + { + RandomNumberGenerator threadRand(randSeed); + VkDeviceSize threadTotalAllocatedBytes = 0; + std::vector threadAllocations; + VkDeviceSize threadBeginBytesToAllocate = config.BeginBytesToAllocate / config.ThreadCount; + VkDeviceSize threadMaxBytesToAllocate = config.MaxBytesToAllocate / config.ThreadCount; + uint32_t threadAdditionalOperationCount = config.AdditionalOperationCount / config.ThreadCount; + + // BEGIN ALLOCATIONS + for(;;) + { + VkDeviceSize bufferSize = 0; + VkExtent2D imageExtent = {}; + GetNextAllocationSize(bufferSize, imageExtent, threadRand); + if(threadTotalAllocatedBytes + bufferSize + imageExtent.width * imageExtent.height * IMAGE_BYTES_PER_PIXEL < + threadBeginBytesToAllocate) + { + if(Allocate(bufferSize, imageExtent, threadRand, threadTotalAllocatedBytes, threadAllocations) != VK_SUCCESS) + break; + } + else + break; + } + + // ADDITIONAL ALLOCATIONS AND FREES + for(size_t i = 0; i < threadAdditionalOperationCount; ++i) + { + VkDeviceSize bufferSize = 0; + VkExtent2D imageExtent = {}; + GetNextAllocationSize(bufferSize, imageExtent, threadRand); + + // true = allocate, false = free + bool allocate = threadRand.Generate() % 2 != 0; + + if(allocate) + { + if(threadTotalAllocatedBytes + + bufferSize + + imageExtent.width * imageExtent.height * IMAGE_BYTES_PER_PIXEL < + threadMaxBytesToAllocate) + { + if(Allocate(bufferSize, imageExtent, threadRand, threadTotalAllocatedBytes, threadAllocations) != VK_SUCCESS) + break; + } + } + else + { + bool useCommonAllocations = threadRand.Generate() % 100 < config.ThreadsUsingCommonAllocationsProbabilityPercent; + if(useCommonAllocations) + { + std::unique_lock lock(commonAllocationsMutex); + if(!commonAllocations.empty()) + { + size_t indexToFree = threadRand.Generate() % commonAllocations.size(); + VmaAllocationInfo allocationInfo; + vmaGetAllocationInfo(g_hAllocator, commonAllocations[indexToFree].Alloc, &allocationInfo); + if(threadTotalAllocatedBytes >= allocationInfo.size) + { + DeallocationTimeRegisterObj timeRegisterObj{outResult}; + if(commonAllocations[indexToFree].Buffer != VK_NULL_HANDLE) + vmaDestroyBuffer(g_hAllocator, commonAllocations[indexToFree].Buffer, commonAllocations[indexToFree].Alloc); + else + vmaDestroyImage(g_hAllocator, commonAllocations[indexToFree].Image, commonAllocations[indexToFree].Alloc); + threadTotalAllocatedBytes -= allocationInfo.size; + commonAllocations.erase(commonAllocations.begin() + indexToFree); + } + } + } + else + { + if(!threadAllocations.empty()) + { + size_t indexToFree = threadRand.Generate() % threadAllocations.size(); + VmaAllocationInfo allocationInfo; + vmaGetAllocationInfo(g_hAllocator, threadAllocations[indexToFree].Alloc, &allocationInfo); + if(threadTotalAllocatedBytes >= allocationInfo.size) + { + DeallocationTimeRegisterObj timeRegisterObj{outResult}; + if(threadAllocations[indexToFree].Buffer != VK_NULL_HANDLE) + vmaDestroyBuffer(g_hAllocator, threadAllocations[indexToFree].Buffer, threadAllocations[indexToFree].Alloc); + else + vmaDestroyImage(g_hAllocator, threadAllocations[indexToFree].Image, threadAllocations[indexToFree].Alloc); + threadTotalAllocatedBytes -= allocationInfo.size; + threadAllocations.erase(threadAllocations.begin() + indexToFree); + } + } + } + } + } + + ++numThreadsReachedMaxAllocations; + + WaitForSingleObject(threadsFinishEvent, INFINITE); + + // DEALLOCATION + while(!threadAllocations.empty()) + { + size_t indexToFree = 0; + switch(config.FreeOrder) + { + case FREE_ORDER::FORWARD: + indexToFree = 0; + break; + case FREE_ORDER::BACKWARD: + indexToFree = threadAllocations.size() - 1; + break; + case FREE_ORDER::RANDOM: + indexToFree = mainRand.Generate() % threadAllocations.size(); + break; + } + + { + DeallocationTimeRegisterObj timeRegisterObj{outResult}; + if(threadAllocations[indexToFree].Buffer != VK_NULL_HANDLE) + vmaDestroyBuffer(g_hAllocator, threadAllocations[indexToFree].Buffer, threadAllocations[indexToFree].Alloc); + else + vmaDestroyImage(g_hAllocator, threadAllocations[indexToFree].Image, threadAllocations[indexToFree].Alloc); + } + threadAllocations.erase(threadAllocations.begin() + indexToFree); + } + }; + + uint32_t threadRandSeed = mainRand.Generate(); + std::vector bkgThreads; + for(size_t i = 0; i < config.ThreadCount; ++i) + { + bkgThreads.emplace_back(std::bind(ThreadProc, threadRandSeed + (uint32_t)i)); + } + + // Wait for threads reached max allocations + while(numThreadsReachedMaxAllocations < config.ThreadCount) + Sleep(0); + + // CALCULATE MEMORY STATISTICS ON FINAL USAGE + VmaTotalStatistics vmaStats = {}; + vmaCalculateStatistics(g_hAllocator, &vmaStats); + outResult.TotalMemoryAllocated = vmaStats.total.statistics.blockBytes; + outResult.FreeRangeSizeMax = vmaStats.total.unusedRangeSizeMax; + outResult.FreeRangeSizeAvg = round_div(vmaStats.total.statistics.blockBytes - vmaStats.total.statistics.allocationBytes, vmaStats.total.unusedRangeCount); + + // Signal threads to deallocate + SetEvent(threadsFinishEvent); + + // Wait for threads finished + for(size_t i = 0; i < bkgThreads.size(); ++i) + bkgThreads[i].join(); + bkgThreads.clear(); + + CloseHandle(threadsFinishEvent); + + // Deallocate remaining common resources + while(!commonAllocations.empty()) + { + size_t indexToFree = 0; + switch(config.FreeOrder) + { + case FREE_ORDER::FORWARD: + indexToFree = 0; + break; + case FREE_ORDER::BACKWARD: + indexToFree = commonAllocations.size() - 1; + break; + case FREE_ORDER::RANDOM: + indexToFree = mainRand.Generate() % commonAllocations.size(); + break; + } + + { + DeallocationTimeRegisterObj timeRegisterObj{outResult}; + if(commonAllocations[indexToFree].Buffer != VK_NULL_HANDLE) + vmaDestroyBuffer(g_hAllocator, commonAllocations[indexToFree].Buffer, commonAllocations[indexToFree].Alloc); + else + vmaDestroyImage(g_hAllocator, commonAllocations[indexToFree].Image, commonAllocations[indexToFree].Alloc); + } + commonAllocations.erase(commonAllocations.begin() + indexToFree); + } + + if(allocationCount) + { + outResult.AllocationTimeAvg /= allocationCount; + outResult.DeallocationTimeAvg /= allocationCount; + } + + outResult.TotalTime = std::chrono::high_resolution_clock::now() - timeBeg; + + return res; +} + +void SaveAllocatorStatsToFile(const wchar_t* filePath, bool detailed = true) +{ +#if !defined(VMA_STATS_STRING_ENABLED) || VMA_STATS_STRING_ENABLED + wprintf(L"Saving JSON dump to file \"%s\"\n", filePath); + char* stats; + vmaBuildStatsString(g_hAllocator, &stats, detailed ? VK_TRUE : VK_FALSE); + SaveFile(filePath, stats, strlen(stats)); + vmaFreeStatsString(g_hAllocator, stats); +#endif +} + +struct AllocInfo +{ + VmaAllocation m_Allocation = VK_NULL_HANDLE; + VkBuffer m_Buffer = VK_NULL_HANDLE; + VkImage m_Image = VK_NULL_HANDLE; + VkImageLayout m_ImageLayout = VK_IMAGE_LAYOUT_UNDEFINED; + uint32_t m_StartValue = 0; + union + { + VkBufferCreateInfo m_BufferInfo; + VkImageCreateInfo m_ImageInfo; + }; + + // After defragmentation. + VkBuffer m_NewBuffer = VK_NULL_HANDLE; + VkImage m_NewImage = VK_NULL_HANDLE; + + void CreateBuffer( + const VkBufferCreateInfo& bufCreateInfo, + const VmaAllocationCreateInfo& allocCreateInfo); + void CreateImage( + const VkImageCreateInfo& imageCreateInfo, + const VmaAllocationCreateInfo& allocCreateInfo, + VkImageLayout layout); + void Destroy(); +}; + +void AllocInfo::CreateBuffer( + const VkBufferCreateInfo& bufCreateInfo, + const VmaAllocationCreateInfo& allocCreateInfo) +{ + m_BufferInfo = bufCreateInfo; + VkResult res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &m_Buffer, &m_Allocation, nullptr); + TEST(res == VK_SUCCESS); +} +void AllocInfo::CreateImage( + const VkImageCreateInfo& imageCreateInfo, + const VmaAllocationCreateInfo& allocCreateInfo, + VkImageLayout layout) +{ + m_ImageInfo = imageCreateInfo; + m_ImageLayout = layout; + VkResult res = vmaCreateImage(g_hAllocator, &imageCreateInfo, &allocCreateInfo, &m_Image, &m_Allocation, nullptr); + TEST(res == VK_SUCCESS); +} + +void AllocInfo::Destroy() +{ + if(m_Image) + { + assert(!m_Buffer); + vkDestroyImage(g_hDevice, m_Image, g_Allocs); + m_Image = VK_NULL_HANDLE; + } + if(m_Buffer) + { + assert(!m_Image); + vkDestroyBuffer(g_hDevice, m_Buffer, g_Allocs); + m_Buffer = VK_NULL_HANDLE; + } + if(m_Allocation) + { + vmaFreeMemory(g_hAllocator, m_Allocation); + m_Allocation = VK_NULL_HANDLE; + } +} + +class StagingBufferCollection +{ +public: + StagingBufferCollection() { } + ~StagingBufferCollection(); + // Returns false if maximum total size of buffers would be exceeded. + bool AcquireBuffer(VkDeviceSize size, VkBuffer& outBuffer, void*& outMappedPtr); + void ReleaseAllBuffers(); + +private: + static const VkDeviceSize MAX_TOTAL_SIZE = 256ull * 1024 * 1024; + struct BufInfo + { + VmaAllocation Allocation = VK_NULL_HANDLE; + VkBuffer Buffer = VK_NULL_HANDLE; + VkDeviceSize Size = VK_WHOLE_SIZE; + void* MappedPtr = nullptr; + bool Used = false; + }; + std::vector m_Bufs; + // Including both used and unused. + VkDeviceSize m_TotalSize = 0; +}; + +StagingBufferCollection::~StagingBufferCollection() +{ + for(size_t i = m_Bufs.size(); i--; ) + { + vmaDestroyBuffer(g_hAllocator, m_Bufs[i].Buffer, m_Bufs[i].Allocation); + } +} + +bool StagingBufferCollection::AcquireBuffer(VkDeviceSize size, VkBuffer& outBuffer, void*& outMappedPtr) +{ + assert(size <= MAX_TOTAL_SIZE); + + // Try to find existing unused buffer with best size. + size_t bestIndex = SIZE_MAX; + for(size_t i = 0, count = m_Bufs.size(); i < count; ++i) + { + BufInfo& currBufInfo = m_Bufs[i]; + if(!currBufInfo.Used && currBufInfo.Size >= size && + (bestIndex == SIZE_MAX || currBufInfo.Size < m_Bufs[bestIndex].Size)) + { + bestIndex = i; + } + } + + if(bestIndex != SIZE_MAX) + { + m_Bufs[bestIndex].Used = true; + outBuffer = m_Bufs[bestIndex].Buffer; + outMappedPtr = m_Bufs[bestIndex].MappedPtr; + return true; + } + + // Allocate new buffer with requested size. + if(m_TotalSize + size <= MAX_TOTAL_SIZE) + { + BufInfo bufInfo; + bufInfo.Size = size; + bufInfo.Used = true; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = size; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; + + VmaAllocationInfo allocInfo; + VkResult res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &bufInfo.Buffer, &bufInfo.Allocation, &allocInfo); + bufInfo.MappedPtr = allocInfo.pMappedData; + TEST(res == VK_SUCCESS && bufInfo.MappedPtr); + + outBuffer = bufInfo.Buffer; + outMappedPtr = bufInfo.MappedPtr; + + m_Bufs.push_back(std::move(bufInfo)); + + m_TotalSize += size; + + return true; + } + + // There are some unused but smaller buffers: Free them and try again. + bool hasUnused = false; + for(size_t i = 0, count = m_Bufs.size(); i < count; ++i) + { + if(!m_Bufs[i].Used) + { + hasUnused = true; + break; + } + } + if(hasUnused) + { + for(size_t i = m_Bufs.size(); i--; ) + { + if(!m_Bufs[i].Used) + { + m_TotalSize -= m_Bufs[i].Size; + vmaDestroyBuffer(g_hAllocator, m_Bufs[i].Buffer, m_Bufs[i].Allocation); + m_Bufs.erase(m_Bufs.begin() + i); + } + } + + return AcquireBuffer(size, outBuffer, outMappedPtr); + } + + return false; +} + +void StagingBufferCollection::ReleaseAllBuffers() +{ + for(size_t i = 0, count = m_Bufs.size(); i < count; ++i) + { + m_Bufs[i].Used = false; + } +} + +static void UploadGpuData(const AllocInfo* allocInfo, size_t allocInfoCount) +{ + StagingBufferCollection stagingBufs; + + bool cmdBufferStarted = false; + for(size_t allocInfoIndex = 0; allocInfoIndex < allocInfoCount; ++allocInfoIndex) + { + const AllocInfo& currAllocInfo = allocInfo[allocInfoIndex]; + if(currAllocInfo.m_Buffer) + { + const VkDeviceSize size = currAllocInfo.m_BufferInfo.size; + + VkBuffer stagingBuf = VK_NULL_HANDLE; + void* stagingBufMappedPtr = nullptr; + if(!stagingBufs.AcquireBuffer(size, stagingBuf, stagingBufMappedPtr)) + { + TEST(cmdBufferStarted); + EndSingleTimeCommands(); + stagingBufs.ReleaseAllBuffers(); + cmdBufferStarted = false; + + bool ok = stagingBufs.AcquireBuffer(size, stagingBuf, stagingBufMappedPtr); + TEST(ok); + } + + // Fill staging buffer. + { + assert(size % sizeof(uint32_t) == 0); + uint32_t* stagingValPtr = (uint32_t*)stagingBufMappedPtr; + uint32_t val = currAllocInfo.m_StartValue; + for(size_t i = 0; i < size / sizeof(uint32_t); ++i) + { + *stagingValPtr = val; + ++stagingValPtr; + ++val; + } + } + + // Issue copy command from staging buffer to destination buffer. + if(!cmdBufferStarted) + { + cmdBufferStarted = true; + BeginSingleTimeCommands(); + } + + VkBufferCopy copy = {}; + copy.srcOffset = 0; + copy.dstOffset = 0; + copy.size = size; + vkCmdCopyBuffer(g_hTemporaryCommandBuffer, stagingBuf, currAllocInfo.m_Buffer, 1, ©); + } + else + { + TEST(currAllocInfo.m_ImageInfo.format == VK_FORMAT_R8G8B8A8_UNORM && "Only RGBA8 images are currently supported."); + TEST(currAllocInfo.m_ImageInfo.mipLevels == 1 && "Only single mip images are currently supported."); + + const VkDeviceSize size = (VkDeviceSize)currAllocInfo.m_ImageInfo.extent.width * currAllocInfo.m_ImageInfo.extent.height * sizeof(uint32_t); + + VkBuffer stagingBuf = VK_NULL_HANDLE; + void* stagingBufMappedPtr = nullptr; + if(!stagingBufs.AcquireBuffer(size, stagingBuf, stagingBufMappedPtr)) + { + TEST(cmdBufferStarted); + EndSingleTimeCommands(); + stagingBufs.ReleaseAllBuffers(); + cmdBufferStarted = false; + + bool ok = stagingBufs.AcquireBuffer(size, stagingBuf, stagingBufMappedPtr); + TEST(ok); + } + + // Fill staging buffer. + { + assert(size % sizeof(uint32_t) == 0); + uint32_t *stagingValPtr = (uint32_t *)stagingBufMappedPtr; + uint32_t val = currAllocInfo.m_StartValue; + for(size_t i = 0; i < size / sizeof(uint32_t); ++i) + { + *stagingValPtr = val; + ++stagingValPtr; + ++val; + } + } + + // Issue copy command from staging buffer to destination buffer. + if(!cmdBufferStarted) + { + cmdBufferStarted = true; + BeginSingleTimeCommands(); + } + + + // Transfer to transfer dst layout + VkImageSubresourceRange subresourceRange = { + VK_IMAGE_ASPECT_COLOR_BIT, + 0, VK_REMAINING_MIP_LEVELS, + 0, VK_REMAINING_ARRAY_LAYERS + }; + + VkImageMemoryBarrier barrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER }; + barrier.srcAccessMask = 0; + barrier.dstAccessMask = 0; + barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; + barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; + barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.image = currAllocInfo.m_Image; + barrier.subresourceRange = subresourceRange; + + vkCmdPipelineBarrier(g_hTemporaryCommandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, + 0, nullptr, + 0, nullptr, + 1, &barrier); + + // Copy image date + VkBufferImageCopy copy = {}; + copy.bufferOffset = 0; + copy.bufferRowLength = 0; + copy.bufferImageHeight = 0; + copy.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + copy.imageSubresource.layerCount = 1; + copy.imageExtent = currAllocInfo.m_ImageInfo.extent; + + vkCmdCopyBufferToImage(g_hTemporaryCommandBuffer, stagingBuf, currAllocInfo.m_Image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ©); + + // Transfer to desired layout + barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; + barrier.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT; + barrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; + barrier.newLayout = currAllocInfo.m_ImageLayout; + + vkCmdPipelineBarrier(g_hTemporaryCommandBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, + 0, nullptr, + 0, nullptr, + 1, &barrier); + } + } + + if(cmdBufferStarted) + { + EndSingleTimeCommands(); + stagingBufs.ReleaseAllBuffers(); + } +} + +static void ValidateGpuData(const AllocInfo* allocInfo, size_t allocInfoCount) +{ + StagingBufferCollection stagingBufs; + + bool cmdBufferStarted = false; + size_t validateAllocIndexOffset = 0; + std::vector validateStagingBuffers; + for(size_t allocInfoIndex = 0; allocInfoIndex < allocInfoCount; ++allocInfoIndex) + { + const AllocInfo& currAllocInfo = allocInfo[allocInfoIndex]; + if(currAllocInfo.m_Buffer) + { + const VkDeviceSize size = currAllocInfo.m_BufferInfo.size; + + VkBuffer stagingBuf = VK_NULL_HANDLE; + void* stagingBufMappedPtr = nullptr; + if(!stagingBufs.AcquireBuffer(size, stagingBuf, stagingBufMappedPtr)) + { + TEST(cmdBufferStarted); + EndSingleTimeCommands(); + cmdBufferStarted = false; + + for(size_t validateIndex = 0; + validateIndex < validateStagingBuffers.size(); + ++validateIndex) + { + const size_t validateAllocIndex = validateIndex + validateAllocIndexOffset; + const VkDeviceSize validateSize = allocInfo[validateAllocIndex].m_BufferInfo.size; + TEST(validateSize % sizeof(uint32_t) == 0); + const uint32_t* stagingValPtr = (const uint32_t*)validateStagingBuffers[validateIndex]; + uint32_t val = allocInfo[validateAllocIndex].m_StartValue; + bool valid = true; + for(size_t i = 0; i < validateSize / sizeof(uint32_t); ++i) + { + if(*stagingValPtr != val) + { + valid = false; + break; + } + ++stagingValPtr; + ++val; + } + TEST(valid); + } + + stagingBufs.ReleaseAllBuffers(); + + validateAllocIndexOffset = allocInfoIndex; + validateStagingBuffers.clear(); + + bool ok = stagingBufs.AcquireBuffer(size, stagingBuf, stagingBufMappedPtr); + TEST(ok); + } + + // Issue copy command from staging buffer to destination buffer. + if(!cmdBufferStarted) + { + cmdBufferStarted = true; + BeginSingleTimeCommands(); + } + + VkBufferCopy copy = {}; + copy.srcOffset = 0; + copy.dstOffset = 0; + copy.size = size; + vkCmdCopyBuffer(g_hTemporaryCommandBuffer, currAllocInfo.m_Buffer, stagingBuf, 1, ©); + + // Sava mapped pointer for later validation. + validateStagingBuffers.push_back(stagingBufMappedPtr); + } + else + { + TEST(0 && "Images not currently supported."); + } + } + + if(cmdBufferStarted) + { + EndSingleTimeCommands(); + + for(size_t validateIndex = 0; + validateIndex < validateStagingBuffers.size(); + ++validateIndex) + { + const size_t validateAllocIndex = validateIndex + validateAllocIndexOffset; + const VkDeviceSize validateSize = allocInfo[validateAllocIndex].m_BufferInfo.size; + TEST(validateSize % sizeof(uint32_t) == 0); + const uint32_t* stagingValPtr = (const uint32_t*)validateStagingBuffers[validateIndex]; + uint32_t val = allocInfo[validateAllocIndex].m_StartValue; + bool valid = true; + for(size_t i = 0; i < validateSize / sizeof(uint32_t); ++i) + { + if(*stagingValPtr != val) + { + valid = false; + break; + } + ++stagingValPtr; + ++val; + } + TEST(valid); + } + + stagingBufs.ReleaseAllBuffers(); + } +} + +static void GetMemReq(VmaAllocationCreateInfo& outMemReq) +{ + outMemReq = {}; + outMemReq.usage = VMA_MEMORY_USAGE_CPU_TO_GPU; + //outMemReq.flags = VMA_ALLOCATION_CREATE_PERSISTENT_MAP_BIT; +} + +static void CreateBuffer( + VmaAllocationCreateInfo allocCreateInfo, + const VkBufferCreateInfo& bufCreateInfo, + bool persistentlyMapped, + AllocInfo& outAllocInfo) +{ + outAllocInfo = {}; + outAllocInfo.m_BufferInfo = bufCreateInfo; + + if (persistentlyMapped) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_MAPPED_BIT; + + VmaAllocationInfo vmaAllocInfo = {}; + ERR_GUARD_VULKAN( vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &outAllocInfo.m_Buffer, &outAllocInfo.m_Allocation, &vmaAllocInfo) ); + + // Setup StartValue and fill. + { + outAllocInfo.m_StartValue = (uint32_t)rand(); + uint32_t* data = (uint32_t*)vmaAllocInfo.pMappedData; + TEST((data != nullptr) == persistentlyMapped); + if(!persistentlyMapped) + { + ERR_GUARD_VULKAN( vmaMapMemory(g_hAllocator, outAllocInfo.m_Allocation, (void**)&data) ); + } + + uint32_t value = outAllocInfo.m_StartValue; + TEST(bufCreateInfo.size % 4 == 0); + for(size_t i = 0; i < bufCreateInfo.size / sizeof(uint32_t); ++i) + data[i] = value++; + + if(!persistentlyMapped) + vmaUnmapMemory(g_hAllocator, outAllocInfo.m_Allocation); + } +} + +void CreateImage( + VmaAllocationCreateInfo allocCreateInfo, + const VkImageCreateInfo& imgCreateInfo, + VkImageLayout dstLayout, + bool persistentlyMapped, + AllocInfo& outAllocInfo) +{ + if (persistentlyMapped) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_MAPPED_BIT; + outAllocInfo.CreateImage(imgCreateInfo, allocCreateInfo, dstLayout); + + // Perform barrier into destination layout + if (dstLayout != imgCreateInfo.initialLayout) + { + BeginSingleTimeCommands(); + + VkImageMemoryBarrier barrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER }; + barrier.srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT; + barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT; + barrier.oldLayout = imgCreateInfo.initialLayout; + barrier.newLayout = dstLayout; + barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.image = outAllocInfo.m_Image; + barrier.subresourceRange = + { + VK_IMAGE_ASPECT_COLOR_BIT, + 0, VK_REMAINING_MIP_LEVELS, + 0, VK_REMAINING_ARRAY_LAYERS + }; + + vkCmdPipelineBarrier(g_hTemporaryCommandBuffer, + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, + 0, nullptr, 0, nullptr, 1, &barrier); + + EndSingleTimeCommands(); + } +} + +static void CreateAllocation(AllocInfo& outAllocation) +{ + outAllocation.m_Allocation = nullptr; + outAllocation.m_Buffer = nullptr; + outAllocation.m_Image = nullptr; + outAllocation.m_StartValue = (uint32_t)rand(); + + VmaAllocationCreateInfo vmaMemReq; + GetMemReq(vmaMemReq); + + VmaAllocationInfo allocInfo; + + const bool isBuffer = true;//(rand() & 0x1) != 0; + const bool isLarge = (rand() % 16) == 0; + if(isBuffer) + { + const uint32_t bufferSize = isLarge ? + (rand() % 10 + 1) * (1024 * 1024) : // 1 MB ... 10 MB + (rand() % 1024 + 1) * 1024; // 1 KB ... 1 MB + + VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufferInfo.size = bufferSize; + bufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VkResult res = vmaCreateBuffer(g_hAllocator, &bufferInfo, &vmaMemReq, &outAllocation.m_Buffer, &outAllocation.m_Allocation, &allocInfo); + outAllocation.m_BufferInfo = bufferInfo; + TEST(res == VK_SUCCESS); + } + else + { + const uint32_t imageSizeX = isLarge ? + 1024 + rand() % (4096 - 1024) : // 1024 ... 4096 + rand() % 1024 + 1; // 1 ... 1024 + const uint32_t imageSizeY = isLarge ? + 1024 + rand() % (4096 - 1024) : // 1024 ... 4096 + rand() % 1024 + 1; // 1 ... 1024 + + VkImageCreateInfo imageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imageInfo.imageType = VK_IMAGE_TYPE_2D; + imageInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imageInfo.extent.width = imageSizeX; + imageInfo.extent.height = imageSizeY; + imageInfo.extent.depth = 1; + imageInfo.mipLevels = 1; + imageInfo.arrayLayers = 1; + imageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + imageInfo.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT; + + VkResult res = vmaCreateImage(g_hAllocator, &imageInfo, &vmaMemReq, &outAllocation.m_Image, &outAllocation.m_Allocation, &allocInfo); + outAllocation.m_ImageInfo = imageInfo; + TEST(res == VK_SUCCESS); + } + + uint32_t* data = (uint32_t*)allocInfo.pMappedData; + if(allocInfo.pMappedData == nullptr) + { + VkResult res = vmaMapMemory(g_hAllocator, outAllocation.m_Allocation, (void**)&data); + TEST(res == VK_SUCCESS); + } + + uint32_t value = outAllocation.m_StartValue; + TEST(allocInfo.size % 4 == 0); + for(size_t i = 0; i < allocInfo.size / sizeof(uint32_t); ++i) + data[i] = value++; + + if(allocInfo.pMappedData == nullptr) + vmaUnmapMemory(g_hAllocator, outAllocation.m_Allocation); +} + +static void DestroyAllocation(const AllocInfo& allocation) +{ + if(allocation.m_Buffer) + vmaDestroyBuffer(g_hAllocator, allocation.m_Buffer, allocation.m_Allocation); + else + vmaDestroyImage(g_hAllocator, allocation.m_Image, allocation.m_Allocation); +} + +static void DestroyAllAllocations(std::vector& allocations) +{ + for(size_t i = allocations.size(); i--; ) + DestroyAllocation(allocations[i]); + allocations.clear(); +} + +static void ValidateAllocationData(const AllocInfo& allocation) +{ + VmaAllocationInfo allocInfo; + vmaGetAllocationInfo(g_hAllocator, allocation.m_Allocation, &allocInfo); + + uint32_t* data = (uint32_t*)allocInfo.pMappedData; + if(allocInfo.pMappedData == nullptr) + { + VkResult res = vmaMapMemory(g_hAllocator, allocation.m_Allocation, (void**)&data); + TEST(res == VK_SUCCESS); + } + + uint32_t value = allocation.m_StartValue; + bool ok = true; + if(allocation.m_Buffer) + { + TEST(allocInfo.size % 4 == 0); + for(size_t i = 0; i < allocInfo.size / sizeof(uint32_t); ++i) + { + if(data[i] != value++) + { + ok = false; + break; + } + } + } + else + { + TEST(allocation.m_Image); + // Images not currently supported. + } + TEST(ok); + + if(allocInfo.pMappedData == nullptr) + vmaUnmapMemory(g_hAllocator, allocation.m_Allocation); +} + +static void RecreateAllocationResource(AllocInfo& allocation) +{ + VmaAllocationInfo allocInfo; + vmaGetAllocationInfo(g_hAllocator, allocation.m_Allocation, &allocInfo); + + if(allocation.m_Buffer) + { + vkDestroyBuffer(g_hDevice, allocation.m_Buffer, g_Allocs); + + VkResult res = vkCreateBuffer(g_hDevice, &allocation.m_BufferInfo, g_Allocs, &allocation.m_Buffer); + TEST(res == VK_SUCCESS); + + // Just to silence validation layer warnings. + VkMemoryRequirements vkMemReq; + vkGetBufferMemoryRequirements(g_hDevice, allocation.m_Buffer, &vkMemReq); + TEST(vkMemReq.size >= allocation.m_BufferInfo.size); + + res = vmaBindBufferMemory(g_hAllocator, allocation.m_Allocation, allocation.m_Buffer); + TEST(res == VK_SUCCESS); + } + else + { + vkDestroyImage(g_hDevice, allocation.m_Image, g_Allocs); + + VkResult res = vkCreateImage(g_hDevice, &allocation.m_ImageInfo, g_Allocs, &allocation.m_Image); + TEST(res == VK_SUCCESS); + + // Just to silence validation layer warnings. + VkMemoryRequirements vkMemReq; + vkGetImageMemoryRequirements(g_hDevice, allocation.m_Image, &vkMemReq); + + res = vmaBindImageMemory(g_hAllocator, allocation.m_Allocation, allocation.m_Image); + TEST(res == VK_SUCCESS); + } +} + +static void ProcessDefragmentationPass(VmaDefragmentationPassMoveInfo& stepInfo) +{ + std::vector beginImageBarriers; + std::vector finalizeImageBarriers; + + VkPipelineStageFlags beginSrcStageMask = 0; + VkPipelineStageFlags beginDstStageMask = VK_PIPELINE_STAGE_TRANSFER_BIT; + + VkPipelineStageFlags finalizeSrcStageMask = VK_PIPELINE_STAGE_TRANSFER_BIT; + VkPipelineStageFlags finalizeDstStageMask = 0; + + bool wantsMemoryBarrier = false; + + VkMemoryBarrier beginMemoryBarrier = { VK_STRUCTURE_TYPE_MEMORY_BARRIER }; + VkMemoryBarrier finalizeMemoryBarrier = { VK_STRUCTURE_TYPE_MEMORY_BARRIER }; + + for (uint32_t i = 0; i < stepInfo.moveCount; ++i) + { + if (stepInfo.pMoves[i].operation == VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY) + { + VmaAllocationInfo info; + vmaGetAllocationInfo(g_hAllocator, stepInfo.pMoves[i].srcAllocation, &info); + + AllocInfo* allocInfo = (AllocInfo*)info.pUserData; + + if (allocInfo->m_Image) + { + VkImage newImage; + + const VkResult result = vkCreateImage(g_hDevice, &allocInfo->m_ImageInfo, g_Allocs, &newImage); + TEST(result >= VK_SUCCESS); + + vmaBindImageMemory(g_hAllocator, stepInfo.pMoves[i].dstTmpAllocation, newImage); + allocInfo->m_NewImage = newImage; + + // Keep track of our pipeline stages that we need to wait/signal on + beginSrcStageMask |= VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + finalizeDstStageMask |= VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + + // We need one pipeline barrier and two image layout transitions here + // First we'll have to turn our newly created image into VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL + // And the second one is turning the old image into VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL + + VkImageSubresourceRange subresourceRange = { + VK_IMAGE_ASPECT_COLOR_BIT, + 0, VK_REMAINING_MIP_LEVELS, + 0, VK_REMAINING_ARRAY_LAYERS + }; + + VkImageMemoryBarrier barrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER }; + barrier.srcAccessMask = 0; + barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT; + barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; + barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; + barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + barrier.image = newImage; + barrier.subresourceRange = subresourceRange; + + beginImageBarriers.push_back(barrier); + + // Second barrier to convert the existing image. This one actually needs a real barrier + barrier.srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT; + barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT; + barrier.oldLayout = allocInfo->m_ImageLayout; + barrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; + barrier.image = allocInfo->m_Image; + + beginImageBarriers.push_back(barrier); + + // And lastly we need a barrier that turns our new image into the layout of the old one + barrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; + barrier.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT; + barrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; + barrier.newLayout = allocInfo->m_ImageLayout; + barrier.image = newImage; + + finalizeImageBarriers.push_back(barrier); + } + else if (allocInfo->m_Buffer) + { + VkBuffer newBuffer; + + const VkResult result = vkCreateBuffer(g_hDevice, &allocInfo->m_BufferInfo, g_Allocs, &newBuffer); + TEST(result >= VK_SUCCESS); + + vmaBindBufferMemory(g_hAllocator, stepInfo.pMoves[i].dstTmpAllocation, newBuffer); + allocInfo->m_NewBuffer = newBuffer; + + // Keep track of our pipeline stages that we need to wait/signal on + beginSrcStageMask |= VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + finalizeDstStageMask |= VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; + + beginMemoryBarrier.srcAccessMask |= VK_ACCESS_MEMORY_WRITE_BIT; + beginMemoryBarrier.dstAccessMask |= VK_ACCESS_TRANSFER_READ_BIT; + + finalizeMemoryBarrier.srcAccessMask |= VK_ACCESS_TRANSFER_WRITE_BIT; + finalizeMemoryBarrier.dstAccessMask |= VK_ACCESS_MEMORY_READ_BIT; + + wantsMemoryBarrier = true; + } + } + } + + if (!beginImageBarriers.empty() || wantsMemoryBarrier) + { + const uint32_t memoryBarrierCount = wantsMemoryBarrier ? 1 : 0; + + vkCmdPipelineBarrier(g_hTemporaryCommandBuffer, beginSrcStageMask, beginDstStageMask, 0, + memoryBarrierCount, &beginMemoryBarrier, + 0, nullptr, + (uint32_t)beginImageBarriers.size(), beginImageBarriers.data()); + } + + for (uint32_t i = 0; i < stepInfo.moveCount; ++i) + { + if (stepInfo.pMoves[i].operation == VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY) + { + VmaAllocationInfo info; + vmaGetAllocationInfo(g_hAllocator, stepInfo.pMoves[i].srcAllocation, &info); + + AllocInfo* allocInfo = (AllocInfo*)info.pUserData; + + if (allocInfo->m_Image) + { + std::vector imageCopies; + + // Copy all mips of the source image into the target image + VkOffset3D offset = { 0, 0, 0 }; + VkExtent3D extent = allocInfo->m_ImageInfo.extent; + + VkImageSubresourceLayers subresourceLayers = { + VK_IMAGE_ASPECT_COLOR_BIT, + 0, + 0, 1 + }; + + for (uint32_t mip = 0; mip < allocInfo->m_ImageInfo.mipLevels; ++mip) + { + subresourceLayers.mipLevel = mip; + + VkImageCopy imageCopy{ + subresourceLayers, + offset, + subresourceLayers, + offset, + extent + }; + + imageCopies.push_back(imageCopy); + + extent.width = std::max(uint32_t(1), extent.width >> 1); + extent.height = std::max(uint32_t(1), extent.height >> 1); + extent.depth = std::max(uint32_t(1), extent.depth >> 1); + } + + vkCmdCopyImage( + g_hTemporaryCommandBuffer, + allocInfo->m_Image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + allocInfo->m_NewImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + (uint32_t)imageCopies.size(), imageCopies.data()); + } + else if (allocInfo->m_Buffer) + { + VkBufferCopy region = { + 0, + 0, + allocInfo->m_BufferInfo.size }; + + vkCmdCopyBuffer(g_hTemporaryCommandBuffer, + allocInfo->m_Buffer, allocInfo->m_NewBuffer, + 1, ®ion); + } + } + } + + if (!finalizeImageBarriers.empty() || wantsMemoryBarrier) + { + const uint32_t memoryBarrierCount = wantsMemoryBarrier ? 1 : 0; + + vkCmdPipelineBarrier(g_hTemporaryCommandBuffer, finalizeSrcStageMask, finalizeDstStageMask, 0, + memoryBarrierCount, &finalizeMemoryBarrier, + 0, nullptr, + (uint32_t)finalizeImageBarriers.size(), finalizeImageBarriers.data()); + } +} + +static void Defragment(VmaDefragmentationInfo& defragmentationInfo, + VmaDefragmentationStats* defragmentationStats = nullptr) +{ + VmaDefragmentationContext defragCtx = nullptr; + VkResult res = vmaBeginDefragmentation(g_hAllocator, &defragmentationInfo, &defragCtx); + TEST(res == VK_SUCCESS); + + VmaDefragmentationPassMoveInfo pass = {}; + while ((res = vmaBeginDefragmentationPass(g_hAllocator, defragCtx, &pass)) == VK_INCOMPLETE) + { + BeginSingleTimeCommands(); + ProcessDefragmentationPass(pass); + EndSingleTimeCommands(); + + // Destroy old buffers/images and replace them with new handles. + for(size_t i = 0; i < pass.moveCount; ++i) + { + VmaAllocation const alloc = pass.pMoves[i].srcAllocation; + VmaAllocationInfo vmaAllocInfo; + vmaGetAllocationInfo(g_hAllocator, alloc, &vmaAllocInfo); + AllocInfo* allocInfo = (AllocInfo*)vmaAllocInfo.pUserData; + + if(allocInfo->m_Buffer) + { + assert(allocInfo->m_NewBuffer && !allocInfo->m_Image && !allocInfo->m_NewImage); + vkDestroyBuffer(g_hDevice, allocInfo->m_Buffer, g_Allocs); + allocInfo->m_Buffer = allocInfo->m_NewBuffer; + allocInfo->m_NewBuffer = VK_NULL_HANDLE; + } + else if(allocInfo->m_Image) + { + assert(allocInfo->m_NewImage && !allocInfo->m_Buffer && !allocInfo->m_NewBuffer); + vkDestroyImage(g_hDevice, allocInfo->m_Image, g_Allocs); + allocInfo->m_Image = allocInfo->m_NewImage; + allocInfo->m_NewImage = VK_NULL_HANDLE; + } + else + assert(0); + } + if ((res = vmaEndDefragmentationPass(g_hAllocator, defragCtx, &pass)) == VK_SUCCESS) + break; + TEST(res == VK_INCOMPLETE); + } + TEST(res == VK_SUCCESS); + + vmaEndDefragmentation(g_hAllocator, defragCtx, defragmentationStats); +} + +static void ValidateAllocationsData(const AllocInfo* allocs, size_t allocCount) +{ + std::for_each(allocs, allocs + allocCount, [](const AllocInfo& allocInfo) { + ValidateAllocationData(allocInfo); + }); +} + + +static void TestJson() +{ + wprintf(L"Test JSON\n"); + + std::vector pools; + std::vector allocs; + + VmaAllocationCreateInfo allocCreateInfo = {}; + + VkBufferCreateInfo buffCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + buffCreateInfo.size = 1024; + buffCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VkImageCreateInfo imgCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imgCreateInfo.imageType = VK_IMAGE_TYPE_2D; + imgCreateInfo.extent.depth = 1; + imgCreateInfo.mipLevels = 1; + imgCreateInfo.arrayLayers = 1; + imgCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imgCreateInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + imgCreateInfo.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + imgCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + VkMemoryRequirements memReq = {}; + { + VkBuffer dummyBuffer = VK_NULL_HANDLE; + TEST(vkCreateBuffer(g_hDevice, &buffCreateInfo, g_Allocs, &dummyBuffer) == VK_SUCCESS && dummyBuffer); + + vkGetBufferMemoryRequirements(g_hDevice, dummyBuffer, &memReq); + vkDestroyBuffer(g_hDevice, dummyBuffer, g_Allocs); + } + + // Select if using custom pool or default + for (uint8_t poolType = 0; poolType < 2; ++poolType) + { + // Select different memoryTypes + for (uint8_t memType = 0; memType < 2; ++memType) + { + switch (memType) + { + case 0: + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DONT_BIND_BIT; + break; + case 1: + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DONT_BIND_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + break; + } + + switch (poolType) + { + case 0: + allocCreateInfo.pool = nullptr; + break; + case 1: + { + VmaPoolCreateInfo poolCreateInfo = {}; + TEST(vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &buffCreateInfo, &allocCreateInfo, &poolCreateInfo.memoryTypeIndex) == VK_SUCCESS); + + VmaPool pool; + TEST(vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool) == VK_SUCCESS); + + allocCreateInfo.pool = pool; + pools.emplace_back(pool); + break; + } + } + + // Select different allocation flags + for (uint8_t allocFlag = 0; allocFlag < 2; ++allocFlag) + { + switch (allocFlag) + { + case 1: + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + break; + } + + // Select different alloc types (block, buffer, texture, etc.) + for (uint8_t allocType = 0; allocType < 4; ++allocType) + { + // Select different data stored in the allocation + for (uint8_t data = 0; data < 4; ++data) + { + VmaAllocation alloc = nullptr; + + switch (allocType) + { + case 0: + { + VmaAllocationCreateInfo localCreateInfo = allocCreateInfo; + switch (memType) + { + case 0: + localCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; + break; + case 1: + localCreateInfo.usage = VMA_MEMORY_USAGE_CPU_ONLY; + break; + } + TEST(vmaAllocateMemory(g_hAllocator, &memReq, &localCreateInfo, &alloc, nullptr) == VK_SUCCESS || alloc == VK_NULL_HANDLE); + break; + } + case 1: + { + VkBuffer buffer; + TEST(vmaCreateBuffer(g_hAllocator, &buffCreateInfo, &allocCreateInfo, &buffer, &alloc, nullptr) == VK_SUCCESS || alloc == VK_NULL_HANDLE); + vkDestroyBuffer(g_hDevice, buffer, g_Allocs); + break; + } + case 2: + { + imgCreateInfo.tiling = VK_IMAGE_TILING_LINEAR; + imgCreateInfo.extent.width = 512; + imgCreateInfo.extent.height = 1; + VkImage image; + TEST(vmaCreateImage(g_hAllocator, &imgCreateInfo, &allocCreateInfo, &image, &alloc, nullptr) == VK_SUCCESS || alloc == VK_NULL_HANDLE); + vkDestroyImage(g_hDevice, image, g_Allocs); + break; + } + case 3: + { + imgCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imgCreateInfo.extent.width = 1024; + imgCreateInfo.extent.height = 512; + VkImage image; + TEST(vmaCreateImage(g_hAllocator, &imgCreateInfo, &allocCreateInfo, &image, &alloc, nullptr) == VK_SUCCESS || alloc == VK_NULL_HANDLE); + vkDestroyImage(g_hDevice, image, g_Allocs); + break; + } + } + + if(alloc) + { + switch (data) + { + case 1: + vmaSetAllocationUserData(g_hAllocator, alloc, (void*)16112007); + break; + case 2: + vmaSetAllocationName(g_hAllocator, alloc, "SHEPURD"); + break; + case 3: + vmaSetAllocationUserData(g_hAllocator, alloc, (void*)26012010); + vmaSetAllocationName(g_hAllocator, alloc, "JOKER"); + break; + } + allocs.emplace_back(alloc); + } + } + } + + } + } + } + SaveAllocatorStatsToFile(L"JSON_VULKAN.json"); + + for (auto& alloc : allocs) + vmaFreeMemory(g_hAllocator, alloc); + for (auto& pool : pools) + vmaDestroyPool(g_hAllocator, pool); +} + +void TestDefragmentationSimple() +{ + wprintf(L"Test defragmentation simple\n"); + + RandomNumberGenerator rand(667); + + const VkDeviceSize BUF_SIZE = 0x10000; + const VkDeviceSize BLOCK_SIZE = BUF_SIZE * 8; + + const VkDeviceSize MIN_BUF_SIZE = 32; + const VkDeviceSize MAX_BUF_SIZE = BUF_SIZE * 4; + auto RandomBufSize = [&]() -> VkDeviceSize + { + return align_up(rand.Generate() % (MAX_BUF_SIZE - MIN_BUF_SIZE + 1) + MIN_BUF_SIZE, 64); + }; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = BUF_SIZE; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + + uint32_t memTypeIndex = UINT32_MAX; + vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &memTypeIndex); + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.blockSize = BLOCK_SIZE; + poolCreateInfo.memoryTypeIndex = memTypeIndex; + + VmaPool pool; + TEST(vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool) == VK_SUCCESS); + allocCreateInfo.pool = pool; + + VmaDefragmentationInfo defragInfo = {}; + defragInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT; + defragInfo.pool = pool; + + // Defragmentation of empty pool. + { + VmaDefragmentationContext defragCtx = nullptr; + VkResult res = vmaBeginDefragmentation(g_hAllocator, &defragInfo, &defragCtx); + TEST(res == VK_SUCCESS); + + VmaDefragmentationPassMoveInfo pass = {}; + res = vmaBeginDefragmentationPass(g_hAllocator, defragCtx, &pass); + TEST(res == VK_SUCCESS); + + VmaDefragmentationStats defragStats = {}; + vmaEndDefragmentation(g_hAllocator, defragCtx, &defragStats); + TEST(defragStats.allocationsMoved == 0 && defragStats.bytesFreed == 0 && + defragStats.bytesMoved == 0 && defragStats.deviceMemoryBlocksFreed == 0); + } + + std::vector allocations; + + // persistentlyMappedOption = 0 - not persistently mapped. + // persistentlyMappedOption = 1 - persistently mapped. + for (uint32_t persistentlyMappedOption = 0; persistentlyMappedOption < 2; ++persistentlyMappedOption) + { + wprintf(L" Persistently mapped option = %u\n", persistentlyMappedOption); + const bool persistentlyMapped = persistentlyMappedOption != 0; + + // # Test 1 + // Buffers of fixed size. + // Fill 2 blocks. Remove odd buffers. Defragment everything. + // Expected result: at least 1 block freed. + { + for (size_t i = 0; i < BLOCK_SIZE / BUF_SIZE * 2; ++i) + { + AllocInfo allocInfo; + CreateBuffer(allocCreateInfo, bufCreateInfo, persistentlyMapped, allocInfo); + allocations.push_back(allocInfo); + } + + for (size_t i = 1; i < allocations.size(); ++i) + { + DestroyAllocation(allocations[i]); + allocations.erase(allocations.begin() + i); + } + + // Set data for defragmentation retrieval + for (auto& alloc : allocations) + vmaSetAllocationUserData(g_hAllocator, alloc.m_Allocation, &alloc); + + VmaDefragmentationStats defragStats; + Defragment(defragInfo, &defragStats); + TEST(defragStats.allocationsMoved == 4 && defragStats.bytesMoved == 4 * BUF_SIZE); + + ValidateAllocationsData(allocations.data(), allocations.size()); + DestroyAllAllocations(allocations); + } + + // # Test 2 + // Buffers of fixed size. + // Fill 2 blocks. Remove odd buffers. Defragment one buffer at time. + // Expected result: Each of 4 interations makes some progress. + { + for (size_t i = 0; i < BLOCK_SIZE / BUF_SIZE * 2; ++i) + { + AllocInfo allocInfo; + CreateBuffer(allocCreateInfo, bufCreateInfo, persistentlyMapped, allocInfo); + allocations.push_back(allocInfo); + } + + for (size_t i = 1; i < allocations.size(); ++i) + { + DestroyAllocation(allocations[i]); + allocations.erase(allocations.begin() + i); + } + + // Set data for defragmentation retrieval + for (auto& alloc : allocations) + vmaSetAllocationUserData(g_hAllocator, alloc.m_Allocation, &alloc); + + defragInfo.maxAllocationsPerPass = 1; + defragInfo.maxBytesPerPass = BUF_SIZE; + + VmaDefragmentationContext defragCtx = nullptr; + VkResult res = vmaBeginDefragmentation(g_hAllocator, &defragInfo, &defragCtx); + TEST(res == VK_SUCCESS); + + for (size_t i = 0; i < BLOCK_SIZE / BUF_SIZE / 2; ++i) + { + VmaDefragmentationPassMoveInfo pass = {}; + res = vmaBeginDefragmentationPass(g_hAllocator, defragCtx, &pass); + TEST(res == VK_INCOMPLETE); + + BeginSingleTimeCommands(); + ProcessDefragmentationPass(pass); + EndSingleTimeCommands(); + + // Destroy old buffers/images and replace them with new handles. + for (size_t i = 0; i < pass.moveCount; ++i) + { + VmaAllocation const alloc = pass.pMoves[i].srcAllocation; + VmaAllocationInfo vmaAllocInfo; + vmaGetAllocationInfo(g_hAllocator, alloc, &vmaAllocInfo); + AllocInfo* allocInfo = (AllocInfo*)vmaAllocInfo.pUserData; + + if (allocInfo->m_Buffer) + { + assert(allocInfo->m_NewBuffer && !allocInfo->m_Image && !allocInfo->m_NewImage); + vkDestroyBuffer(g_hDevice, allocInfo->m_Buffer, g_Allocs); + allocInfo->m_Buffer = allocInfo->m_NewBuffer; + allocInfo->m_NewBuffer = VK_NULL_HANDLE; + } + else if (allocInfo->m_Image) + { + assert(allocInfo->m_NewImage && !allocInfo->m_Buffer && !allocInfo->m_NewBuffer); + vkDestroyImage(g_hDevice, allocInfo->m_Image, g_Allocs); + allocInfo->m_Image = allocInfo->m_NewImage; + allocInfo->m_NewImage = VK_NULL_HANDLE; + } + else + assert(0); + } + + res = vmaEndDefragmentationPass(g_hAllocator, defragCtx, &pass); + TEST(res == VK_INCOMPLETE); + } + + VmaDefragmentationStats defragStats = {}; + vmaEndDefragmentation(g_hAllocator, defragCtx, &defragStats); + TEST(defragStats.allocationsMoved == 4 && defragStats.bytesMoved == 4 * BUF_SIZE); + + ValidateAllocationsData(allocations.data(), allocations.size()); + DestroyAllAllocations(allocations); + } + + // # Test 3 + // Buffers of variable size. + // Create a number of buffers. Remove some percent of them. + // Defragment while having some percent of them unmovable. + // Expected result: Just simple validation. + { + for (size_t i = 0; i < 100; ++i) + { + VkBufferCreateInfo localBufCreateInfo = bufCreateInfo; + localBufCreateInfo.size = RandomBufSize(); + + AllocInfo allocInfo; + CreateBuffer(allocCreateInfo, localBufCreateInfo, persistentlyMapped, allocInfo); + allocations.push_back(allocInfo); + } + + const uint32_t percentToDelete = 60; + const size_t numberToDelete = allocations.size() * percentToDelete / 100; + for (size_t i = 0; i < numberToDelete; ++i) + { + size_t indexToDelete = rand.Generate() % (uint32_t)allocations.size(); + DestroyAllocation(allocations[indexToDelete]); + allocations.erase(allocations.begin() + indexToDelete); + } + + // Non-movable allocations will be at the beginning of allocations array. + const uint32_t percentNonMovable = 20; + const size_t numberNonMovable = allocations.size() * percentNonMovable / 100; + for (size_t i = 0; i < numberNonMovable; ++i) + { + size_t indexNonMovable = i + rand.Generate() % (uint32_t)(allocations.size() - i); + if (indexNonMovable != i) + std::swap(allocations[i], allocations[indexNonMovable]); + } + + // Set data for defragmentation retrieval + for (auto& alloc : allocations) + vmaSetAllocationUserData(g_hAllocator, alloc.m_Allocation, &alloc); + + defragInfo.maxAllocationsPerPass = 0; + defragInfo.maxBytesPerPass = 0; + + VmaDefragmentationContext defragCtx = nullptr; + VkResult res = vmaBeginDefragmentation(g_hAllocator, &defragInfo, &defragCtx); + TEST(res == VK_SUCCESS); + + VmaDefragmentationPassMoveInfo pass = {}; + while ((res = vmaBeginDefragmentationPass(g_hAllocator, defragCtx, &pass)) == VK_INCOMPLETE) + { + VmaDefragmentationMove* end = pass.pMoves + pass.moveCount; + for (uint32_t i = 0; i < numberNonMovable; ++i) + { + VmaDefragmentationMove* move = std::find_if(pass.pMoves, end, [&](VmaDefragmentationMove& move) { return move.srcAllocation == allocations[i].m_Allocation; }); + if (move != end) + move->operation = VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE; + } + + BeginSingleTimeCommands(); + ProcessDefragmentationPass(pass); + EndSingleTimeCommands(); + + // Destroy old buffers/images and replace them with new handles. + for (size_t i = 0; i < pass.moveCount; ++i) + { + if (pass.pMoves[i].operation != VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE) + { + VmaAllocation const alloc = pass.pMoves[i].srcAllocation; + VmaAllocationInfo vmaAllocInfo; + vmaGetAllocationInfo(g_hAllocator, alloc, &vmaAllocInfo); + AllocInfo* allocInfo = (AllocInfo*)vmaAllocInfo.pUserData; + + if (allocInfo->m_Buffer) + { + assert(allocInfo->m_NewBuffer && !allocInfo->m_Image && !allocInfo->m_NewImage); + vkDestroyBuffer(g_hDevice, allocInfo->m_Buffer, g_Allocs); + allocInfo->m_Buffer = allocInfo->m_NewBuffer; + allocInfo->m_NewBuffer = VK_NULL_HANDLE; + } + else + assert(0); + } + } + + if ((res = vmaEndDefragmentationPass(g_hAllocator, defragCtx, &pass)) == VK_SUCCESS) + break; + TEST(res == VK_INCOMPLETE); + } + TEST(res == VK_SUCCESS); + + VmaDefragmentationStats defragStats; + vmaEndDefragmentation(g_hAllocator, defragCtx, &defragStats); + + ValidateAllocationsData(allocations.data(), allocations.size()); + DestroyAllAllocations(allocations); + } + } + + vmaDestroyPool(g_hAllocator, pool); +} + +void TestDefragmentationVsMapping() +{ + wprintf(L"Test defragmentation vs mapping\n"); + + VkBufferCreateInfo bufCreateInfo = {VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; + bufCreateInfo.size = 64 * KILOBYTE; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + VmaAllocationCreateInfo dummyAllocCreateInfo = {}; + dummyAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + dummyAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.flags = VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT; + poolCreateInfo.blockSize = 1 * MEGABYTE; + TEST(vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufCreateInfo, &dummyAllocCreateInfo, &poolCreateInfo.memoryTypeIndex) + == VK_SUCCESS); + + VmaPool pool = VK_NULL_HANDLE; + TEST(vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool) == VK_SUCCESS); + + RandomNumberGenerator rand{2355762}; + + // 16 * 64 KB allocations fit into a single 1 MB block. Create 10 such blocks. + constexpr uint32_t START_ALLOC_COUNT = 160; + std::vector allocs{START_ALLOC_COUNT}; + + constexpr uint32_t RAND_NUM_PERSISTENTLY_MAPPED_BIT = 0x1000; + constexpr uint32_t RAND_NUM_MANUAL_MAP_COUNT_MASK = 0x3; + + // Create all the allocations, map what's needed. + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + for(size_t allocIndex = 0; allocIndex < START_ALLOC_COUNT; ++allocIndex) + { + const uint32_t randNum = rand.Generate(); + if(randNum & RAND_NUM_PERSISTENTLY_MAPPED_BIT) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_MAPPED_BIT; + else + allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_MAPPED_BIT; + allocs[allocIndex].CreateBuffer(bufCreateInfo, allocCreateInfo); + vmaSetAllocationUserData(g_hAllocator, allocs[allocIndex].m_Allocation, (void*)(uintptr_t)randNum); + } + } + + // Destroy 2/3 of them. + for(uint32_t i = 0; i < START_ALLOC_COUNT * 2 / 3; ++i) + { + const uint32_t allocIndexToRemove = rand.Generate() % allocs.size(); + allocs[allocIndexToRemove].Destroy(); + allocs.erase(allocs.begin() + allocIndexToRemove); + } + + // Map the remaining allocations the right number of times. + for(size_t allocIndex = 0, allocCount = allocs.size(); allocIndex < allocCount; ++allocIndex) + { + VmaAllocationInfo allocInfo; + vmaGetAllocationInfo(g_hAllocator, allocs[allocIndex].m_Allocation, &allocInfo); + const uint32_t randNum = (uint32_t)(uintptr_t)allocInfo.pUserData; + const uint32_t mapCount = randNum & RAND_NUM_MANUAL_MAP_COUNT_MASK; + for(uint32_t mapIndex = 0; mapIndex < mapCount; ++mapIndex) + { + void* ptr; + TEST(vmaMapMemory(g_hAllocator, allocs[allocIndex].m_Allocation, &ptr) == VK_SUCCESS); + TEST(ptr != nullptr); + } + } + + // Defragment! + { + VmaDefragmentationInfo defragInfo = {}; + defragInfo.pool = pool; + defragInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT; + VmaDefragmentationContext defragCtx; + TEST(vmaBeginDefragmentation(g_hAllocator, &defragInfo, &defragCtx) == VK_SUCCESS); + + for(uint32_t passIndex = 0; ; ++passIndex) + { + VmaDefragmentationPassMoveInfo passInfo = {}; + VkResult res = vmaBeginDefragmentationPass(g_hAllocator, defragCtx, &passInfo); + if(res == VK_SUCCESS) + break; + TEST(res == VK_INCOMPLETE); + + wprintf(L" Pass %u moving %u allocations\n", passIndex, passInfo.moveCount); + + for(uint32_t moveIndex = 0; moveIndex < passInfo.moveCount; ++moveIndex) + { + if(rand.Generate() % 5 == 0) + passInfo.pMoves[moveIndex].operation = VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE; + } + + + res = vmaEndDefragmentationPass(g_hAllocator, defragCtx, &passInfo); + if(res == VK_SUCCESS) + break; + TEST(res == VK_INCOMPLETE); + } + + VmaDefragmentationStats defragStats = {}; + vmaEndDefragmentation(g_hAllocator, defragCtx, &defragStats); + wprintf(L" Defragmentation: moved %u allocations, %llu B, freed %u memory blocks, %llu B\n", + defragStats.allocationsMoved, defragStats.bytesMoved, + defragStats.deviceMemoryBlocksFreed, defragStats.bytesFreed); + TEST(defragStats.allocationsMoved > 0 && defragStats.bytesMoved > 0); + TEST(defragStats.deviceMemoryBlocksFreed > 0 && defragStats.bytesFreed > 0); + } + + // Test mapping and unmap + for(size_t allocIndex = allocs.size(); allocIndex--; ) + { + VmaAllocationInfo allocInfo; + vmaGetAllocationInfo(g_hAllocator, allocs[allocIndex].m_Allocation, &allocInfo); + const uint32_t randNum = (uint32_t)(uintptr_t)allocInfo.pUserData; + const bool isMapped = (randNum & (RAND_NUM_PERSISTENTLY_MAPPED_BIT | RAND_NUM_MANUAL_MAP_COUNT_MASK)) != 0; + TEST(isMapped == (allocInfo.pMappedData != nullptr)); + + const uint32_t mapCount = randNum & RAND_NUM_MANUAL_MAP_COUNT_MASK; + for(uint32_t mapIndex = 0; mapIndex < mapCount; ++mapIndex) + vmaUnmapMemory(g_hAllocator, allocs[allocIndex].m_Allocation); + } + + // Destroy all the remaining allocations. + for(size_t i = allocs.size(); i--; ) + allocs[i].Destroy(); + + vmaDestroyPool(g_hAllocator, pool); +} + +void TestDefragmentationAlgorithms() +{ + wprintf(L"Test defragmentation simple\n"); + + RandomNumberGenerator rand(669); + + const VkDeviceSize BUF_SIZE = 0x10000; + const uint32_t TEX_SIZE = 256; + const VkDeviceSize BLOCK_SIZE = BUF_SIZE * 200 + TEX_SIZE * 200; + + const VkDeviceSize MIN_BUF_SIZE = 2048; + const VkDeviceSize MAX_BUF_SIZE = BUF_SIZE * 4; + auto RandomBufSize = [&]() -> VkDeviceSize + { + return align_up(rand.Generate() % (MAX_BUF_SIZE - MIN_BUF_SIZE + 1) + MIN_BUF_SIZE, 64); + }; + + const uint32_t MIN_TEX_SIZE = 512; + const uint32_t MAX_TEX_SIZE = TEX_SIZE * 4; + auto RandomTexSize = [&]() -> uint32_t + { + return align_up(rand.Generate() % (MAX_TEX_SIZE - MIN_TEX_SIZE + 1) + MIN_TEX_SIZE, 64); + }; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = BUF_SIZE; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VkImageCreateInfo imageCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imageCreateInfo.imageType = VK_IMAGE_TYPE_2D; + imageCreateInfo.extent.depth = 1; + imageCreateInfo.mipLevels = 1; + imageCreateInfo.arrayLayers = 1; + imageCreateInfo.format = VK_FORMAT_R8_UNORM; + imageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imageCreateInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + imageCreateInfo.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + imageCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + + uint32_t memTypeIndex = UINT32_MAX; + vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &memTypeIndex); + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.blockSize = BLOCK_SIZE; + poolCreateInfo.memoryTypeIndex = memTypeIndex; + + VmaPool pool; + TEST(vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool) == VK_SUCCESS); + allocCreateInfo.pool = pool; + + VmaDefragmentationInfo defragInfo = {}; + defragInfo.pool = pool; + + std::vector allocations; + + for (uint8_t i = 0; i < 4; ++i) + { + switch (i) + { + case 0: + defragInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT; + break; + case 1: + defragInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT; + break; + case 2: + defragInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT; + break; + case 3: + defragInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT; + break; + } + wprintf(L" Algorithm = %s\n", DefragmentationAlgorithmToStr(defragInfo.flags)); + + // 0 - Without immovable allocations + // 1 - With immovable allocations + for (uint8_t j = 0; j < 2; ++j) + { + for (size_t i = 0; i < 400; ++i) + { + bufCreateInfo.size = RandomBufSize(); + + AllocInfo allocInfo; + CreateBuffer(allocCreateInfo, bufCreateInfo, false, allocInfo); + allocations.push_back(allocInfo); + } + for (size_t i = 0; i < 100; ++i) + { + imageCreateInfo.extent.width = RandomTexSize(); + imageCreateInfo.extent.height = RandomTexSize(); + + AllocInfo allocInfo; + CreateImage(allocCreateInfo, imageCreateInfo, VK_IMAGE_LAYOUT_GENERAL, false, allocInfo); + allocations.push_back(allocInfo); + } + + const uint32_t percentToDelete = 55; + const size_t numberToDelete = allocations.size() * percentToDelete / 100; + for (size_t i = 0; i < numberToDelete; ++i) + { + size_t indexToDelete = rand.Generate() % (uint32_t)allocations.size(); + DestroyAllocation(allocations[indexToDelete]); + allocations.erase(allocations.begin() + indexToDelete); + } + + // Non-movable allocations will be at the beginning of allocations array. + const uint32_t percentNonMovable = 20; + const size_t numberNonMovable = j == 0 ? 0 : (allocations.size() * percentNonMovable / 100); + for (size_t i = 0; i < numberNonMovable; ++i) + { + size_t indexNonMovable = i + rand.Generate() % (uint32_t)(allocations.size() - i); + if (indexNonMovable != i) + std::swap(allocations[i], allocations[indexNonMovable]); + } + + // Set data for defragmentation retrieval + for (auto& alloc : allocations) + vmaSetAllocationUserData(g_hAllocator, alloc.m_Allocation, &alloc); + + std::wstring output = DefragmentationAlgorithmToStr(defragInfo.flags); + if (j == 0) + output += L"_NoMove"; + else + output += L"_Move"; + SaveAllocatorStatsToFile((output + L"_Before.json").c_str()); + + VmaDefragmentationContext defragCtx = nullptr; + VkResult res = vmaBeginDefragmentation(g_hAllocator, &defragInfo, &defragCtx); + TEST(res == VK_SUCCESS); + + VmaDefragmentationPassMoveInfo pass = {}; + while ((res = vmaBeginDefragmentationPass(g_hAllocator, defragCtx, &pass)) == VK_INCOMPLETE) + { + VmaDefragmentationMove* end = pass.pMoves + pass.moveCount; + for (uint32_t i = 0; i < numberNonMovable; ++i) + { + VmaDefragmentationMove* move = std::find_if(pass.pMoves, end, [&](VmaDefragmentationMove& move) { return move.srcAllocation == allocations[i].m_Allocation; }); + if (move != end) + move->operation = VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE; + } + for (uint32_t i = 0; i < pass.moveCount; ++i) + { + auto it = std::find_if(allocations.begin(), allocations.end(), [&](const AllocInfo& info) { return pass.pMoves[i].srcAllocation == info.m_Allocation; }); + assert(it != allocations.end()); + } + + BeginSingleTimeCommands(); + ProcessDefragmentationPass(pass); + EndSingleTimeCommands(); + + // Destroy old buffers/images and replace them with new handles. + for (size_t i = 0; i < pass.moveCount; ++i) + { + if (pass.pMoves[i].operation == VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY) + { + VmaAllocation const alloc = pass.pMoves[i].srcAllocation; + VmaAllocationInfo vmaAllocInfo; + vmaGetAllocationInfo(g_hAllocator, alloc, &vmaAllocInfo); + AllocInfo* allocInfo = (AllocInfo*)vmaAllocInfo.pUserData; + + if (allocInfo->m_Buffer) + { + assert(allocInfo->m_NewBuffer && !allocInfo->m_Image && !allocInfo->m_NewImage); + vkDestroyBuffer(g_hDevice, allocInfo->m_Buffer, g_Allocs); + allocInfo->m_Buffer = allocInfo->m_NewBuffer; + allocInfo->m_NewBuffer = VK_NULL_HANDLE; + } + else if (allocInfo->m_Image) + { + assert(allocInfo->m_NewImage && !allocInfo->m_Buffer && !allocInfo->m_NewBuffer); + vkDestroyImage(g_hDevice, allocInfo->m_Image, g_Allocs); + allocInfo->m_Image = allocInfo->m_NewImage; + allocInfo->m_NewImage = VK_NULL_HANDLE; + } + else + assert(0); + } + } + + if ((res = vmaEndDefragmentationPass(g_hAllocator, defragCtx, &pass)) == VK_SUCCESS) + break; + TEST(res == VK_INCOMPLETE); + } + TEST(res == VK_SUCCESS); + + VmaDefragmentationStats defragStats; + vmaEndDefragmentation(g_hAllocator, defragCtx, &defragStats); + + SaveAllocatorStatsToFile((output + L"_After.json").c_str()); + ValidateAllocationsData(allocations.data(), allocations.size()); + DestroyAllAllocations(allocations); + } + } + + vmaDestroyPool(g_hAllocator, pool); +} + +void TestDefragmentationFull() +{ + std::vector allocations; + + // Create initial allocations. + for(size_t i = 0; i < 400; ++i) + { + AllocInfo allocation; + CreateAllocation(allocation); + allocations.push_back(allocation); + } + + // Delete random allocations + const size_t allocationsToDeletePercent = 80; + size_t allocationsToDelete = allocations.size() * allocationsToDeletePercent / 100; + for(size_t i = 0; i < allocationsToDelete; ++i) + { + size_t index = (size_t)rand() % allocations.size(); + DestroyAllocation(allocations[index]); + allocations.erase(allocations.begin() + index); + } + //ValidateAllocationsData(allocations.data(), allocations.size()); // Ultra-slow + //SaveAllocatorStatsToFile(L"Before.csv"); + + { + std::vector vmaAllocations(allocations.size()); + for(size_t i = 0; i < allocations.size(); ++i) + vmaAllocations[i] = allocations[i].m_Allocation; + + const size_t nonMovablePercent = 0; + size_t nonMovableCount = vmaAllocations.size() * nonMovablePercent / 100; + for(size_t i = 0; i < nonMovableCount; ++i) + { + size_t index = (size_t)rand() % vmaAllocations.size(); + vmaAllocations.erase(vmaAllocations.begin() + index); + } + + // Set data for defragmentation retrieval + for (auto& alloc : allocations) + vmaSetAllocationUserData(g_hAllocator, alloc.m_Allocation, &alloc); + + const uint32_t defragCount = 1; + for(uint32_t defragIndex = 0; defragIndex < defragCount; ++defragIndex) + { + std::vector allocationsChanged(vmaAllocations.size()); + + VmaDefragmentationInfo defragmentationInfo = {}; + defragmentationInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT; + + wprintf(L"Defragmentation #%u\n", defragIndex); + + time_point begTime = std::chrono::high_resolution_clock::now(); + + VmaDefragmentationStats stats; + Defragment(defragmentationInfo, &stats); + + float defragmentDuration = ToFloatSeconds(std::chrono::high_resolution_clock::now() - begTime); + + wprintf(L"Moved allocations %u, bytes %llu\n", stats.allocationsMoved, stats.bytesMoved); + wprintf(L"Freed blocks %u, bytes %llu\n", stats.deviceMemoryBlocksFreed, stats.bytesFreed); + wprintf(L"Time: %.2f s\n", defragmentDuration); + + for(size_t i = 0; i < vmaAllocations.size(); ++i) + { + if(allocationsChanged[i]) + { + RecreateAllocationResource(allocations[i]); + } + } + + //wchar_t fileName[MAX_PATH]; + //swprintf(fileName, MAX_PATH, L"After_%02u.csv", defragIndex); + //SaveAllocatorStatsToFile(fileName); + } + } + + // Destroy all remaining allocations. + //ValidateAllocationsData(allocations.data(), allocations.size()); // Ultra-slow + DestroyAllAllocations(allocations); +} + +static void TestDefragmentationGpu() +{ + wprintf(L"Test defragmentation GPU\n"); + + std::vector allocations; + + // Create that many allocations to surely fill 3 new blocks of 256 MB. + const VkDeviceSize bufSizeMin = 5ull * 1024 * 1024; + const VkDeviceSize bufSizeMax = 10ull * 1024 * 1024; + const VkDeviceSize totalSize = 3ull * 256 * 1024 * 1024; + const size_t bufCount = (size_t)(totalSize / bufSizeMin); + const size_t percentToLeave = 30; + const size_t percentNonMovable = 3; + RandomNumberGenerator rand = { 234522 }; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + + // Create all intended buffers. + for(size_t i = 0; i < bufCount; ++i) + { + bufCreateInfo.size = align_up(rand.Generate() % (bufSizeMax - bufSizeMin) + bufSizeMin, 32ull); + + if(rand.Generate() % 100 < percentNonMovable) + { + bufCreateInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT | + VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + allocCreateInfo.pUserData = (void*)(uintptr_t)2; + } + else + { + // Different usage just to see different color in output from VmaDumpVis. + bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | + VK_BUFFER_USAGE_TRANSFER_DST_BIT | + VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + // And in JSON dump. + allocCreateInfo.pUserData = (void*)(uintptr_t)1; + } + + AllocInfo alloc; + alloc.CreateBuffer(bufCreateInfo, allocCreateInfo); + alloc.m_StartValue = rand.Generate(); + allocations.push_back(alloc); + } + + // Destroy some percentage of them. + { + const size_t buffersToDestroy = round_div(bufCount * (100 - percentToLeave), 100); + for(size_t i = 0; i < buffersToDestroy; ++i) + { + const size_t index = rand.Generate() % allocations.size(); + allocations[index].Destroy(); + allocations.erase(allocations.begin() + index); + } + } + + // Set data for defragmentation retrieval + for (auto& alloc : allocations) + vmaSetAllocationUserData(g_hAllocator, alloc.m_Allocation, &alloc); + + // Fill them with meaningful data. + UploadGpuData(allocations.data(), allocations.size()); + + wchar_t fileName[MAX_PATH]; + swprintf_s(fileName, L"GPU_defragmentation_A_before.json"); + SaveAllocatorStatsToFile(fileName); + + // Defragment using GPU only. + { + const size_t allocCount = allocations.size(); + + std::vector allocationPtrs; + std::vector allocationChanged; + std::vector allocationOriginalIndex; + + for(size_t i = 0; i < allocCount; ++i) + { + VmaAllocationInfo allocInfo = {}; + vmaGetAllocationInfo(g_hAllocator, allocations[i].m_Allocation, &allocInfo); + if((uintptr_t)allocInfo.pUserData == 1) // Movable + { + allocationPtrs.push_back(allocations[i].m_Allocation); + allocationChanged.push_back(VK_FALSE); + allocationOriginalIndex.push_back(i); + } + } + + const size_t movableAllocCount = allocationPtrs.size(); + + VmaDefragmentationInfo defragInfo = {}; + VmaDefragmentationStats stats; + Defragment(defragInfo, &stats); + + for(size_t i = 0; i < movableAllocCount; ++i) + { + if(allocationChanged[i]) + { + const size_t origAllocIndex = allocationOriginalIndex[i]; + RecreateAllocationResource(allocations[origAllocIndex]); + } + } + + // If corruption detection is enabled, GPU defragmentation may not work on + // memory types that have this detection active, e.g. on Intel. + #if !defined(VMA_DEBUG_DETECT_CORRUPTION) || VMA_DEBUG_DETECT_CORRUPTION == 0 + TEST(stats.allocationsMoved > 0 && stats.bytesMoved > 0); + TEST(stats.deviceMemoryBlocksFreed > 0 && stats.bytesFreed > 0); + #endif + } + + swprintf_s(fileName, L"GPU_defragmentation_B_after.json"); + SaveAllocatorStatsToFile(fileName); + ValidateGpuData(allocations.data(), allocations.size()); + + // Destroy all remaining buffers. + for(size_t i = allocations.size(); i--; ) + { + allocations[i].Destroy(); + } +} + +static void TestDefragmentationIncrementalBasic() +{ + wprintf(L"Test defragmentation incremental basic\n"); + + std::vector allocations; + + // Create that many allocations to surely fill 3 new blocks of 256 MB. + const std::array imageSizes = { 256, 512, 1024 }; + const VkDeviceSize bufSizeMin = 5ull * 1024 * 1024; + const VkDeviceSize bufSizeMax = 10ull * 1024 * 1024; + const VkDeviceSize totalSize = 3ull * 256 * 1024 * 1024; + const size_t imageCount = totalSize / ((size_t)imageSizes[0] * imageSizes[0] * 4) / 2; + const size_t bufCount = (size_t)(totalSize / bufSizeMin) / 2; + const size_t percentToLeave = 30; + RandomNumberGenerator rand = { 234522 }; + + VkImageCreateInfo imageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imageInfo.imageType = VK_IMAGE_TYPE_2D; + imageInfo.extent.depth = 1; + imageInfo.mipLevels = 1; + imageInfo.arrayLayers = 1; + imageInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + imageInfo.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + imageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + + // Create all intended images. + for(size_t i = 0; i < imageCount; ++i) + { + const uint32_t size = imageSizes[rand.Generate() % 3]; + + imageInfo.extent.width = size; + imageInfo.extent.height = size; + + AllocInfo alloc; + CreateImage(allocCreateInfo, imageInfo, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, false, alloc); + alloc.m_StartValue = 0; + + allocations.push_back(alloc); + } + + // And all buffers + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + + for(size_t i = 0; i < bufCount; ++i) + { + bufCreateInfo.size = align_up(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 16); + bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + AllocInfo alloc; + alloc.CreateBuffer(bufCreateInfo, allocCreateInfo); + alloc.m_StartValue = 0; + + allocations.push_back(alloc); + } + + // Destroy some percentage of them. + { + const size_t allocationsToDestroy = round_div((imageCount + bufCount) * (100 - percentToLeave), 100); + for(size_t i = 0; i < allocationsToDestroy; ++i) + { + const size_t index = rand.Generate() % allocations.size(); + allocations[index].Destroy(); + allocations.erase(allocations.begin() + index); + } + } + + { + // Set our user data pointers. A real application should probably be more clever here + const size_t allocationCount = allocations.size(); + for(size_t i = 0; i < allocationCount; ++i) + { + AllocInfo &alloc = allocations[i]; + vmaSetAllocationUserData(g_hAllocator, alloc.m_Allocation, &alloc); + } + } + + // Fill them with meaningful data. + UploadGpuData(allocations.data(), allocations.size()); + + wchar_t fileName[MAX_PATH]; + swprintf_s(fileName, L"GPU_defragmentation_incremental_basic_A_before.json"); + SaveAllocatorStatsToFile(fileName); + + // Defragment using GPU only. + { + VmaDefragmentationInfo defragInfo = {}; + VmaDefragmentationContext ctx = VK_NULL_HANDLE; + VkResult res = vmaBeginDefragmentation(g_hAllocator, &defragInfo, &ctx); + TEST(res == VK_SUCCESS); + + VmaDefragmentationPassMoveInfo pass = {}; + while ((res = vmaBeginDefragmentationPass(g_hAllocator, ctx, &pass)) == VK_INCOMPLETE) + { + // Ignore data outside of test + for (uint32_t i = 0; i < pass.moveCount; ++i) + { + auto it = std::find_if(allocations.begin(), allocations.end(), [&](const AllocInfo& info) { return pass.pMoves[i].srcAllocation == info.m_Allocation; }); + if (it == allocations.end()) + pass.pMoves[i].operation = VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE; + } + + BeginSingleTimeCommands(); + ProcessDefragmentationPass(pass); + EndSingleTimeCommands(); + + // Destroy old buffers/images and replace them with new handles. + for (size_t i = 0; i < pass.moveCount; ++i) + { + if (pass.pMoves[i].operation != VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE) + { + VmaAllocation const alloc = pass.pMoves[i].srcAllocation; + VmaAllocationInfo vmaAllocInfo; + vmaGetAllocationInfo(g_hAllocator, alloc, &vmaAllocInfo); + AllocInfo* allocInfo = (AllocInfo*)vmaAllocInfo.pUserData; + + if (allocInfo->m_Buffer) + { + assert(allocInfo->m_NewBuffer && !allocInfo->m_Image && !allocInfo->m_NewImage); + vkDestroyBuffer(g_hDevice, allocInfo->m_Buffer, g_Allocs); + allocInfo->m_Buffer = allocInfo->m_NewBuffer; + allocInfo->m_NewBuffer = VK_NULL_HANDLE; + } + else if (allocInfo->m_Image) + { + assert(allocInfo->m_NewImage && !allocInfo->m_Buffer && !allocInfo->m_NewBuffer); + vkDestroyImage(g_hDevice, allocInfo->m_Image, g_Allocs); + allocInfo->m_Image = allocInfo->m_NewImage; + allocInfo->m_NewImage = VK_NULL_HANDLE; + } + else + assert(0); + } + } + + if ((res = vmaEndDefragmentationPass(g_hAllocator, ctx, &pass)) == VK_SUCCESS) + break; + TEST(res == VK_INCOMPLETE); + } + + TEST(res == VK_SUCCESS); + VmaDefragmentationStats stats = {}; + vmaEndDefragmentation(g_hAllocator, ctx, &stats); + + // If corruption detection is enabled, GPU defragmentation may not work on + // memory types that have this detection active, e.g. on Intel. +#if !defined(VMA_DEBUG_DETECT_CORRUPTION) || VMA_DEBUG_DETECT_CORRUPTION == 0 + TEST(stats.allocationsMoved > 0 && stats.bytesMoved > 0); + TEST(stats.deviceMemoryBlocksFreed > 0 && stats.bytesFreed > 0); +#endif + } + + //ValidateGpuData(allocations.data(), allocations.size()); + + swprintf_s(fileName, L"GPU_defragmentation_incremental_basic_B_after.json"); + SaveAllocatorStatsToFile(fileName); + + // Destroy all remaining buffers and images. + for(size_t i = allocations.size(); i--; ) + { + allocations[i].Destroy(); + } +} + +void TestDefragmentationIncrementalComplex() +{ + wprintf(L"Test defragmentation incremental complex\n"); + + std::vector allocations; + + // Create that many allocations to surely fill 3 new blocks of 256 MB. + const std::array imageSizes = { 256, 512, 1024 }; + const VkDeviceSize bufSizeMin = 5ull * 1024 * 1024; + const VkDeviceSize bufSizeMax = 10ull * 1024 * 1024; + const VkDeviceSize totalSize = 3ull * 256 * 1024 * 1024; + const size_t imageCount = (size_t)(totalSize / (imageSizes[0] * imageSizes[0] * 4)) / 2; + const size_t bufCount = (size_t)(totalSize / bufSizeMin) / 2; + const size_t percentToLeave = 30; + RandomNumberGenerator rand = { 234522 }; + + VkImageCreateInfo imageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imageInfo.imageType = VK_IMAGE_TYPE_2D; + imageInfo.extent.depth = 1; + imageInfo.mipLevels = 1; + imageInfo.arrayLayers = 1; + imageInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + imageInfo.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + imageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + + // Create all intended images. + for(size_t i = 0; i < imageCount; ++i) + { + const uint32_t size = imageSizes[rand.Generate() % 3]; + + imageInfo.extent.width = size; + imageInfo.extent.height = size; + + AllocInfo alloc; + CreateImage(allocCreateInfo, imageInfo, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, false, alloc); + alloc.m_StartValue = 0; + + allocations.push_back(alloc); + } + + // And all buffers + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + + for(size_t i = 0; i < bufCount; ++i) + { + bufCreateInfo.size = align_up(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 16); + bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + AllocInfo alloc; + alloc.CreateBuffer(bufCreateInfo, allocCreateInfo); + alloc.m_StartValue = 0; + + allocations.push_back(alloc); + } + + // Destroy some percentage of them. + { + const size_t allocationsToDestroy = round_div((imageCount + bufCount) * (100 - percentToLeave), 100); + for(size_t i = 0; i < allocationsToDestroy; ++i) + { + const size_t index = rand.Generate() % allocations.size(); + allocations[index].Destroy(); + allocations.erase(allocations.begin() + index); + } + } + + { + // Set our user data pointers. A real application should probably be more clever here + for (auto& alloc : allocations) + vmaSetAllocationUserData(g_hAllocator, alloc.m_Allocation, &alloc); + } + + // Fill them with meaningful data. + UploadGpuData(allocations.data(), allocations.size()); + + wchar_t fileName[MAX_PATH]; + swprintf_s(fileName, L"GPU_defragmentation_incremental_complex_A_before.json"); + SaveAllocatorStatsToFile(fileName); + + const size_t maxAdditionalAllocations = 100; + std::vector additionalAllocations; + additionalAllocations.reserve(maxAdditionalAllocations); + + const auto makeAdditionalAllocation = [&]() + { + if (additionalAllocations.size() < maxAdditionalAllocations) + { + bufCreateInfo.size = align_up(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 16); + bufCreateInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + AllocInfo alloc; + alloc.CreateBuffer(bufCreateInfo, allocCreateInfo); + + additionalAllocations.push_back(alloc); + vmaSetAllocationUserData(g_hAllocator, alloc.m_Allocation, &additionalAllocations.back()); + } + }; + + // Defragment using GPU only. + { + VmaDefragmentationInfo defragInfo = {}; + defragInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT; + + VmaDefragmentationContext ctx = VK_NULL_HANDLE; + VkResult res = vmaBeginDefragmentation(g_hAllocator, &defragInfo, &ctx); + TEST(res == VK_SUCCESS); + + makeAdditionalAllocation(); + + VmaDefragmentationPassMoveInfo pass = {}; + while((res = vmaBeginDefragmentationPass(g_hAllocator, ctx, &pass)) == VK_INCOMPLETE) + { + makeAdditionalAllocation(); + + // Ignore data outside of test + for (uint32_t i = 0; i < pass.moveCount; ++i) + { + auto it = std::find_if(allocations.begin(), allocations.end(), [&](const AllocInfo& info) { return pass.pMoves[i].srcAllocation == info.m_Allocation; }); + if (it == allocations.end()) + { + auto it = std::find_if(additionalAllocations.begin(), additionalAllocations.end(), [&](const AllocInfo& info) { return pass.pMoves[i].srcAllocation == info.m_Allocation; }); + if (it == additionalAllocations.end()) + pass.pMoves[i].operation = VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE; + } + } + + BeginSingleTimeCommands(); + ProcessDefragmentationPass(pass); + EndSingleTimeCommands(); + + makeAdditionalAllocation(); + + // Destroy old buffers/images and replace them with new handles. + for (size_t i = 0; i < pass.moveCount; ++i) + { + if (pass.pMoves[i].operation != VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE) + { + VmaAllocation const alloc = pass.pMoves[i].srcAllocation; + VmaAllocationInfo vmaAllocInfo; + vmaGetAllocationInfo(g_hAllocator, alloc, &vmaAllocInfo); + AllocInfo* allocInfo = (AllocInfo*)vmaAllocInfo.pUserData; + + if (allocInfo->m_Buffer) + { + assert(allocInfo->m_NewBuffer && !allocInfo->m_Image && !allocInfo->m_NewImage); + vkDestroyBuffer(g_hDevice, allocInfo->m_Buffer, g_Allocs); + allocInfo->m_Buffer = allocInfo->m_NewBuffer; + allocInfo->m_NewBuffer = VK_NULL_HANDLE; + } + else if (allocInfo->m_Image) + { + assert(allocInfo->m_NewImage && !allocInfo->m_Buffer && !allocInfo->m_NewBuffer); + vkDestroyImage(g_hDevice, allocInfo->m_Image, g_Allocs); + allocInfo->m_Image = allocInfo->m_NewImage; + allocInfo->m_NewImage = VK_NULL_HANDLE; + } + else + assert(0); + } + } + + if ((res = vmaEndDefragmentationPass(g_hAllocator, ctx, &pass)) == VK_SUCCESS) + break; + TEST(res == VK_INCOMPLETE); + + makeAdditionalAllocation(); + } + + TEST(res == VK_SUCCESS); + VmaDefragmentationStats stats = {}; + vmaEndDefragmentation(g_hAllocator, ctx, &stats); + + // If corruption detection is enabled, GPU defragmentation may not work on + // memory types that have this detection active, e.g. on Intel. +#if !defined(VMA_DEBUG_DETECT_CORRUPTION) || VMA_DEBUG_DETECT_CORRUPTION == 0 + TEST(stats.allocationsMoved > 0 && stats.bytesMoved > 0); + TEST(stats.deviceMemoryBlocksFreed > 0 && stats.bytesFreed > 0); +#endif + } + + //ValidateGpuData(allocations.data(), allocations.size()); + + swprintf_s(fileName, L"GPU_defragmentation_incremental_complex_B_after.json"); + SaveAllocatorStatsToFile(fileName); + + // Destroy all remaining buffers. + for(size_t i = allocations.size(); i--; ) + { + allocations[i].Destroy(); + } + + for(size_t i = additionalAllocations.size(); i--; ) + { + additionalAllocations[i].Destroy(); + } +} + +static void TestUserData() +{ + VkResult res; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.usage = VK_BUFFER_USAGE_INDEX_BUFFER_BIT; + bufCreateInfo.size = 0x10000; + + for(uint32_t testIndex = 0; testIndex < 2; ++testIndex) + { + // Opaque pointer + { + + void* numberAsPointer = (void*)(size_t)0xC2501FF3u; + void* pointerToSomething = &res; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + allocCreateInfo.pUserData = numberAsPointer; + if(testIndex == 1) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + VkBuffer buf; VmaAllocation alloc; VmaAllocationInfo allocInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(allocInfo.pUserData == numberAsPointer); + + vmaGetAllocationInfo(g_hAllocator, alloc, &allocInfo); + TEST(allocInfo.pUserData == numberAsPointer); + + vmaSetAllocationUserData(g_hAllocator, alloc, pointerToSomething); + vmaGetAllocationInfo(g_hAllocator, alloc, &allocInfo); + TEST(allocInfo.pUserData == pointerToSomething); + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + } + + // String + { + const char* name1 = "Buffer name \\\"\'<>&% \nSecond line .,;="; + const char* name2 = "2"; + const size_t name1Len = strlen(name1); + + char* name1Buf = new char[name1Len + 1]; + strcpy_s(name1Buf, name1Len + 1, name1); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT; + allocCreateInfo.pUserData = name1Buf; + if(testIndex == 1) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + VkBuffer buf; VmaAllocation alloc; VmaAllocationInfo allocInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(allocInfo.pName != nullptr && allocInfo.pName != name1Buf); + TEST(strcmp(name1, allocInfo.pName) == 0); + + delete[] name1Buf; + + vmaGetAllocationInfo(g_hAllocator, alloc, &allocInfo); + TEST(strcmp(name1, allocInfo.pName) == 0); + + vmaSetAllocationName(g_hAllocator, alloc, name2); + vmaGetAllocationInfo(g_hAllocator, alloc, &allocInfo); + TEST(strcmp(name2, allocInfo.pName) == 0); + + vmaSetAllocationName(g_hAllocator, alloc, nullptr); + vmaGetAllocationInfo(g_hAllocator, alloc, &allocInfo); + TEST(allocInfo.pName == nullptr); + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + } + } +} + +static void TestInvalidAllocations() +{ + VkResult res; + + VmaAllocationCreateInfo allocCreateInfo = {}; + + // Try to allocate 0 bytes. + { + VkMemoryRequirements memReq = {}; + memReq.size = 0; // !!! + memReq.alignment = 4; + memReq.memoryTypeBits = UINT32_MAX; + VmaAllocation alloc = VK_NULL_HANDLE; + res = vmaAllocateMemory(g_hAllocator, &memReq, &allocCreateInfo, &alloc, nullptr); + TEST(res == VK_ERROR_INITIALIZATION_FAILED && alloc == VK_NULL_HANDLE); + } + + // Try to create buffer with size = 0. + { + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + bufCreateInfo.size = 0; // !!! + VkBuffer buf = VK_NULL_HANDLE; + VmaAllocation alloc = VK_NULL_HANDLE; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr); + TEST(res == VK_ERROR_INITIALIZATION_FAILED && buf == VK_NULL_HANDLE && alloc == VK_NULL_HANDLE); + } + + // Try to create image with one dimension = 0. + { + VkImageCreateInfo imageCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + imageCreateInfo.imageType = VK_IMAGE_TYPE_2D; + imageCreateInfo.format = VK_FORMAT_B8G8R8A8_UNORM; + imageCreateInfo.extent.width = 128; + imageCreateInfo.extent.height = 0; // !!! + imageCreateInfo.extent.depth = 1; + imageCreateInfo.mipLevels = 1; + imageCreateInfo.arrayLayers = 1; + imageCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + imageCreateInfo.tiling = VK_IMAGE_TILING_LINEAR; + imageCreateInfo.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT; + imageCreateInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + VkImage image = VK_NULL_HANDLE; + VmaAllocation alloc = VK_NULL_HANDLE; + res = vmaCreateImage(g_hAllocator, &imageCreateInfo, &allocCreateInfo, &image, &alloc, nullptr); + TEST(res == VK_ERROR_INITIALIZATION_FAILED && image == VK_NULL_HANDLE && alloc == VK_NULL_HANDLE); + } +} + +static void TestMemoryRequirements() +{ + VkResult res; + VkBuffer buf; + VmaAllocation alloc; + VmaAllocationInfo allocInfo; + + const VkPhysicalDeviceMemoryProperties* memProps; + vmaGetMemoryProperties(g_hAllocator, &memProps); + + VkBufferCreateInfo bufInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + bufInfo.size = 128; + + VmaAllocationCreateInfo allocCreateInfo = {}; + + // No requirements. + res = vmaCreateBuffer(g_hAllocator, &bufInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS); + vmaDestroyBuffer(g_hAllocator, buf, alloc); + + // Usage = auto + host access. + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + allocCreateInfo.requiredFlags = 0; + allocCreateInfo.preferredFlags = 0; + allocCreateInfo.memoryTypeBits = UINT32_MAX; + + res = vmaCreateBuffer(g_hAllocator, &bufInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(memProps->memoryTypes[allocInfo.memoryType].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + vmaDestroyBuffer(g_hAllocator, buf, alloc); + + // Required flags, preferred flags. + allocCreateInfo.usage = VMA_MEMORY_USAGE_UNKNOWN; + allocCreateInfo.flags = 0; + allocCreateInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + allocCreateInfo.preferredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + allocCreateInfo.memoryTypeBits = 0; + + res = vmaCreateBuffer(g_hAllocator, &bufInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(memProps->memoryTypes[allocInfo.memoryType].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); + TEST(memProps->memoryTypes[allocInfo.memoryType].propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); + vmaDestroyBuffer(g_hAllocator, buf, alloc); + + // memoryTypeBits. + const uint32_t memType = allocInfo.memoryType; + allocCreateInfo.usage = VMA_MEMORY_USAGE_UNKNOWN; + allocCreateInfo.flags = 0; + allocCreateInfo.requiredFlags = 0; + allocCreateInfo.preferredFlags = 0; + allocCreateInfo.memoryTypeBits = 1u << memType; + + res = vmaCreateBuffer(g_hAllocator, &bufInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(allocInfo.memoryType == memType); + vmaDestroyBuffer(g_hAllocator, buf, alloc); + +} + +static void TestGetAllocatorInfo() +{ + wprintf(L"Test vnaGetAllocatorInfo\n"); + + VmaAllocatorInfo allocInfo = {}; + vmaGetAllocatorInfo(g_hAllocator, &allocInfo); + TEST(allocInfo.instance == g_hVulkanInstance); + TEST(allocInfo.physicalDevice == g_hPhysicalDevice); + TEST(allocInfo.device == g_hDevice); +} + +static void TestBasics() +{ + wprintf(L"Test basics\n"); + + VkResult res; + + TestGetAllocatorInfo(); + + TestMemoryRequirements(); + + // Allocation that is MAPPED and not necessarily HOST_VISIBLE. + { + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.usage = VK_BUFFER_USAGE_INDEX_BUFFER_BIT; + bufCreateInfo.size = 128; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; + + VkBuffer buf; VmaAllocation alloc; VmaAllocationInfo allocInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS); + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + + // Same with DEDICATED_MEMORY. + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS); + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + } + + TestUserData(); + + TestInvalidAllocations(); +} + +static void TestVirtualBlocks() +{ + wprintf(L"Test virtual blocks\n"); + + const VkDeviceSize blockSize = 16 * MEGABYTE; + const VkDeviceSize alignment = 256; + VkDeviceSize offset; + + // # Create block 16 MB + + VmaVirtualBlockCreateInfo blockCreateInfo = {}; + blockCreateInfo.pAllocationCallbacks = g_Allocs; + blockCreateInfo.size = blockSize; + VmaVirtualBlock block; + TEST(vmaCreateVirtualBlock(&blockCreateInfo, &block) == VK_SUCCESS && block); + + // # Allocate 8 MB (also fetch offset from the allocation) + + VmaVirtualAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.alignment = alignment; + allocCreateInfo.pUserData = (void*)(uintptr_t)1; + allocCreateInfo.size = 8 * MEGABYTE; + VmaVirtualAllocation allocation0 = VK_NULL_HANDLE; + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &allocation0, &offset) == VK_SUCCESS); + TEST(allocation0 != VK_NULL_HANDLE); + + // # Validate the allocation + + VmaVirtualAllocationInfo allocInfo0 = {}; + vmaGetVirtualAllocationInfo(block, allocation0, &allocInfo0); + TEST(allocInfo0.offset < blockSize); + TEST(allocInfo0.offset == offset); + TEST(allocInfo0.size == allocCreateInfo.size); + TEST(allocInfo0.pUserData == allocCreateInfo.pUserData); + + // # Check SetUserData + + vmaSetVirtualAllocationUserData(block, allocation0, (void*)(uintptr_t)2); + vmaGetVirtualAllocationInfo(block, allocation0, &allocInfo0); + TEST(allocInfo0.pUserData == (void*)(uintptr_t)2); + + // # Allocate 4 MB (also test passing null as pOffset during allocation) + + allocCreateInfo.size = 4 * MEGABYTE; + VmaVirtualAllocation allocation1 = VK_NULL_HANDLE; + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &allocation1, nullptr) == VK_SUCCESS); + TEST(allocation1 != VK_NULL_HANDLE); + VmaVirtualAllocationInfo allocInfo1 = {}; + vmaGetVirtualAllocationInfo(block, allocation1, &allocInfo1); + TEST(allocInfo1.offset < blockSize); + TEST(allocInfo1.offset + 4 * MEGABYTE <= allocInfo0.offset || allocInfo0.offset + 8 * MEGABYTE <= allocInfo1.offset); // Check if they don't overlap. + + // # Allocate another 8 MB - it should fail + + allocCreateInfo.size = 8 * MEGABYTE; + VmaVirtualAllocation allocation2 = VK_NULL_HANDLE; + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &allocation2, &offset) < 0); + TEST(allocation2 == VK_NULL_HANDLE); + TEST(offset == UINT64_MAX); + + // # Free the 4 MB block. Now allocation of 8 MB should succeed. + + vmaVirtualFree(block, allocation1); + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &allocation2, nullptr) == VK_SUCCESS); + TEST(allocation2 != VK_NULL_HANDLE); + VmaVirtualAllocationInfo allocInfo2 = {}; + vmaGetVirtualAllocationInfo(block, allocation2, &allocInfo2); + TEST(allocInfo2.offset < blockSize); + TEST(allocInfo2.offset + 4 * MEGABYTE <= allocInfo0.offset || allocInfo0.offset + 8 * MEGABYTE <= allocInfo2.offset); // Check if they don't overlap. + + // # Calculate statistics + + VmaDetailedStatistics statInfo = {}; + vmaCalculateVirtualBlockStatistics(block, &statInfo); + TEST(statInfo.statistics.allocationCount == 2); + TEST(statInfo.statistics.blockCount == 1); + TEST(statInfo.statistics.allocationBytes == blockSize); + TEST(statInfo.statistics.blockBytes == blockSize); + + // # Generate JSON dump + +#if !defined(VMA_STATS_STRING_ENABLED) || VMA_STATS_STRING_ENABLED + char* json = nullptr; + vmaBuildVirtualBlockStatsString(block, &json, VK_TRUE); + { + std::string str(json); + TEST( str.find("\"CustomData\": \"0000000000000001\"") != std::string::npos ); + TEST( str.find("\"CustomData\": \"0000000000000002\"") != std::string::npos ); + } + vmaFreeVirtualBlockStatsString(block, json); +#endif + + // # Free alloc0, leave alloc2 unfreed. + + vmaVirtualFree(block, allocation0); + + // # Test free of null allocation. + vmaVirtualFree(block, VK_NULL_HANDLE); + + // # Test alignment + + { + constexpr size_t allocCount = 10; + VmaVirtualAllocation allocations[allocCount] = {}; + for(size_t i = 0; i < allocCount; ++i) + { + const bool alignment0 = i == allocCount - 1; + allocCreateInfo.size = i * 3 + 15; + allocCreateInfo.alignment = alignment0 ? 0 : 8; + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &allocations[i], nullptr) == VK_SUCCESS); + TEST(allocations[i] != VK_NULL_HANDLE); + if(!alignment0) + { + VmaVirtualAllocationInfo info; + vmaGetVirtualAllocationInfo(block, allocations[i], &info); + TEST(info.offset % allocCreateInfo.alignment == 0); + } + } + + for(size_t i = allocCount; i--; ) + { + vmaVirtualFree(block, allocations[i]); + } + } + + // # Final cleanup + + vmaVirtualFree(block, allocation2); + vmaDestroyVirtualBlock(block); + + { + // Another virtual block, using Clear this time. + TEST(vmaCreateVirtualBlock(&blockCreateInfo, &block) == VK_SUCCESS); + + allocCreateInfo = VmaVirtualAllocationCreateInfo{}; + allocCreateInfo.size = MEGABYTE; + + for(size_t i = 0; i < 8; ++i) + { + VmaVirtualAllocation allocation; + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &allocation, nullptr) == VK_SUCCESS); + } + + vmaClearVirtualBlock(block); + vmaDestroyVirtualBlock(block); + } +} + +static void TestVirtualBlocksAlgorithms() +{ + wprintf(L"Test virtual blocks algorithms\n"); + + RandomNumberGenerator rand{3454335}; + auto calcRandomAllocSize = [&rand]() -> VkDeviceSize { return rand.Generate() % 20 + 5; }; + + for(size_t algorithmIndex = 0; algorithmIndex < 2; ++algorithmIndex) + { + // Create the block + VmaVirtualBlockCreateInfo blockCreateInfo = {}; + blockCreateInfo.pAllocationCallbacks = g_Allocs; + blockCreateInfo.size = 10'000; + switch(algorithmIndex) + { + case 1: blockCreateInfo.flags = VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT; break; + } + VmaVirtualBlock block = nullptr; + VkResult res = vmaCreateVirtualBlock(&blockCreateInfo, &block); + TEST(res == VK_SUCCESS); + + struct AllocData + { + VmaVirtualAllocation allocation; + VkDeviceSize allocOffset, requestedSize, allocationSize; + }; + std::vector allocations; + + // Test too large allocation + { + VmaVirtualAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.size = blockCreateInfo.size * 2; + VmaVirtualAllocation alloc; + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &alloc, nullptr) < 0); + } + + // Make some allocations + for(size_t i = 0; i < 20; ++i) + { + VmaVirtualAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.size = calcRandomAllocSize(); + allocCreateInfo.pUserData = (void*)(uintptr_t)(allocCreateInfo.size * 10); + if(i < 10) { } + else if(i < 12) allocCreateInfo.flags = VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT; + else if(i < 14) allocCreateInfo.flags = VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT; + else if(i < 16) allocCreateInfo.flags = VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT; + else if(i < 18 && algorithmIndex == 1) allocCreateInfo.flags = VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT; + + AllocData alloc = {}; + alloc.requestedSize = allocCreateInfo.size; + res = vmaVirtualAllocate(block, &allocCreateInfo, &alloc.allocation, nullptr); + TEST(res == VK_SUCCESS); + + VmaVirtualAllocationInfo allocInfo; + vmaGetVirtualAllocationInfo(block, alloc.allocation, &allocInfo); + TEST(allocInfo.size >= allocCreateInfo.size); + alloc.allocOffset = allocInfo.offset; + alloc.allocationSize = allocInfo.size; + + allocations.push_back(alloc); + } + + // Free some of the allocations + for(size_t i = 0; i < 5; ++i) + { + const size_t index = rand.Generate() % allocations.size(); + vmaVirtualFree(block, allocations[index].allocation); + allocations.erase(allocations.begin() + index); + } + + // Allocate some more + for(size_t i = 0; i < 6; ++i) + { + VmaVirtualAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.size = calcRandomAllocSize(); + allocCreateInfo.pUserData = (void*)(uintptr_t)(allocCreateInfo.size * 10); + + AllocData alloc = {}; + alloc.requestedSize = allocCreateInfo.size; + res = vmaVirtualAllocate(block, &allocCreateInfo, &alloc.allocation, nullptr); + TEST(res == VK_SUCCESS); + + VmaVirtualAllocationInfo allocInfo; + vmaGetVirtualAllocationInfo(block, alloc.allocation, &allocInfo); + TEST(allocInfo.size >= allocCreateInfo.size); + alloc.allocOffset = allocInfo.offset; + alloc.allocationSize = allocInfo.size; + + allocations.push_back(alloc); + } + + // Allocate some with extra alignment + for(size_t i = 0; i < 3; ++i) + { + VmaVirtualAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.size = calcRandomAllocSize(); + allocCreateInfo.alignment = 16; + allocCreateInfo.pUserData = (void*)(uintptr_t)(allocCreateInfo.size * 10); + + AllocData alloc = {}; + alloc.requestedSize = allocCreateInfo.size; + res = vmaVirtualAllocate(block, &allocCreateInfo, &alloc.allocation, nullptr); + TEST(res == VK_SUCCESS); + + VmaVirtualAllocationInfo allocInfo; + vmaGetVirtualAllocationInfo(block, alloc.allocation, &allocInfo); + TEST(allocInfo.offset % 16 == 0); + TEST(allocInfo.size >= allocCreateInfo.size); + alloc.allocOffset = allocInfo.offset; + alloc.allocationSize = allocInfo.size; + + allocations.push_back(alloc); + } + + // Check if the allocations don't overlap + std::sort(allocations.begin(), allocations.end(), [](const AllocData& lhs, const AllocData& rhs) { + return lhs.allocOffset < rhs.allocOffset; }); + for(size_t i = 0; i < allocations.size() - 1; ++i) + { + TEST(allocations[i+1].allocOffset >= allocations[i].allocOffset + allocations[i].allocationSize); + } + + // Check pUserData + { + const AllocData& alloc = allocations.back(); + VmaVirtualAllocationInfo allocInfo = {}; + vmaGetVirtualAllocationInfo(block, alloc.allocation, &allocInfo); + TEST((uintptr_t)allocInfo.pUserData == alloc.requestedSize * 10); + + vmaSetVirtualAllocationUserData(block, alloc.allocation, (void*)(uintptr_t)666); + vmaGetVirtualAllocationInfo(block, alloc.allocation, &allocInfo); + TEST((uintptr_t)allocInfo.pUserData == 666); + } + + // Calculate statistics + { + VkDeviceSize actualAllocSizeMin = VK_WHOLE_SIZE, actualAllocSizeMax = 0, actualAllocSizeSum = 0; + std::for_each(allocations.begin(), allocations.end(), [&](const AllocData& a) { + actualAllocSizeMin = std::min(actualAllocSizeMin, a.allocationSize); + actualAllocSizeMax = std::max(actualAllocSizeMax, a.allocationSize); + actualAllocSizeSum += a.allocationSize; + }); + + VmaDetailedStatistics statInfo = {}; + vmaCalculateVirtualBlockStatistics(block, &statInfo); + TEST(statInfo.statistics.allocationCount == allocations.size()); + TEST(statInfo.statistics.blockCount == 1); + TEST(statInfo.statistics.blockBytes == blockCreateInfo.size); + TEST(statInfo.allocationSizeMax == actualAllocSizeMax); + TEST(statInfo.allocationSizeMin == actualAllocSizeMin); + TEST(statInfo.statistics.allocationBytes >= actualAllocSizeSum); + } + +#if !defined(VMA_STATS_STRING_ENABLED) || VMA_STATS_STRING_ENABLED + // Build JSON dump string + { + char* json = nullptr; + vmaBuildVirtualBlockStatsString(block, &json, VK_TRUE); + int I = 0; // put a breakpoint here to debug + vmaFreeVirtualBlockStatsString(block, json); + } +#endif + + // Final cleanup + vmaClearVirtualBlock(block); + vmaDestroyVirtualBlock(block); + } +} + +static void TestAllocationVersusResourceSize() +{ + wprintf(L"Test allocation versus resource size\n"); + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 22921; // Prime number + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; + + for(uint32_t i = 0; i < 2; ++i) + { + const bool isDedicated = i == 1; + if(isDedicated) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + else + allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + AllocInfo info; + info.CreateBuffer(bufCreateInfo, allocCreateInfo); + + VmaAllocationInfo2 allocInfo = {}; + vmaGetAllocationInfo2(g_hAllocator, info.m_Allocation, &allocInfo); + //wprintf(L" Buffer size = %llu, allocation size = %llu\n", bufCreateInfo.size, allocInfo.size); + + // Map and test accessing entire area of the allocation, not only the buffer. + void* mappedPtr = nullptr; + VkResult res = vmaMapMemory(g_hAllocator, info.m_Allocation, &mappedPtr); + TEST(res == VK_SUCCESS); + + memset(mappedPtr, 0xCC, (size_t)allocInfo.allocationInfo.size); + + vmaUnmapMemory(g_hAllocator, info.m_Allocation); + + // Test new information returned by VmaAllocationInfo2. + if (isDedicated) + { + TEST(allocInfo.dedicatedMemory); + TEST(allocInfo.blockSize == allocInfo.allocationInfo.size); + } + else + { + TEST(!allocInfo.dedicatedMemory); + TEST(allocInfo.blockSize > allocInfo.allocationInfo.size); + } + + info.Destroy(); + } +} + +static void TestPool_MinBlockCount() +{ +#if defined(VMA_DEBUG_MARGIN) && VMA_DEBUG_MARGIN > 0 + return; +#endif + + wprintf(L"Test Pool MinBlockCount\n"); + VkResult res; + + static const VkDeviceSize ALLOC_SIZE = 512ull * 1024; + static const VkDeviceSize BLOCK_SIZE = ALLOC_SIZE * 2; // Each block can fit 2 allocations. + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + bufCreateInfo.size = ALLOC_SIZE; + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.blockSize = BLOCK_SIZE; + poolCreateInfo.minBlockCount = 2; // At least 2 blocks always present. + res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + + VmaPool pool = VK_NULL_HANDLE; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS && pool != VK_NULL_HANDLE); + + // Check that there are 2 blocks preallocated as requested. + VmaDetailedStatistics begPoolStats = {}; + vmaCalculatePoolStatistics(g_hAllocator, pool, &begPoolStats); + TEST(begPoolStats.statistics.blockCount == 2 && + begPoolStats.statistics.allocationCount == 0 && + begPoolStats.statistics.blockBytes == BLOCK_SIZE * 2); + + // Allocate 5 buffers to create 3 blocks. + static const uint32_t BUF_COUNT = 5; + allocCreateInfo.pool = pool; + std::vector allocs(BUF_COUNT); + for(uint32_t i = 0; i < BUF_COUNT; ++i) + { + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &allocs[i].m_Buffer, &allocs[i].m_Allocation, nullptr); + TEST(res == VK_SUCCESS && allocs[i].m_Buffer != VK_NULL_HANDLE && allocs[i].m_Allocation != VK_NULL_HANDLE); + } + + // Check that there are really 3 blocks. + VmaDetailedStatistics poolStats2 = {}; + vmaCalculatePoolStatistics(g_hAllocator, pool, &poolStats2); + TEST(poolStats2.statistics.blockCount == 3 && + poolStats2.statistics.allocationCount == BUF_COUNT && + poolStats2.statistics.blockBytes == BLOCK_SIZE * 3); + + // Free two first allocations to make one block empty. + allocs[0].Destroy(); + allocs[1].Destroy(); + + // Check that there are still 3 blocks due to hysteresis. + VmaDetailedStatistics poolStats3 = {}; + vmaCalculatePoolStatistics(g_hAllocator, pool, &poolStats3); + TEST(poolStats3.statistics.blockCount == 3 && + poolStats3.statistics.allocationCount == BUF_COUNT - 2 && + poolStats2.statistics.blockBytes == BLOCK_SIZE * 3); + + // Free the last allocation to make second block empty. + allocs[BUF_COUNT - 1].Destroy(); + + // Check that there are now 2 blocks only. + VmaDetailedStatistics poolStats4 = {}; + vmaCalculatePoolStatistics(g_hAllocator, pool, &poolStats4); + TEST(poolStats4.statistics.blockCount == 2 && + poolStats4.statistics.allocationCount == BUF_COUNT - 3 && + poolStats4.statistics.blockBytes == BLOCK_SIZE * 2); + + // Cleanup. + for(size_t i = allocs.size(); i--; ) + { + allocs[i].Destroy(); + } + vmaDestroyPool(g_hAllocator, pool); +} + +static void TestPool_MinAllocationAlignment() +{ + wprintf(L"Test Pool MinAllocationAlignment\n"); + VkResult res; + + static const VkDeviceSize ALLOC_SIZE = 32; + static const VkDeviceSize BLOCK_SIZE = 1024 * 1024; + static const VkDeviceSize MIN_ALLOCATION_ALIGNMENT = 64 * 1024; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + bufCreateInfo.size = ALLOC_SIZE; + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.blockSize = BLOCK_SIZE; + poolCreateInfo.minAllocationAlignment = MIN_ALLOCATION_ALIGNMENT; + res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + + VmaPool pool = VK_NULL_HANDLE; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS && pool != VK_NULL_HANDLE); + + static const uint32_t BUF_COUNT = 4; + allocCreateInfo = {}; + allocCreateInfo.pool = pool; + std::vector allocs(BUF_COUNT); + for(uint32_t i = 0; i < BUF_COUNT; ++i) + { + VmaAllocationInfo allocInfo = {}; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &allocs[i].m_Buffer, &allocs[i].m_Allocation, &allocInfo); + TEST(res == VK_SUCCESS && allocs[i].m_Buffer != VK_NULL_HANDLE && allocs[i].m_Allocation != VK_NULL_HANDLE); + TEST(allocInfo.offset % MIN_ALLOCATION_ALIGNMENT == 0); + } + + // Cleanup. + for(size_t i = allocs.size(); i--; ) + { + allocs[i].Destroy(); + } + vmaDestroyPool(g_hAllocator, pool); +} + +static void TestPoolsAndAllocationParameters() +{ + wprintf(L"Test pools and allocation parameters\n"); + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 1 * MEGABYTE; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + + uint32_t memTypeIndex = UINT32_MAX; + VkResult res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &memTypeIndex); + TEST(res == VK_SUCCESS); + + VmaPool pool1 = nullptr, pool2 = nullptr; + std::vector bufs; + + uint32_t totalNewAllocCount = 0, totalNewBlockCount = 0; + VmaTotalStatistics statsBeg, statsEnd; + vmaCalculateStatistics(g_hAllocator, &statsBeg); + + // poolTypeI: + // 0 = default pool + // 1 = custom pool, default (flexible) block size and block count + // 2 = custom pool, fixed block size and limited block count + for(size_t poolTypeI = 0; poolTypeI < 3; ++poolTypeI) + { + if(poolTypeI == 0) + { + allocCreateInfo.pool = nullptr; + } + else if(poolTypeI == 1) + { + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.memoryTypeIndex = memTypeIndex; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool1); + TEST(res == VK_SUCCESS); + allocCreateInfo.pool = pool1; + } + else if(poolTypeI == 2) + { + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.memoryTypeIndex = memTypeIndex; + poolCreateInfo.maxBlockCount = 1; + poolCreateInfo.blockSize = 2 * MEGABYTE + MEGABYTE / 2; // 2.5 MB + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool2); + TEST(res == VK_SUCCESS); + allocCreateInfo.pool = pool2; + } + + uint32_t poolAllocCount = 0, poolBlockCount = 0; + BufferInfo bufInfo = {}; + VmaAllocationInfo allocInfo[4] = {}; + + // Default parameters + allocCreateInfo.flags = 0; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &bufInfo.Buffer, &bufInfo.Allocation, &allocInfo[0]); + TEST(res == VK_SUCCESS && bufInfo.Allocation && bufInfo.Buffer); + bufs.push_back(std::move(bufInfo)); + ++poolAllocCount; + + // DEDICATED. Should not try pool2 as it asserts on invalid call. + if(poolTypeI != 2) + { + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &bufInfo.Buffer, &bufInfo.Allocation, &allocInfo[1]); + TEST(res == VK_SUCCESS && bufInfo.Allocation && bufInfo.Buffer); + TEST(allocInfo[1].offset == 0); // Dedicated + TEST(allocInfo[1].deviceMemory != allocInfo[0].deviceMemory); // Dedicated + bufs.push_back(std::move(bufInfo)); + ++poolAllocCount; + } + + // NEVER_ALLOCATE #1 + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &bufInfo.Buffer, &bufInfo.Allocation, &allocInfo[2]); + TEST(res == VK_SUCCESS && bufInfo.Allocation && bufInfo.Buffer); + TEST(allocInfo[2].deviceMemory == allocInfo[0].deviceMemory); // Same memory block as default one. + TEST(allocInfo[2].offset != allocInfo[0].offset); + bufs.push_back(std::move(bufInfo)); + ++poolAllocCount; + + // NEVER_ALLOCATE #2. Should fail in pool2 as it has no space. + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &bufInfo.Buffer, &bufInfo.Allocation, &allocInfo[3]); + if(poolTypeI == 2) + TEST(res < 0); + else + { + TEST(res == VK_SUCCESS && bufInfo.Allocation && bufInfo.Buffer); + bufs.push_back(std::move(bufInfo)); + ++poolAllocCount; + } + + // Pool stats + switch(poolTypeI) + { + case 0: poolBlockCount = 1; break; // At least 1 added for dedicated allocation. + case 1: poolBlockCount = 2; break; // 1 for custom pool block and 1 for dedicated allocation. + case 2: poolBlockCount = 1; break; // Only custom pool, no dedicated allocation. + } + + if(poolTypeI > 0) + { + VmaDetailedStatistics poolStats = {}; + vmaCalculatePoolStatistics(g_hAllocator, poolTypeI == 2 ? pool2 : pool1, &poolStats); + TEST(poolStats.statistics.allocationCount == poolAllocCount); + const VkDeviceSize usedSize = poolStats.statistics.allocationBytes; + TEST(usedSize == poolAllocCount * MEGABYTE); + TEST(poolStats.statistics.blockCount == poolBlockCount); + } + + totalNewAllocCount += poolAllocCount; + totalNewBlockCount += poolBlockCount; + } + + vmaCalculateStatistics(g_hAllocator, &statsEnd); + TEST(statsEnd.total.statistics.allocationCount == statsBeg.total.statistics.allocationCount + totalNewAllocCount); + TEST(statsEnd.total.statistics.blockCount >= statsBeg.total.statistics.blockCount + totalNewBlockCount); + TEST(statsEnd.total.statistics.allocationBytes == statsBeg.total.statistics.allocationBytes + totalNewAllocCount * MEGABYTE); + + for(auto& bufInfo : bufs) + vmaDestroyBuffer(g_hAllocator, bufInfo.Buffer, bufInfo.Allocation); + + vmaDestroyPool(g_hAllocator, pool2); + vmaDestroyPool(g_hAllocator, pool1); +} + +void TestHeapSizeLimit() +{ + wprintf(L"Test heap size limit\n"); + + const VkDeviceSize HEAP_SIZE_LIMIT = 100ull * 1024 * 1024; // 100 MB + const VkDeviceSize BLOCK_SIZE = 10ull * 1024 * 1024; // 10 MB + + VkDeviceSize heapSizeLimit[VK_MAX_MEMORY_HEAPS]; + for(uint32_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i) + { + heapSizeLimit[i] = HEAP_SIZE_LIMIT; + } + + VmaAllocatorCreateInfo allocatorCreateInfo = {}; + allocatorCreateInfo.physicalDevice = g_hPhysicalDevice; + allocatorCreateInfo.device = g_hDevice; + allocatorCreateInfo.instance = g_hVulkanInstance; + allocatorCreateInfo.pHeapSizeLimit = heapSizeLimit; +#if VMA_DYNAMIC_VULKAN_FUNCTIONS + VmaVulkanFunctions vulkanFunctions = {}; + vulkanFunctions.vkGetInstanceProcAddr = vkGetInstanceProcAddr; + vulkanFunctions.vkGetDeviceProcAddr = vkGetDeviceProcAddr; + allocatorCreateInfo.pVulkanFunctions = &vulkanFunctions; +#endif + + VmaAllocator hAllocator; + VkResult res = vmaCreateAllocator(&allocatorCreateInfo, &hAllocator); + TEST(res == VK_SUCCESS); + + struct Item + { + VkBuffer hBuf; + VmaAllocation hAlloc; + }; + std::vector items; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + + // 1. Allocate two blocks of dedicated memory, half the size of BLOCK_SIZE. + VmaAllocationInfo dedicatedAllocInfo; + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + bufCreateInfo.size = BLOCK_SIZE / 2; + + for(size_t i = 0; i < 2; ++i) + { + Item item; + res = vmaCreateBuffer(hAllocator, &bufCreateInfo, &allocCreateInfo, &item.hBuf, &item.hAlloc, &dedicatedAllocInfo); + TEST(res == VK_SUCCESS); + items.push_back(item); + } + } + + // Create pool to make sure allocations must be out of this memory type. + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.memoryTypeIndex = dedicatedAllocInfo.memoryType; + poolCreateInfo.blockSize = BLOCK_SIZE; + + VmaPool hPool; + res = vmaCreatePool(hAllocator, &poolCreateInfo, &hPool); + TEST(res == VK_SUCCESS); + + // 2. Allocate normal buffers from all the remaining memory. + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = hPool; + + bufCreateInfo.size = BLOCK_SIZE / 2; + + const size_t bufCount = ((HEAP_SIZE_LIMIT / BLOCK_SIZE) - 1) * 2; + for(size_t i = 0; i < bufCount; ++i) + { + Item item; + res = vmaCreateBuffer(hAllocator, &bufCreateInfo, &allocCreateInfo, &item.hBuf, &item.hAlloc, nullptr); + TEST(res == VK_SUCCESS); + items.push_back(item); + } + } + + // 3. Allocation of one more (even small) buffer should fail. + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = hPool; + + bufCreateInfo.size = 128; + + VkBuffer hBuf; + VmaAllocation hAlloc; + res = vmaCreateBuffer(hAllocator, &bufCreateInfo, &allocCreateInfo, &hBuf, &hAlloc, nullptr); + TEST(res == VK_ERROR_OUT_OF_DEVICE_MEMORY); + } + + // Destroy everything. + for(size_t i = items.size(); i--; ) + { + vmaDestroyBuffer(hAllocator, items[i].hBuf, items[i].hAlloc); + } + + vmaDestroyPool(hAllocator, hPool); + + vmaDestroyAllocator(hAllocator); +} + +#ifndef VMA_DEBUG_MARGIN + #define VMA_DEBUG_MARGIN (0) +#endif + +static void TestDebugMargin() +{ + if(VMA_DEBUG_MARGIN == 0) + { + return; + } + + wprintf(L"Test VMA_DEBUG_MARGIN = %u\n", (uint32_t)VMA_DEBUG_MARGIN); + + VkBufferCreateInfo bufInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + bufInfo.size = 256; // Doesn't matter + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + + VmaPoolCreateInfo poolCreateInfo = {}; + TEST(vmaFindMemoryTypeIndexForBufferInfo( + g_hAllocator, &bufInfo, &allocCreateInfo, &poolCreateInfo.memoryTypeIndex) == VK_SUCCESS); + + for(size_t algorithmIndex = 0; algorithmIndex < 2; ++algorithmIndex) + { + switch(algorithmIndex) + { + case 0: poolCreateInfo.flags = 0; break; + case 1: poolCreateInfo.flags = VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT; break; + default: assert(0); + } + VmaPool pool = VK_NULL_HANDLE; + TEST(vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool) == VK_SUCCESS && pool); + + allocCreateInfo.pool = pool; + + // Create few buffers of different size. + const size_t BUF_COUNT = 10; + BufferInfo buffers[BUF_COUNT]; + VmaAllocationInfo allocInfo[BUF_COUNT]; + for(size_t allocIndex = 0; allocIndex < 10; ++allocIndex) + { + const bool isLast = allocIndex == BUF_COUNT - 1; + bufInfo.size = (VkDeviceSize)(allocIndex + 1) * 256; + // Last one will be mapped. + allocCreateInfo.flags = isLast ? VMA_ALLOCATION_CREATE_MAPPED_BIT : 0; + + VkResult res = vmaCreateBuffer(g_hAllocator, &bufInfo, &allocCreateInfo, &buffers[allocIndex].Buffer, &buffers[allocIndex].Allocation, &allocInfo[allocIndex]); + TEST(res == VK_SUCCESS); + + if(isLast) + { + // Fill with data. + TEST(allocInfo[allocIndex].pMappedData != nullptr); + // Uncomment this "+ 1" to overwrite past end of allocation and check corruption detection. + memset(allocInfo[allocIndex].pMappedData, 0xFF, bufInfo.size /* + 1 */); + } + } + + // Check if their offsets preserve margin between them. + std::sort(allocInfo, allocInfo + BUF_COUNT, [](const VmaAllocationInfo& lhs, const VmaAllocationInfo& rhs) -> bool + { + if(lhs.deviceMemory != rhs.deviceMemory) + { + return lhs.deviceMemory < rhs.deviceMemory; + } + return lhs.offset < rhs.offset; + }); + for(size_t i = 1; i < BUF_COUNT; ++i) + { + if(allocInfo[i].deviceMemory == allocInfo[i - 1].deviceMemory) + { + TEST(allocInfo[i].offset >= + allocInfo[i - 1].offset + allocInfo[i - 1].size + VMA_DEBUG_MARGIN); + } + } + + VkResult res = vmaCheckCorruption(g_hAllocator, UINT32_MAX); + TEST(res == VK_SUCCESS || res == VK_ERROR_FEATURE_NOT_PRESENT); + + // JSON dump + char* json = nullptr; + vmaBuildStatsString(g_hAllocator, &json, VK_TRUE); + int I = 1; // Put breakpoint here to manually inspect json in a debugger. + vmaFreeStatsString(g_hAllocator, json); + + // Destroy all buffers. + for(size_t i = BUF_COUNT; i--; ) + { + vmaDestroyBuffer(g_hAllocator, buffers[i].Buffer, buffers[i].Allocation); + } + + vmaDestroyPool(g_hAllocator, pool); + } +} + +static void TestDebugMarginNotInVirtualAllocator() +{ + wprintf(L"Test VMA_DEBUG_MARGIN not applied to virtual allocator\n"); + + constexpr size_t ALLOCATION_COUNT = 10; + for(size_t algorithm = 0; algorithm < 2; ++algorithm) + { + VmaVirtualBlockCreateInfo blockCreateInfo = {}; + blockCreateInfo.size = ALLOCATION_COUNT * MEGABYTE; + blockCreateInfo.flags = (algorithm == 1 ? VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT : 0); + + VmaVirtualBlock block = VK_NULL_HANDLE; + TEST(vmaCreateVirtualBlock(&blockCreateInfo, &block) == VK_SUCCESS); + + // Fill the entire block + VmaVirtualAllocation allocs[ALLOCATION_COUNT]; + for(size_t i = 0; i < ALLOCATION_COUNT; ++i) + { + VmaVirtualAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.size = 1 * MEGABYTE; + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &allocs[i], nullptr) == VK_SUCCESS); + } + + vmaClearVirtualBlock(block); + vmaDestroyVirtualBlock(block); + } +} + +static void TestLinearAllocator() +{ + wprintf(L"Test linear allocator\n"); + + RandomNumberGenerator rand{645332}; + + VkBufferCreateInfo sampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + sampleBufCreateInfo.size = 1024; // Whatever. + sampleBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + + VmaAllocationCreateInfo sampleAllocCreateInfo = {}; + sampleAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + + VmaPoolCreateInfo poolCreateInfo = {}; + VkResult res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &sampleBufCreateInfo, &sampleAllocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + + poolCreateInfo.blockSize = 1024 * 300; + poolCreateInfo.flags = VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT; + poolCreateInfo.minBlockCount = poolCreateInfo.maxBlockCount = 1; + + VmaPool pool = nullptr; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS); + + VkBufferCreateInfo bufCreateInfo = sampleBufCreateInfo; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + + constexpr size_t maxBufCount = 100; + std::vector bufInfo; + + constexpr VkDeviceSize bufSizeMin = 64; + constexpr VkDeviceSize bufSizeMax = 1024; + VmaAllocationInfo allocInfo; + VkDeviceSize prevOffset = 0; + + // Test one-time free. + for(size_t i = 0; i < 2; ++i) + { + // Allocate number of buffers of varying size that surely fit into this block. + VkDeviceSize bufSumSize = 0; + for(size_t i = 0; i < maxBufCount; ++i) + { + bufCreateInfo.size = align_up(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64); + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(i == 0 || allocInfo.offset > prevOffset); + bufInfo.push_back(newBufInfo); + prevOffset = allocInfo.offset; + TEST(allocInfo.size >= bufCreateInfo.size); + bufSumSize += allocInfo.size; + } + + // Validate pool stats. + VmaDetailedStatistics stats; + vmaCalculatePoolStatistics(g_hAllocator, pool, &stats); + TEST(stats.statistics.blockBytes == poolCreateInfo.blockSize); + TEST(stats.statistics.blockBytes - stats.statistics.allocationBytes == poolCreateInfo.blockSize - bufSumSize); + TEST(stats.statistics.allocationCount == bufInfo.size()); + + // Destroy the buffers in random order. + while(!bufInfo.empty()) + { + const size_t indexToDestroy = rand.Generate() % bufInfo.size(); + const BufferInfo& currBufInfo = bufInfo[indexToDestroy]; + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.erase(bufInfo.begin() + indexToDestroy); + } + } + + // Test stack. + { + // Allocate number of buffers of varying size that surely fit into this block. + for(size_t i = 0; i < maxBufCount; ++i) + { + bufCreateInfo.size = align_up(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64); + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(i == 0 || allocInfo.offset > prevOffset); + bufInfo.push_back(newBufInfo); + prevOffset = allocInfo.offset; + } + + // Destroy few buffers from top of the stack. + for(size_t i = 0; i < maxBufCount / 5; ++i) + { + const BufferInfo& currBufInfo = bufInfo.back(); + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.pop_back(); + } + + // Create some more + for(size_t i = 0; i < maxBufCount / 5; ++i) + { + bufCreateInfo.size = align_up(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64); + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(i == 0 || allocInfo.offset > prevOffset); + bufInfo.push_back(newBufInfo); + prevOffset = allocInfo.offset; + } + + // Destroy the buffers in reverse order. + while(!bufInfo.empty()) + { + const BufferInfo& currBufInfo = bufInfo.back(); + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.pop_back(); + } + } + + // Test ring buffer. + { + // Allocate number of buffers that surely fit into this block. + bufCreateInfo.size = bufSizeMax; + for(size_t i = 0; i < maxBufCount; ++i) + { + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(i == 0 || allocInfo.offset > prevOffset); + bufInfo.push_back(newBufInfo); + prevOffset = allocInfo.offset; + } + + // Free and allocate new buffers so many times that we make sure we wrap-around at least once. + const size_t buffersPerIter = maxBufCount / 10 - 1; + const size_t iterCount = poolCreateInfo.blockSize / bufCreateInfo.size / buffersPerIter * 2; + for(size_t iter = 0; iter < iterCount; ++iter) + { + for(size_t bufPerIter = 0; bufPerIter < buffersPerIter; ++bufPerIter) + { + const BufferInfo& currBufInfo = bufInfo.front(); + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.erase(bufInfo.begin()); + } + for(size_t bufPerIter = 0; bufPerIter < buffersPerIter; ++bufPerIter) + { + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + } + } + + // Allocate buffers until we reach out-of-memory. + uint32_t debugIndex = 0; + while(res == VK_SUCCESS) + { + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + if(res == VK_SUCCESS) + { + bufInfo.push_back(newBufInfo); + } + else + { + TEST(res == VK_ERROR_OUT_OF_DEVICE_MEMORY); + } + ++debugIndex; + } + + // Destroy the buffers in random order. + while(!bufInfo.empty()) + { + const size_t indexToDestroy = rand.Generate() % bufInfo.size(); + const BufferInfo& currBufInfo = bufInfo[indexToDestroy]; + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.erase(bufInfo.begin() + indexToDestroy); + } + } + + // Test double stack. + { + // Allocate number of buffers of varying size that surely fit into this block, alternate from bottom/top. + VkDeviceSize prevOffsetLower = 0; + VkDeviceSize prevOffsetUpper = poolCreateInfo.blockSize; + for(size_t i = 0; i < maxBufCount; ++i) + { + const bool upperAddress = (i % 2) != 0; + if(upperAddress) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT; + else + allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT; + bufCreateInfo.size = align_up(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64); + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + if(upperAddress) + { + TEST(allocInfo.offset < prevOffsetUpper); + prevOffsetUpper = allocInfo.offset; + } + else + { + TEST(allocInfo.offset >= prevOffsetLower); + prevOffsetLower = allocInfo.offset; + } + TEST(prevOffsetLower < prevOffsetUpper); + bufInfo.push_back(newBufInfo); + } + + // Destroy few buffers from top of the stack. + for(size_t i = 0; i < maxBufCount / 5; ++i) + { + const BufferInfo& currBufInfo = bufInfo.back(); + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.pop_back(); + } + + // Create some more + for(size_t i = 0; i < maxBufCount / 5; ++i) + { + const bool upperAddress = (i % 2) != 0; + if(upperAddress) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT; + else + allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT; + bufCreateInfo.size = align_up(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64); + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + } + + // Destroy the buffers in reverse order. + while(!bufInfo.empty()) + { + const BufferInfo& currBufInfo = bufInfo.back(); + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.pop_back(); + } + + // Create buffers on both sides until we reach out of memory. + prevOffsetLower = 0; + prevOffsetUpper = poolCreateInfo.blockSize; + res = VK_SUCCESS; + for(size_t i = 0; res == VK_SUCCESS; ++i) + { + const bool upperAddress = (i % 2) != 0; + if(upperAddress) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT; + else + allocCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT; + bufCreateInfo.size = align_up(bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin), 64); + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + if(res == VK_SUCCESS) + { + if(upperAddress) + { + TEST(allocInfo.offset < prevOffsetUpper); + prevOffsetUpper = allocInfo.offset; + } + else + { + TEST(allocInfo.offset >= prevOffsetLower); + prevOffsetLower = allocInfo.offset; + } + TEST(prevOffsetLower < prevOffsetUpper); + bufInfo.push_back(newBufInfo); + } + } + + // Destroy the buffers in random order. + while(!bufInfo.empty()) + { + const size_t indexToDestroy = rand.Generate() % bufInfo.size(); + const BufferInfo& currBufInfo = bufInfo[indexToDestroy]; + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.erase(bufInfo.begin() + indexToDestroy); + } + + // Create buffers on upper side only, constant size, until we reach out of memory. + prevOffsetUpper = poolCreateInfo.blockSize; + res = VK_SUCCESS; + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT; + bufCreateInfo.size = bufSizeMax; + for(size_t i = 0; res == VK_SUCCESS; ++i) + { + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + if(res == VK_SUCCESS) + { + TEST(allocInfo.offset < prevOffsetUpper); + prevOffsetUpper = allocInfo.offset; + bufInfo.push_back(newBufInfo); + } + } + + // Destroy the buffers in reverse order. + while(!bufInfo.empty()) + { + const BufferInfo& currBufInfo = bufInfo.back(); + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.pop_back(); + } + } + + vmaDestroyPool(g_hAllocator, pool); +} + +static void TestLinearAllocatorMultiBlock() +{ + wprintf(L"Test linear allocator multi block\n"); + + RandomNumberGenerator rand{345673}; + + VkBufferCreateInfo sampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + sampleBufCreateInfo.size = 1024 * 1024; + sampleBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + VmaAllocationCreateInfo sampleAllocCreateInfo = {}; + sampleAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST; + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.flags = VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT; + VkResult res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &sampleBufCreateInfo, &sampleAllocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + + VmaPool pool = nullptr; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS); + + VkBufferCreateInfo bufCreateInfo = sampleBufCreateInfo; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + + std::vector bufInfo; + VmaAllocationInfo allocInfo; + + // Test one-time free. + { + // Allocate buffers until we move to a second block. + VkDeviceMemory lastMem = VK_NULL_HANDLE; + for(uint32_t i = 0; ; ++i) + { + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + if(lastMem && allocInfo.deviceMemory != lastMem) + { + break; + } + lastMem = allocInfo.deviceMemory; + } + + TEST(bufInfo.size() > 2); + + // Make sure that pool has now two blocks. + VmaDetailedStatistics poolStats = {}; + vmaCalculatePoolStatistics(g_hAllocator, pool, &poolStats); + TEST(poolStats.statistics.blockCount == 2); + + // Destroy all the buffers in random order. + while(!bufInfo.empty()) + { + const size_t indexToDestroy = rand.Generate() % bufInfo.size(); + const BufferInfo& currBufInfo = bufInfo[indexToDestroy]; + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.erase(bufInfo.begin() + indexToDestroy); + } + + // Make sure that pool has now at most one block. + vmaCalculatePoolStatistics(g_hAllocator, pool, &poolStats); + TEST(poolStats.statistics.blockCount <= 1); + } + + // Test stack. + { + // Allocate buffers until we move to a second block. + VkDeviceMemory lastMem = VK_NULL_HANDLE; + for(uint32_t i = 0; ; ++i) + { + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + if(lastMem && allocInfo.deviceMemory != lastMem) + { + break; + } + lastMem = allocInfo.deviceMemory; + } + + TEST(bufInfo.size() > 2); + + // Add few more buffers. + for(uint32_t i = 0; i < 5; ++i) + { + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + } + + // Make sure that pool has now two blocks. + VmaDetailedStatistics poolStats = {}; + vmaCalculatePoolStatistics(g_hAllocator, pool, &poolStats); + TEST(poolStats.statistics.blockCount == 2); + + // Delete half of buffers, LIFO. + for(size_t i = 0, countToDelete = bufInfo.size() / 2; i < countToDelete; ++i) + { + const BufferInfo& currBufInfo = bufInfo.back(); + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.pop_back(); + } + + // Add one more buffer. + BufferInfo newBufInfo; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + + // Make sure that pool has now one block. + vmaCalculatePoolStatistics(g_hAllocator, pool, &poolStats); + TEST(poolStats.statistics.blockCount == 1); + + // Delete all the remaining buffers, LIFO. + while(!bufInfo.empty()) + { + const BufferInfo& currBufInfo = bufInfo.back(); + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.pop_back(); + } + } + + vmaDestroyPool(g_hAllocator, pool); +} + +static void TestAllocationAlgorithmsCorrectness() +{ + wprintf(L"Test allocation algorithm correctness\n"); + + constexpr uint32_t LEVEL_COUNT = 12; + RandomNumberGenerator rand{2342435}; + + for(uint32_t isVirtual = 0; isVirtual < 3; ++isVirtual) + { + // isVirtual == 0: Use VmaPool, unit is 64 KB. + // isVirtual == 1: Use VmaVirtualBlock, unit is 64 KB. + // isVirtual == 2: Use VmaVirtualBlock, unit is 1 B. + const VkDeviceSize sizeUnit = isVirtual == 2 ? 1 : 0x10000; + const VkDeviceSize blockSize = (1llu << (LEVEL_COUNT - 1)) * sizeUnit; + + for(uint32_t algorithmIndex = 0; algorithmIndex < 1; ++algorithmIndex) + { + VmaPool pool = VK_NULL_HANDLE; + VmaVirtualBlock virtualBlock = VK_NULL_HANDLE; + + uint32_t algorithm; + switch (algorithmIndex) + { + case 0: + algorithm = 0; + break; + default: + break; + } + + if(isVirtual) + { + VmaVirtualBlockCreateInfo blockCreateInfo = {}; + blockCreateInfo.pAllocationCallbacks = g_Allocs; + blockCreateInfo.flags = algorithm; + blockCreateInfo.size = blockSize; + TEST(vmaCreateVirtualBlock(&blockCreateInfo, &virtualBlock) == VK_SUCCESS); + } + else + { + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.blockSize = blockSize; + poolCreateInfo.flags = algorithm; + poolCreateInfo.minBlockCount = poolCreateInfo.maxBlockCount = 1; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 0x10000; // Doesn't matter. + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT; + VmaAllocationCreateInfo allocCreateInfo = {}; + TEST(vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &poolCreateInfo.memoryTypeIndex) == VK_SUCCESS); + + TEST(vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool) == VK_SUCCESS); + } + + for(uint32_t strategyIndex = 0; strategyIndex < 3; ++strategyIndex) + { + struct AllocData + { + VmaAllocation alloc = VK_NULL_HANDLE; + VkBuffer buf = VK_NULL_HANDLE; + VmaVirtualAllocation virtualAlloc = VK_NULL_HANDLE; + }; + std::vector allocationsPerLevel[LEVEL_COUNT]; + + auto createAllocation = [&](uint32_t level) -> void + { + AllocData allocData; + const VkDeviceSize allocSize = (1llu << level) * sizeUnit; + if(isVirtual) + { + VmaVirtualAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.size = allocSize; + switch(strategyIndex) + { + case 1: allocCreateInfo.flags = VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT; break; + case 2: allocCreateInfo.flags = VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT; break; + } + TEST(vmaVirtualAllocate(virtualBlock, &allocCreateInfo, &allocData.virtualAlloc, nullptr) == VK_SUCCESS); + } + else + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + switch(strategyIndex) + { + case 1: allocCreateInfo.flags = VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT; break; + case 2: allocCreateInfo.flags = VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT; break; + } + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = allocSize; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT; + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &allocData.buf, &allocData.alloc, nullptr) == VK_SUCCESS); + } + allocationsPerLevel[level].push_back(allocData); + }; + + auto destroyAllocation = [&](uint32_t level, size_t index) -> void + { + const AllocData& allocData = allocationsPerLevel[level][index]; + if(isVirtual) + vmaVirtualFree(virtualBlock, allocData.virtualAlloc); + else + vmaDestroyBuffer(g_hAllocator, allocData.buf, allocData.alloc); + allocationsPerLevel[level].erase(allocationsPerLevel[level].begin() + index); + }; + + // Fill entire block with one big allocation. + createAllocation(LEVEL_COUNT - 1); + + // For each level, remove one allocation and refill it with 2 allocations at lower level. + for(uint32_t level = LEVEL_COUNT; level-- > 1; ) + { + size_t indexToDestroy = rand.Generate() % allocationsPerLevel[level].size(); + destroyAllocation(level, indexToDestroy); + createAllocation(level - 1); + createAllocation(level - 1); + } + + // Test statistics. + { + uint32_t actualAllocCount = 0, statAllocCount = 0; + VkDeviceSize actualAllocSize = 0, statAllocSize = 0; + // Calculate actual statistics. + for(uint32_t level = 0; level < LEVEL_COUNT; ++level) + { + for(size_t index = allocationsPerLevel[level].size(); index--; ) + { + if(isVirtual) + { + VmaVirtualAllocationInfo allocInfo = {}; + vmaGetVirtualAllocationInfo(virtualBlock, allocationsPerLevel[level][index].virtualAlloc, &allocInfo); + actualAllocSize += allocInfo.size; + } + else + { + VmaAllocationInfo allocInfo = {}; + vmaGetAllocationInfo(g_hAllocator, allocationsPerLevel[level][index].alloc, &allocInfo); + actualAllocSize += allocInfo.size; + } + } + actualAllocCount += (uint32_t)allocationsPerLevel[level].size(); + } + // Fetch reported statistics. + if(isVirtual) + { + VmaDetailedStatistics info = {}; + vmaCalculateVirtualBlockStatistics(virtualBlock, &info); + statAllocCount = info.statistics.allocationCount; + statAllocSize = info.statistics.allocationBytes; + TEST(info.statistics.blockCount == 1); + TEST(info.statistics.blockBytes == blockSize); + } + else + { + VmaDetailedStatistics stats = {}; + vmaCalculatePoolStatistics(g_hAllocator, pool, &stats); + statAllocCount = (uint32_t)stats.statistics.allocationCount; + statAllocSize = stats.statistics.allocationBytes; + TEST(stats.statistics.blockCount == 1); + TEST(stats.statistics.blockBytes == blockSize); + } + // Compare them. + TEST(actualAllocCount == statAllocCount); + TEST(actualAllocSize == statAllocSize); + } + + // Test JSON dump - for manual inspection. + { + char* json = nullptr; + if(isVirtual) + { + vmaBuildVirtualBlockStatsString(virtualBlock, &json, VK_TRUE); + int I = 1; // Put breakpoint here to inspect `json`. + vmaFreeVirtualBlockStatsString(virtualBlock, json); + } + else + { + vmaBuildStatsString(g_hAllocator, &json, VK_TRUE); + int I = 1; // Put breakpoint here to inspect `json`. + vmaFreeStatsString(g_hAllocator, json); + } + } + + // Free all remaining allocations + for(uint32_t level = 0; level < LEVEL_COUNT; ++level) + for(size_t index = allocationsPerLevel[level].size(); index--; ) + destroyAllocation(level, index); + } + + vmaDestroyVirtualBlock(virtualBlock); + vmaDestroyPool(g_hAllocator, pool); + } + } +} + +static void ManuallyTestLinearAllocator() +{ + VmaTotalStatistics origStats; + vmaCalculateStatistics(g_hAllocator, &origStats); + + wprintf(L"Manually test linear allocator\n"); + + RandomNumberGenerator rand{645332}; + + VkBufferCreateInfo sampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + sampleBufCreateInfo.size = 1024; // Whatever. + sampleBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + + VmaAllocationCreateInfo sampleAllocCreateInfo = {}; + sampleAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + + VmaPoolCreateInfo poolCreateInfo = {}; + VkResult res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &sampleBufCreateInfo, &sampleAllocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + + poolCreateInfo.blockSize = 10 * 1024; + poolCreateInfo.flags = VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT; + poolCreateInfo.minBlockCount = poolCreateInfo.maxBlockCount = 1; + + VmaPool pool = nullptr; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS); + + VkBufferCreateInfo bufCreateInfo = sampleBufCreateInfo; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + + std::vector bufInfo; + VmaAllocationInfo allocInfo; + BufferInfo newBufInfo; + + // Test double stack. + { + /* + Lower: Buffer 32 B, Buffer 1024 B, Buffer 32 B + Upper: Buffer 16 B, Buffer 1024 B, Buffer 128 B + + Totally: + 1 block allocated + 10240 Vulkan bytes + 6 new allocations + 2256 bytes in allocations + */ + + bufCreateInfo.size = 32; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + + bufCreateInfo.size = 1024; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + + bufCreateInfo.size = 32; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT; + + bufCreateInfo.size = 128; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + + bufCreateInfo.size = 1024; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + + bufCreateInfo.size = 16; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &newBufInfo.Buffer, &newBufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + bufInfo.push_back(newBufInfo); + + VmaTotalStatistics currStats; + vmaCalculateStatistics(g_hAllocator, &currStats); + VmaDetailedStatistics poolStats; + vmaCalculatePoolStatistics(g_hAllocator, pool, &poolStats); + +#if !defined(VMA_STATS_STRING_ENABLED) || VMA_STATS_STRING_ENABLED + char* statsStr = nullptr; + vmaBuildStatsString(g_hAllocator, &statsStr, VK_TRUE); + + // PUT BREAKPOINT HERE TO CHECK. + // Inspect: currStats versus origStats, poolStats, statsStr. + int I = 0; + + vmaFreeStatsString(g_hAllocator, statsStr); +#endif + + // Destroy the buffers in reverse order. + while(!bufInfo.empty()) + { + const BufferInfo& currBufInfo = bufInfo.back(); + vmaDestroyBuffer(g_hAllocator, currBufInfo.Buffer, currBufInfo.Allocation); + bufInfo.pop_back(); + } + } + + vmaDestroyPool(g_hAllocator, pool); +} + +static void BenchmarkAlgorithmsCase(FILE* file, + uint32_t algorithm, + bool empty, + VmaAllocationCreateFlags allocStrategy, + FREE_ORDER freeOrder) +{ + RandomNumberGenerator rand{16223}; + + const VkDeviceSize bufSizeMin = 32; + const VkDeviceSize bufSizeMax = 1024; + const size_t maxBufCapacity = 10000; + const uint32_t iterationCount = 10; + + VkBufferCreateInfo sampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + sampleBufCreateInfo.size = bufSizeMax; + sampleBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + + VmaAllocationCreateInfo sampleAllocCreateInfo = {}; + sampleAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + + VmaPoolCreateInfo poolCreateInfo = {}; + VkResult res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &sampleBufCreateInfo, &sampleAllocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + + poolCreateInfo.blockSize = bufSizeMax * maxBufCapacity; + poolCreateInfo.flags = VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT;//TODO remove this + poolCreateInfo.flags |= algorithm; + poolCreateInfo.minBlockCount = poolCreateInfo.maxBlockCount = 1; + + VmaPool pool = nullptr; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS); + + // Buffer created just to get memory requirements. Never bound to any memory. + VkBuffer dummyBuffer = VK_NULL_HANDLE; + res = vkCreateBuffer(g_hDevice, &sampleBufCreateInfo, g_Allocs, &dummyBuffer); + TEST(res == VK_SUCCESS && dummyBuffer); + + VkMemoryRequirements memReq = {}; + vkGetBufferMemoryRequirements(g_hDevice, dummyBuffer, &memReq); + + vkDestroyBuffer(g_hDevice, dummyBuffer, g_Allocs); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + allocCreateInfo.flags = allocStrategy; + + VmaAllocation alloc; + std::vector baseAllocations; + + if(!empty) + { + // Make allocations up to 1/3 of pool size. + VkDeviceSize totalSize = 0; + while(totalSize < poolCreateInfo.blockSize / 3) + { + // This test intentionally allows sizes that are aligned to 4 or 16 bytes. + // This is theoretically allowed and already uncovered one bug. + memReq.size = bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin); + res = vmaAllocateMemory(g_hAllocator, &memReq, &allocCreateInfo, &alloc, nullptr); + TEST(res == VK_SUCCESS); + baseAllocations.push_back(alloc); + totalSize += memReq.size; + } + + // Delete half of them, choose randomly. + size_t allocsToDelete = baseAllocations.size() / 2; + for(size_t i = 0; i < allocsToDelete; ++i) + { + const size_t index = (size_t)rand.Generate() % baseAllocations.size(); + vmaFreeMemory(g_hAllocator, baseAllocations[index]); + baseAllocations.erase(baseAllocations.begin() + index); + } + } + + // BENCHMARK + const size_t allocCount = maxBufCapacity / 3; + std::vector testAllocations; + testAllocations.reserve(allocCount); + duration allocTotalDuration = duration::zero(); + duration freeTotalDuration = duration::zero(); + for(uint32_t iterationIndex = 0; iterationIndex < iterationCount; ++iterationIndex) + { + // Allocations + time_point allocTimeBeg = std::chrono::high_resolution_clock::now(); + for(size_t i = 0; i < allocCount; ++i) + { + memReq.size = bufSizeMin + rand.Generate() % (bufSizeMax - bufSizeMin); + res = vmaAllocateMemory(g_hAllocator, &memReq, &allocCreateInfo, &alloc, nullptr); + TEST(res == VK_SUCCESS); + testAllocations.push_back(alloc); + } + allocTotalDuration += std::chrono::high_resolution_clock::now() - allocTimeBeg; + + // Deallocations + switch(freeOrder) + { + case FREE_ORDER::FORWARD: + // Leave testAllocations unchanged. + break; + case FREE_ORDER::BACKWARD: + std::reverse(testAllocations.begin(), testAllocations.end()); + break; + case FREE_ORDER::RANDOM: + std::shuffle(testAllocations.begin(), testAllocations.end(), MyUniformRandomNumberGenerator(rand)); + break; + default: assert(0); + } + + time_point freeTimeBeg = std::chrono::high_resolution_clock::now(); + for(size_t i = 0; i < allocCount; ++i) + vmaFreeMemory(g_hAllocator, testAllocations[i]); + freeTotalDuration += std::chrono::high_resolution_clock::now() - freeTimeBeg; + + testAllocations.clear(); + } + + // Delete baseAllocations + while(!baseAllocations.empty()) + { + vmaFreeMemory(g_hAllocator, baseAllocations.back()); + baseAllocations.pop_back(); + } + + vmaDestroyPool(g_hAllocator, pool); + + const float allocTotalSeconds = ToFloatSeconds(allocTotalDuration); + const float freeTotalSeconds = ToFloatSeconds(freeTotalDuration); + + printf(" Algorithm=%s %s Allocation=%s FreeOrder=%s: allocations %g s, free %g s\n", + AlgorithmToStr(algorithm), + empty ? "Empty" : "Not empty", + GetAllocationStrategyName(allocStrategy), + FREE_ORDER_NAMES[(size_t)freeOrder], + allocTotalSeconds, + freeTotalSeconds); + + if(file) + { + std::string currTime; + CurrentTimeToStr(currTime); + + fprintf(file, "%s,%s,%s,%u,%s,%s,%g,%g\n", + CODE_DESCRIPTION, currTime.c_str(), + AlgorithmToStr(algorithm), + empty ? 1 : 0, + GetAllocationStrategyName(allocStrategy), + FREE_ORDER_NAMES[(uint32_t)freeOrder], + allocTotalSeconds, + freeTotalSeconds); + } +} + +static void TestBufferDeviceAddress() +{ + wprintf(L"Test buffer device address\n"); + + assert(VK_KHR_buffer_device_address_enabled); + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 0x10000; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | + VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT; // !!! + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + + for(uint32_t testIndex = 0; testIndex < 2; ++testIndex) + { + // 1st is placed, 2nd is dedicated. + if(testIndex == 1) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + BufferInfo bufInfo = {}; + VkResult res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &bufInfo.Buffer, &bufInfo.Allocation, nullptr); + TEST(res == VK_SUCCESS); + + VkBufferDeviceAddressInfoEXT bufferDeviceAddressInfo = { VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT }; + bufferDeviceAddressInfo.buffer = bufInfo.Buffer; + TEST(g_vkGetBufferDeviceAddressKHR != nullptr); + VkDeviceAddress addr = g_vkGetBufferDeviceAddressKHR(g_hDevice, &bufferDeviceAddressInfo); + TEST(addr != 0); + + vmaDestroyBuffer(g_hAllocator, bufInfo.Buffer, bufInfo.Allocation); + } +} + +static void TestMemoryPriority() +{ + wprintf(L"Test memory priority\n"); + + assert(VK_EXT_memory_priority_enabled); + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 0x10000; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + allocCreateInfo.priority = 1.f; + + for(uint32_t testIndex = 0; testIndex < 2; ++testIndex) + { + // 1st is placed, 2nd is dedicated. + if(testIndex == 1) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + BufferInfo bufInfo = {}; + VkResult res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &bufInfo.Buffer, &bufInfo.Allocation, nullptr); + TEST(res == VK_SUCCESS); + + // There is nothing we can do to validate the priority. + + vmaDestroyBuffer(g_hAllocator, bufInfo.Buffer, bufInfo.Allocation); + } +} + +static void BenchmarkAlgorithms(FILE* file) +{ + wprintf(L"Benchmark algorithms\n"); + + if(file) + { + fprintf(file, + "Code,Time," + "Algorithm,Empty,Allocation strategy,Free order," + "Allocation time (s),Deallocation time (s)\n"); + } + + uint32_t freeOrderCount = 1; + if(ConfigType >= CONFIG_TYPE::CONFIG_TYPE_LARGE) + freeOrderCount = 3; + else if(ConfigType >= CONFIG_TYPE::CONFIG_TYPE_SMALL) + freeOrderCount = 2; + + const uint32_t emptyCount = ConfigType >= CONFIG_TYPE::CONFIG_TYPE_SMALL ? 2 : 1; + const uint32_t allocStrategyCount = GetAllocationStrategyCount(); + + for(uint32_t freeOrderIndex = 0; freeOrderIndex < freeOrderCount; ++freeOrderIndex) + { + FREE_ORDER freeOrder = FREE_ORDER::COUNT; + switch(freeOrderIndex) + { + case 0: freeOrder = FREE_ORDER::BACKWARD; break; + case 1: freeOrder = FREE_ORDER::FORWARD; break; + case 2: freeOrder = FREE_ORDER::RANDOM; break; + default: assert(0); + } + + for(uint32_t emptyIndex = 0; emptyIndex < emptyCount; ++emptyIndex) + { + for(uint32_t algorithmIndex = 0; algorithmIndex < 2; ++algorithmIndex) + { + uint32_t algorithm = 0; + switch(algorithmIndex) + { + case 0: + break; + case 1: + algorithm = VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT; + break; + default: + assert(0); + } + + uint32_t currAllocStrategyCount = algorithm != 0 ? 1 : allocStrategyCount; + for(uint32_t allocStrategyIndex = 0; allocStrategyIndex < currAllocStrategyCount; ++allocStrategyIndex) + { + VmaAllocatorCreateFlags strategy = 0; + if(currAllocStrategyCount > 1) + { + switch(allocStrategyIndex) + { + case 0: strategy = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT; break; + case 1: strategy = VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT; break; + default: assert(0); + } + } + + BenchmarkAlgorithmsCase( + file, + algorithm, + (emptyIndex == 0), // empty + strategy, + freeOrder); // freeOrder + } + } + } + } +} + +static void TestPool_SameSize() +{ + const VkDeviceSize BUF_SIZE = 1024 * 1024; + const size_t BUF_COUNT = 100; + VkResult res; + + RandomNumberGenerator rand{123}; + + VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufferInfo.size = BUF_SIZE; + bufferInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + uint32_t memoryTypeBits = UINT32_MAX; + { + VkBuffer dummyBuffer; + res = vkCreateBuffer(g_hDevice, &bufferInfo, g_Allocs, &dummyBuffer); + TEST(res == VK_SUCCESS); + + VkMemoryRequirements memReq; + vkGetBufferMemoryRequirements(g_hDevice, dummyBuffer, &memReq); + memoryTypeBits = memReq.memoryTypeBits; + + vkDestroyBuffer(g_hDevice, dummyBuffer, g_Allocs); + } + + VmaAllocationCreateInfo poolAllocInfo = {}; + poolAllocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; + uint32_t memTypeIndex; + res = vmaFindMemoryTypeIndex( + g_hAllocator, + memoryTypeBits, + &poolAllocInfo, + &memTypeIndex); + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.memoryTypeIndex = memTypeIndex; + poolCreateInfo.blockSize = BUF_SIZE * BUF_COUNT / 4; + poolCreateInfo.minBlockCount = 1; + poolCreateInfo.maxBlockCount = 4; + + VmaPool pool; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS); + + // Test pool name + { + static const char* const POOL_NAME = "Pool name"; + vmaSetPoolName(g_hAllocator, pool, POOL_NAME); + + const char* fetchedPoolName = nullptr; + vmaGetPoolName(g_hAllocator, pool, &fetchedPoolName); + TEST(strcmp(fetchedPoolName, POOL_NAME) == 0); + + // Generate JSON dump. There was a bug with this... + char* json = nullptr; + vmaBuildStatsString(g_hAllocator, &json, VK_TRUE); + vmaFreeStatsString(g_hAllocator, json); + + vmaSetPoolName(g_hAllocator, pool, nullptr); + } + + vmaSetCurrentFrameIndex(g_hAllocator, 1); + + VmaAllocationCreateInfo allocInfo = {}; + allocInfo.pool = pool; + + struct BufItem + { + VkBuffer Buf; + VmaAllocation Alloc; + }; + std::vector items; + + // Fill entire pool. + for(size_t i = 0; i < BUF_COUNT; ++i) + { + BufItem item; + res = vmaCreateBuffer(g_hAllocator, &bufferInfo, &allocInfo, &item.Buf, &item.Alloc, nullptr); + TEST(res == VK_SUCCESS); + items.push_back(item); + } + + // Make sure that another allocation would fail. + { + BufItem item; + res = vmaCreateBuffer(g_hAllocator, &bufferInfo, &allocInfo, &item.Buf, &item.Alloc, nullptr); + TEST(res == VK_ERROR_OUT_OF_DEVICE_MEMORY); + } + + // Validate allocations. + for(size_t i = 0; i < items.size(); ++i) + { + VmaAllocationInfo allocInfo; + vmaGetAllocationInfo(g_hAllocator, items[i].Alloc, &allocInfo); + TEST(allocInfo.deviceMemory != VK_NULL_HANDLE); + TEST(allocInfo.pMappedData == nullptr); + } + + // Free some percent of random items. + { + const size_t PERCENT_TO_FREE = 10; + size_t itemsToFree = items.size() * PERCENT_TO_FREE / 100; + for(size_t i = 0; i < itemsToFree; ++i) + { + size_t index = (size_t)rand.Generate() % items.size(); + vmaDestroyBuffer(g_hAllocator, items[index].Buf, items[index].Alloc); + items.erase(items.begin() + index); + } + } + + // Randomly allocate and free items. + { + const size_t OPERATION_COUNT = BUF_COUNT; + for(size_t i = 0; i < OPERATION_COUNT; ++i) + { + bool allocate = rand.Generate() % 2 != 0; + if(allocate) + { + if(items.size() < BUF_COUNT) + { + BufItem item; + res = vmaCreateBuffer(g_hAllocator, &bufferInfo, &allocInfo, &item.Buf, &item.Alloc, nullptr); + if(res == VK_SUCCESS) + items.push_back(item); + } + } + else // Free + { + if(!items.empty()) + { + size_t index = (size_t)rand.Generate() % items.size(); + vmaDestroyBuffer(g_hAllocator, items[index].Buf, items[index].Alloc); + items.erase(items.begin() + index); + } + } + } + } + + // Allocate up to maximum. + while(items.size() < BUF_COUNT) + { + BufItem item; + res = vmaCreateBuffer(g_hAllocator, &bufferInfo, &allocInfo, &item.Buf, &item.Alloc, nullptr); + TEST(res == VK_SUCCESS); + items.push_back(item); + } + + // Free one item. + vmaDestroyBuffer(g_hAllocator, items.back().Buf, items.back().Alloc); + items.pop_back(); + + // Validate statistics. + { + VmaDetailedStatistics poolStats = {}; + vmaCalculatePoolStatistics(g_hAllocator, pool, &poolStats); + TEST(poolStats.statistics.allocationCount == items.size()); + TEST(poolStats.statistics.blockBytes == BUF_COUNT * BUF_SIZE); + TEST(poolStats.unusedRangeCount == 1); + TEST(poolStats.statistics.blockBytes - poolStats.statistics.allocationBytes == BUF_SIZE); + } + + // Free all remaining items. + for(size_t i = items.size(); i--; ) + vmaDestroyBuffer(g_hAllocator, items[i].Buf, items[i].Alloc); + items.clear(); + + // Allocate maximum items again. + for(size_t i = 0; i < BUF_COUNT; ++i) + { + BufItem item; + res = vmaCreateBuffer(g_hAllocator, &bufferInfo, &allocInfo, &item.Buf, &item.Alloc, nullptr); + TEST(res == VK_SUCCESS); + items.push_back(item); + } + + // Delete every other item. + for(size_t i = 0; i < BUF_COUNT / 2; ++i) + { + vmaDestroyBuffer(g_hAllocator, items[i].Buf, items[i].Alloc); + items.erase(items.begin() + i); + } + + // Defragment! + { + VmaDefragmentationInfo defragmentationInfo = {}; + defragmentationInfo.flags = VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT; + defragmentationInfo.pool = pool; + + VmaDefragmentationContext defragCtx = nullptr; + VkResult res = vmaBeginDefragmentation(g_hAllocator, &defragmentationInfo, &defragCtx); + TEST(res == VK_SUCCESS); + + VmaDefragmentationPassMoveInfo pass = {}; + while ((res = vmaBeginDefragmentationPass(g_hAllocator, defragCtx, &pass)) == VK_INCOMPLETE) + { + if ((res = vmaEndDefragmentationPass(g_hAllocator, defragCtx, &pass)) == VK_SUCCESS) + break; + TEST(res == VK_INCOMPLETE); + } + TEST(res == VK_SUCCESS); + + VmaDefragmentationStats defragmentationStats; + vmaEndDefragmentation(g_hAllocator, defragCtx, &defragmentationStats); + TEST(defragmentationStats.allocationsMoved == 24); + } + + // Free all remaining items. + for(size_t i = items.size(); i--; ) + vmaDestroyBuffer(g_hAllocator, items[i].Buf, items[i].Alloc); + items.clear(); + + //////////////////////////////////////////////////////////////////////////////// + // Test for allocation too large for pool + + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + + VkMemoryRequirements memReq; + memReq.memoryTypeBits = UINT32_MAX; + memReq.alignment = 1; + memReq.size = poolCreateInfo.blockSize + 4; + + VmaAllocation alloc = nullptr; + res = vmaAllocateMemory(g_hAllocator, &memReq, &allocCreateInfo, &alloc, nullptr); + TEST(res == VK_ERROR_OUT_OF_DEVICE_MEMORY && alloc == nullptr); + } + + vmaDestroyPool(g_hAllocator, pool); +} + +static bool ValidatePattern(const void* pMemory, size_t size, uint8_t pattern) +{ + const uint8_t* pBytes = (const uint8_t*)pMemory; + for(size_t i = 0; i < size; ++i) + { + if(pBytes[i] != pattern) + { + return false; + } + } + return true; +} + +static void TestAllocationsInitialization() +{ + VkResult res; + + const size_t BUF_SIZE = 1024; + + // Create pool. + + VkBufferCreateInfo bufInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufInfo.size = BUF_SIZE; + bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + VmaAllocationCreateInfo dummyBufAllocCreateInfo = {}; + dummyBufAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + dummyBufAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.blockSize = BUF_SIZE * 10; + poolCreateInfo.minBlockCount = 1; // To keep memory alive while pool exists. + poolCreateInfo.maxBlockCount = 1; + res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufInfo, &dummyBufAllocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + + VmaAllocationCreateInfo bufAllocCreateInfo = {}; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &bufAllocCreateInfo.pool); + TEST(res == VK_SUCCESS); + + // Create one persistently mapped buffer to keep memory of this block mapped, + // so that pointer to mapped data will remain (more or less...) valid even + // after destruction of other allocations. + + bufAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT; + VkBuffer firstBuf; + VmaAllocation firstAlloc; + res = vmaCreateBuffer(g_hAllocator, &bufInfo, &bufAllocCreateInfo, &firstBuf, &firstAlloc, nullptr); + TEST(res == VK_SUCCESS); + + // Test buffers. + + for(uint32_t i = 0; i < 2; ++i) + { + const bool persistentlyMapped = i == 0; + bufAllocCreateInfo.flags = persistentlyMapped ? VMA_ALLOCATION_CREATE_MAPPED_BIT : 0; + VkBuffer buf; + VmaAllocation alloc; + VmaAllocationInfo allocInfo; + res = vmaCreateBuffer(g_hAllocator, &bufInfo, &bufAllocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS); + + void* pMappedData; + if(!persistentlyMapped) + { + res = vmaMapMemory(g_hAllocator, alloc, &pMappedData); + TEST(res == VK_SUCCESS); + } + else + { + pMappedData = allocInfo.pMappedData; + } + + // Validate initialized content + bool valid = ValidatePattern(pMappedData, BUF_SIZE, 0xDC); + TEST(valid); + + if(!persistentlyMapped) + { + vmaUnmapMemory(g_hAllocator, alloc); + } + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + + // Validate freed content + valid = ValidatePattern(pMappedData, BUF_SIZE, 0xEF); + TEST(valid); + } + + vmaDestroyBuffer(g_hAllocator, firstBuf, firstAlloc); + vmaDestroyPool(g_hAllocator, bufAllocCreateInfo.pool); +} + +static void TestPool_Benchmark( + PoolTestResult& outResult, + const PoolTestConfig& config) +{ + TEST(config.ThreadCount > 0); + + RandomNumberGenerator mainRand{config.RandSeed}; + + uint32_t allocationSizeProbabilitySum = std::accumulate( + config.AllocationSizes.begin(), + config.AllocationSizes.end(), + 0u, + [](uint32_t sum, const AllocationSize& allocSize) { + return sum + allocSize.Probability; + }); + + VkBufferCreateInfo bufferTemplateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufferTemplateInfo.size = 256; // Whatever. + bufferTemplateInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VkImageCreateInfo imageTemplateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imageTemplateInfo.imageType = VK_IMAGE_TYPE_2D; + imageTemplateInfo.extent.width = 256; // Whatever. + imageTemplateInfo.extent.height = 256; // Whatever. + imageTemplateInfo.extent.depth = 1; + imageTemplateInfo.mipLevels = 1; + imageTemplateInfo.arrayLayers = 1; + imageTemplateInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imageTemplateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; // LINEAR if CPU memory. + imageTemplateInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + imageTemplateInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; // TRANSFER_SRC if CPU memory. + imageTemplateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + uint32_t bufferMemoryTypeBits = UINT32_MAX; + { + VkBuffer dummyBuffer; + VkResult res = vkCreateBuffer(g_hDevice, &bufferTemplateInfo, g_Allocs, &dummyBuffer); + TEST(res == VK_SUCCESS); + + VkMemoryRequirements memReq; + vkGetBufferMemoryRequirements(g_hDevice, dummyBuffer, &memReq); + bufferMemoryTypeBits = memReq.memoryTypeBits; + + vkDestroyBuffer(g_hDevice, dummyBuffer, g_Allocs); + } + + uint32_t imageMemoryTypeBits = UINT32_MAX; + { + VkImage dummyImage; + VkResult res = vkCreateImage(g_hDevice, &imageTemplateInfo, g_Allocs, &dummyImage); + TEST(res == VK_SUCCESS); + + VkMemoryRequirements memReq; + vkGetImageMemoryRequirements(g_hDevice, dummyImage, &memReq); + imageMemoryTypeBits = memReq.memoryTypeBits; + + vkDestroyImage(g_hDevice, dummyImage, g_Allocs); + } + + uint32_t memoryTypeBits = 0; + if(config.UsesBuffers() && config.UsesImages()) + { + memoryTypeBits = bufferMemoryTypeBits & imageMemoryTypeBits; + if(memoryTypeBits == 0) + { + PrintWarning(L"Cannot test buffers + images in the same memory pool on this GPU."); + return; + } + } + else if(config.UsesBuffers()) + memoryTypeBits = bufferMemoryTypeBits; + else if(config.UsesImages()) + memoryTypeBits = imageMemoryTypeBits; + else + TEST(0); + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.minBlockCount = 1; + poolCreateInfo.maxBlockCount = 1; + poolCreateInfo.blockSize = config.PoolSize; + + const VkPhysicalDeviceMemoryProperties* memProps = nullptr; + vmaGetMemoryProperties(g_hAllocator, &memProps); + + VmaPool pool = VK_NULL_HANDLE; + VkResult res; + // Loop over memory types because we sometimes allocate a big block here, + // while the most eligible DEVICE_LOCAL heap may be only 256 MB on some GPUs. + while(memoryTypeBits) + { + VmaAllocationCreateInfo dummyAllocCreateInfo = {}; + dummyAllocCreateInfo.preferredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + vmaFindMemoryTypeIndex(g_hAllocator, memoryTypeBits, &dummyAllocCreateInfo, &poolCreateInfo.memoryTypeIndex); + + const uint32_t heapIndex = memProps->memoryTypes[poolCreateInfo.memoryTypeIndex].heapIndex; + // Protection against validation layer error when trying to allocate a block larger than entire heap size, + // which may be only 256 MB on some platforms. + if(poolCreateInfo.blockSize * poolCreateInfo.minBlockCount < memProps->memoryHeaps[heapIndex].size) + { + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + if(res == VK_SUCCESS) + break; + } + memoryTypeBits &= ~(1u << poolCreateInfo.memoryTypeIndex); + } + TEST(pool); + + // Start time measurement - after creating pool and initializing data structures. + time_point timeBeg = std::chrono::high_resolution_clock::now(); + + //////////////////////////////////////////////////////////////////////////////// + // ThreadProc + auto ThreadProc = [&config, allocationSizeProbabilitySum, pool]( + PoolTestThreadResult* outThreadResult, + uint32_t randSeed, + HANDLE frameStartEvent, + HANDLE frameEndEvent) -> void + { + RandomNumberGenerator threadRand{randSeed}; + VkResult res = VK_SUCCESS; + + VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufferInfo.size = 256; // Whatever. + bufferInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VkImageCreateInfo imageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imageInfo.imageType = VK_IMAGE_TYPE_2D; + imageInfo.extent.width = 256; // Whatever. + imageInfo.extent.height = 256; // Whatever. + imageInfo.extent.depth = 1; + imageInfo.mipLevels = 1; + imageInfo.arrayLayers = 1; + imageInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; // LINEAR if CPU memory. + imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + imageInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; // TRANSFER_SRC if CPU memory. + imageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + outThreadResult->AllocationTimeMin = duration::max(); + outThreadResult->AllocationTimeSum = duration::zero(); + outThreadResult->AllocationTimeMax = duration::min(); + outThreadResult->DeallocationTimeMin = duration::max(); + outThreadResult->DeallocationTimeSum = duration::zero(); + outThreadResult->DeallocationTimeMax = duration::min(); + outThreadResult->AllocationCount = 0; + outThreadResult->DeallocationCount = 0; + outThreadResult->FailedAllocationCount = 0; + outThreadResult->FailedAllocationTotalSize = 0; + + struct Item + { + VkDeviceSize BufferSize = 0; + VkExtent2D ImageSize = { 0, 0 }; + VkBuffer Buf = VK_NULL_HANDLE; + VkImage Image = VK_NULL_HANDLE; + VmaAllocation Alloc = VK_NULL_HANDLE; + + Item() { } + Item(Item&& src) : + BufferSize(src.BufferSize), ImageSize(src.ImageSize), Buf(src.Buf), Image(src.Image), Alloc(src.Alloc) + { + src.BufferSize = 0; + src.ImageSize = {0, 0}; + src.Buf = VK_NULL_HANDLE; + src.Image = VK_NULL_HANDLE; + src.Alloc = VK_NULL_HANDLE; + } + Item(const Item& src) = delete; + ~Item() + { + DestroyResources(); + } + Item& operator=(Item&& src) + { + if(&src != this) + { + DestroyResources(); + BufferSize = src.BufferSize; ImageSize = src.ImageSize; + Buf = src.Buf; Image = src.Image; Alloc = src.Alloc; + src.BufferSize = 0; + src.ImageSize = {0, 0}; + src.Buf = VK_NULL_HANDLE; + src.Image = VK_NULL_HANDLE; + src.Alloc = VK_NULL_HANDLE; + } + return *this; + } + Item& operator=(const Item& src) = delete; + void DestroyResources() + { + if(Buf) + { + assert(Image == VK_NULL_HANDLE); + vmaDestroyBuffer(g_hAllocator, Buf, Alloc); + Buf = VK_NULL_HANDLE; + } + else + { + vmaDestroyImage(g_hAllocator, Image, Alloc); + Image = VK_NULL_HANDLE; + } + Alloc = VK_NULL_HANDLE; + } + VkDeviceSize CalcSizeBytes() const + { + return BufferSize + + 4ull * ImageSize.width * ImageSize.height; + } + }; + std::vector unusedItems, usedItems; + + const size_t threadTotalItemCount = config.TotalItemCount / config.ThreadCount; + + // Create all items - all unused, not yet allocated. + for(size_t i = 0; i < threadTotalItemCount; ++i) + { + Item item = {}; + + uint32_t allocSizeIndex = 0; + uint32_t r = threadRand.Generate() % allocationSizeProbabilitySum; + while(r >= config.AllocationSizes[allocSizeIndex].Probability) + r -= config.AllocationSizes[allocSizeIndex++].Probability; + + const AllocationSize& allocSize = config.AllocationSizes[allocSizeIndex]; + if(allocSize.BufferSizeMax > 0) + { + TEST(allocSize.BufferSizeMin > 0); + TEST(allocSize.ImageSizeMin == 0 && allocSize.ImageSizeMax == 0); + if(allocSize.BufferSizeMax == allocSize.BufferSizeMin) + item.BufferSize = allocSize.BufferSizeMin; + else + { + item.BufferSize = allocSize.BufferSizeMin + threadRand.Generate() % (allocSize.BufferSizeMax - allocSize.BufferSizeMin); + item.BufferSize = item.BufferSize / 16 * 16; + } + } + else + { + TEST(allocSize.ImageSizeMin > 0 && allocSize.ImageSizeMax > 0); + if(allocSize.ImageSizeMax == allocSize.ImageSizeMin) + item.ImageSize.width = item.ImageSize.height = allocSize.ImageSizeMax; + else + { + item.ImageSize.width = allocSize.ImageSizeMin + threadRand.Generate() % (allocSize.ImageSizeMax - allocSize.ImageSizeMin); + item.ImageSize.height = allocSize.ImageSizeMin + threadRand.Generate() % (allocSize.ImageSizeMax - allocSize.ImageSizeMin); + } + } + + unusedItems.push_back(std::move(item)); + } + + auto Allocate = [&](Item& item) -> VkResult + { + assert(item.Buf == VK_NULL_HANDLE && item.Image == VK_NULL_HANDLE && item.Alloc == VK_NULL_HANDLE); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + + if(item.BufferSize) + { + bufferInfo.size = item.BufferSize; + VkResult res = VK_SUCCESS; + { + PoolAllocationTimeRegisterObj timeRegisterObj(*outThreadResult); + res = vmaCreateBuffer(g_hAllocator, &bufferInfo, &allocCreateInfo, &item.Buf, &item.Alloc, nullptr); + } + if(res == VK_SUCCESS) + SetDebugUtilsObjectName(VK_OBJECT_TYPE_BUFFER, (uint64_t)item.Buf, "TestPool_Benchmark_Buffer"); + return res; + } + else + { + TEST(item.ImageSize.width && item.ImageSize.height); + + imageInfo.extent.width = item.ImageSize.width; + imageInfo.extent.height = item.ImageSize.height; + VkResult res = VK_SUCCESS; + { + PoolAllocationTimeRegisterObj timeRegisterObj(*outThreadResult); + res = vmaCreateImage(g_hAllocator, &imageInfo, &allocCreateInfo, &item.Image, &item.Alloc, nullptr); + } + if(res == VK_SUCCESS) + SetDebugUtilsObjectName(VK_OBJECT_TYPE_IMAGE, (uint64_t)item.Image, "TestPool_Benchmark_Image"); + return res; + } + }; + + //////////////////////////////////////////////////////////////////////////////// + // Frames + for(uint32_t frameIndex = 0; frameIndex < config.FrameCount; ++frameIndex) + { + WaitForSingleObject(frameStartEvent, INFINITE); + + // Always make some percent of used bufs unused, to choose different used ones. + const size_t bufsToMakeUnused = usedItems.size() * config.ItemsToMakeUnusedPercent / 100; + for(size_t i = 0; i < bufsToMakeUnused; ++i) + { + size_t index = threadRand.Generate() % usedItems.size(); + auto it = usedItems.begin() + index; + Item item = std::move(*it); + usedItems.erase(it); + unusedItems.push_back(std::move(item)); + } + + // Determine which bufs we want to use in this frame. + const size_t usedBufCount = (threadRand.Generate() % (config.UsedItemCountMax - config.UsedItemCountMin) + config.UsedItemCountMin) + / config.ThreadCount; + TEST(usedBufCount < usedItems.size() + unusedItems.size()); + // Move some used to unused. + while(usedBufCount < usedItems.size()) + { + size_t index = threadRand.Generate() % usedItems.size(); + auto it = usedItems.begin() + index; + Item item = std::move(*it); + usedItems.erase(it); + unusedItems.push_back(std::move(item)); + } + // Move some unused to used. + while(usedBufCount > usedItems.size()) + { + size_t index = threadRand.Generate() % unusedItems.size(); + auto it = unusedItems.begin() + index; + Item item = std::move(*it); + unusedItems.erase(it); + usedItems.push_back(std::move(item)); + } + + uint32_t touchExistingCount = 0; + uint32_t touchLostCount = 0; + uint32_t createSucceededCount = 0; + uint32_t createFailedCount = 0; + + // Touch all used bufs. If not created or lost, allocate. + for(size_t i = 0; i < usedItems.size(); ++i) + { + Item& item = usedItems[i]; + // Not yet created. + if(item.Alloc == VK_NULL_HANDLE) + { + res = Allocate(item); + ++outThreadResult->AllocationCount; + if(res != VK_SUCCESS) + { + assert(item.Alloc == VK_NULL_HANDLE && item.Buf == VK_NULL_HANDLE && item.Image == VK_NULL_HANDLE); + ++outThreadResult->FailedAllocationCount; + outThreadResult->FailedAllocationTotalSize += item.CalcSizeBytes(); + ++createFailedCount; + } + else + ++createSucceededCount; + } + else + { + // Touch. TODO remove, refactor, there is no allocation touching any more. + VmaAllocationInfo allocInfo; + vmaGetAllocationInfo(g_hAllocator, item.Alloc, &allocInfo); + ++touchExistingCount; + } + } + + /* + printf("Thread %u frame %u: Touch existing %u, create succeeded %u failed %u\n", + randSeed, frameIndex, + touchExistingCount, + createSucceededCount, createFailedCount); + */ + + SetEvent(frameEndEvent); + } + + // Free all remaining items. + for(size_t i = usedItems.size(); i--; ) + { + PoolDeallocationTimeRegisterObj timeRegisterObj(*outThreadResult); + usedItems[i].DestroyResources(); + ++outThreadResult->DeallocationCount; + } + for(size_t i = unusedItems.size(); i--; ) + { + PoolDeallocationTimeRegisterObj timeRegisterOb(*outThreadResult); + unusedItems[i].DestroyResources(); + ++outThreadResult->DeallocationCount; + } + }; + + // Launch threads. + uint32_t threadRandSeed = mainRand.Generate(); + std::vector frameStartEvents{config.ThreadCount}; + std::vector frameEndEvents{config.ThreadCount}; + std::vector bkgThreads; + std::vector threadResults{config.ThreadCount}; + for(uint32_t threadIndex = 0; threadIndex < config.ThreadCount; ++threadIndex) + { + frameStartEvents[threadIndex] = CreateEvent(NULL, FALSE, FALSE, NULL); + frameEndEvents[threadIndex] = CreateEvent(NULL, FALSE, FALSE, NULL); + bkgThreads.emplace_back(std::bind( + ThreadProc, + &threadResults[threadIndex], + threadRandSeed + threadIndex, + frameStartEvents[threadIndex], + frameEndEvents[threadIndex])); + } + + // Execute frames. + TEST(config.ThreadCount <= MAXIMUM_WAIT_OBJECTS); + for(uint32_t frameIndex = 0; frameIndex < config.FrameCount; ++frameIndex) + { + vmaSetCurrentFrameIndex(g_hAllocator, frameIndex); + for(size_t threadIndex = 0; threadIndex < config.ThreadCount; ++threadIndex) + SetEvent(frameStartEvents[threadIndex]); + WaitForMultipleObjects(config.ThreadCount, &frameEndEvents[0], TRUE, INFINITE); + } + + // Wait for threads finished + for(size_t i = 0; i < bkgThreads.size(); ++i) + { + bkgThreads[i].join(); + CloseHandle(frameEndEvents[i]); + CloseHandle(frameStartEvents[i]); + } + bkgThreads.clear(); + + // Finish time measurement - before destroying pool. + outResult.TotalTime = std::chrono::high_resolution_clock::now() - timeBeg; + + vmaDestroyPool(g_hAllocator, pool); + + outResult.AllocationTimeMin = duration::max(); + outResult.AllocationTimeAvg = duration::zero(); + outResult.AllocationTimeMax = duration::min(); + outResult.DeallocationTimeMin = duration::max(); + outResult.DeallocationTimeAvg = duration::zero(); + outResult.DeallocationTimeMax = duration::min(); + outResult.FailedAllocationCount = 0; + outResult.FailedAllocationTotalSize = 0; + size_t allocationCount = 0; + size_t deallocationCount = 0; + for(size_t threadIndex = 0; threadIndex < config.ThreadCount; ++threadIndex) + { + const PoolTestThreadResult& threadResult = threadResults[threadIndex]; + outResult.AllocationTimeMin = std::min(outResult.AllocationTimeMin, threadResult.AllocationTimeMin); + outResult.AllocationTimeMax = std::max(outResult.AllocationTimeMax, threadResult.AllocationTimeMax); + outResult.AllocationTimeAvg += threadResult.AllocationTimeSum; + outResult.DeallocationTimeMin = std::min(outResult.DeallocationTimeMin, threadResult.DeallocationTimeMin); + outResult.DeallocationTimeMax = std::max(outResult.DeallocationTimeMax, threadResult.DeallocationTimeMax); + outResult.DeallocationTimeAvg += threadResult.DeallocationTimeSum; + allocationCount += threadResult.AllocationCount; + deallocationCount += threadResult.DeallocationCount; + outResult.FailedAllocationCount += threadResult.FailedAllocationCount; + outResult.FailedAllocationTotalSize += threadResult.FailedAllocationTotalSize; + } + if(allocationCount) + outResult.AllocationTimeAvg /= allocationCount; + if(deallocationCount) + outResult.DeallocationTimeAvg /= deallocationCount; +} + +static inline bool MemoryRegionsOverlap(char* ptr1, size_t size1, char* ptr2, size_t size2) +{ + if(ptr1 < ptr2) + return ptr1 + size1 > ptr2; + else if(ptr2 < ptr1) + return ptr2 + size2 > ptr1; + else + return true; +} + +static void TestMemoryUsage() +{ + wprintf(L"Testing memory usage:\n"); + + static const VmaMemoryUsage lastUsage = VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED; + for(uint32_t usage = 0; usage <= lastUsage; ++usage) + { + switch(usage) + { + case VMA_MEMORY_USAGE_UNKNOWN: printf(" VMA_MEMORY_USAGE_UNKNOWN:\n"); break; + case VMA_MEMORY_USAGE_GPU_ONLY: printf(" VMA_MEMORY_USAGE_GPU_ONLY:\n"); break; + case VMA_MEMORY_USAGE_CPU_ONLY: printf(" VMA_MEMORY_USAGE_CPU_ONLY:\n"); break; + case VMA_MEMORY_USAGE_CPU_TO_GPU: printf(" VMA_MEMORY_USAGE_CPU_TO_GPU:\n"); break; + case VMA_MEMORY_USAGE_GPU_TO_CPU: printf(" VMA_MEMORY_USAGE_GPU_TO_CPU:\n"); break; + case VMA_MEMORY_USAGE_CPU_COPY: printf(" VMA_MEMORY_USAGE_CPU_COPY:\n"); break; + case VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED: printf(" VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED:\n"); break; + default: assert(0); + } + + auto printResult = [](const char* testName, VkResult res, uint32_t memoryTypeBits, uint32_t memoryTypeIndex) + { + if(res == VK_SUCCESS) + printf(" %s: memoryTypeBits=0x%X, memoryTypeIndex=%u\n", testName, memoryTypeBits, memoryTypeIndex); + else + printf(" %s: memoryTypeBits=0x%X, FAILED with res=%d\n", testName, memoryTypeBits, (int32_t)res); + }; + + // 1: Buffer for copy + { + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 65536; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + VkBuffer buf = VK_NULL_HANDLE; + VkResult res = vkCreateBuffer(g_hDevice, &bufCreateInfo, g_Allocs, &buf); + TEST(res == VK_SUCCESS && buf != VK_NULL_HANDLE); + + VkMemoryRequirements memReq = {}; + vkGetBufferMemoryRequirements(g_hDevice, buf, &memReq); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = (VmaMemoryUsage)usage; + VmaAllocation alloc = VK_NULL_HANDLE; + VmaAllocationInfo allocInfo = {}; + res = vmaAllocateMemoryForBuffer(g_hAllocator, buf, &allocCreateInfo, &alloc, &allocInfo); + if(res == VK_SUCCESS) + { + TEST((memReq.memoryTypeBits & (1u << allocInfo.memoryType)) != 0); + res = vkBindBufferMemory(g_hDevice, buf, allocInfo.deviceMemory, allocInfo.offset); + TEST(res == VK_SUCCESS); + } + printResult("Buffer TRANSFER_DST + TRANSFER_SRC", res, memReq.memoryTypeBits, allocInfo.memoryType); + vmaDestroyBuffer(g_hAllocator, buf, alloc); + } + + // 2: Vertex buffer + { + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 65536; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + + VkBuffer buf = VK_NULL_HANDLE; + VkResult res = vkCreateBuffer(g_hDevice, &bufCreateInfo, g_Allocs, &buf); + TEST(res == VK_SUCCESS && buf != VK_NULL_HANDLE); + + VkMemoryRequirements memReq = {}; + vkGetBufferMemoryRequirements(g_hDevice, buf, &memReq); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = (VmaMemoryUsage)usage; + VmaAllocation alloc = VK_NULL_HANDLE; + VmaAllocationInfo allocInfo = {}; + res = vmaAllocateMemoryForBuffer(g_hAllocator, buf, &allocCreateInfo, &alloc, &allocInfo); + if(res == VK_SUCCESS) + { + TEST((memReq.memoryTypeBits & (1u << allocInfo.memoryType)) != 0); + res = vkBindBufferMemory(g_hDevice, buf, allocInfo.deviceMemory, allocInfo.offset); + TEST(res == VK_SUCCESS); + } + printResult("Buffer TRANSFER_DST + VERTEX_BUFFER", res, memReq.memoryTypeBits, allocInfo.memoryType); + vmaDestroyBuffer(g_hAllocator, buf, alloc); + } + + // 3: Image for copy, OPTIMAL + { + VkImageCreateInfo imgCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imgCreateInfo.imageType = VK_IMAGE_TYPE_2D; + imgCreateInfo.extent.width = 256; + imgCreateInfo.extent.height = 256; + imgCreateInfo.extent.depth = 1; + imgCreateInfo.mipLevels = 1; + imgCreateInfo.arrayLayers = 1; + imgCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imgCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imgCreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + imgCreateInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT; + imgCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + VkImage img = VK_NULL_HANDLE; + VkResult res = vkCreateImage(g_hDevice, &imgCreateInfo, g_Allocs, &img); + TEST(res == VK_SUCCESS && img != VK_NULL_HANDLE); + + VkMemoryRequirements memReq = {}; + vkGetImageMemoryRequirements(g_hDevice, img, &memReq); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = (VmaMemoryUsage)usage; + VmaAllocation alloc = VK_NULL_HANDLE; + VmaAllocationInfo allocInfo = {}; + res = vmaAllocateMemoryForImage(g_hAllocator, img, &allocCreateInfo, &alloc, &allocInfo); + if(res == VK_SUCCESS) + { + TEST((memReq.memoryTypeBits & (1u << allocInfo.memoryType)) != 0); + res = vkBindImageMemory(g_hDevice, img, allocInfo.deviceMemory, allocInfo.offset); + TEST(res == VK_SUCCESS); + } + printResult("Image OPTIMAL TRANSFER_DST + TRANSFER_SRC", res, memReq.memoryTypeBits, allocInfo.memoryType); + + vmaDestroyImage(g_hAllocator, img, alloc); + } + + // 4: Image SAMPLED, OPTIMAL + { + VkImageCreateInfo imgCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imgCreateInfo.imageType = VK_IMAGE_TYPE_2D; + imgCreateInfo.extent.width = 256; + imgCreateInfo.extent.height = 256; + imgCreateInfo.extent.depth = 1; + imgCreateInfo.mipLevels = 1; + imgCreateInfo.arrayLayers = 1; + imgCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imgCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imgCreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + imgCreateInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + imgCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + VkImage img = VK_NULL_HANDLE; + VkResult res = vkCreateImage(g_hDevice, &imgCreateInfo, g_Allocs, &img); + TEST(res == VK_SUCCESS && img != VK_NULL_HANDLE); + + VkMemoryRequirements memReq = {}; + vkGetImageMemoryRequirements(g_hDevice, img, &memReq); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = (VmaMemoryUsage)usage; + VmaAllocation alloc = VK_NULL_HANDLE; + VmaAllocationInfo allocInfo = {}; + res = vmaAllocateMemoryForImage(g_hAllocator, img, &allocCreateInfo, &alloc, &allocInfo); + if(res == VK_SUCCESS) + { + TEST((memReq.memoryTypeBits & (1u << allocInfo.memoryType)) != 0); + res = vkBindImageMemory(g_hDevice, img, allocInfo.deviceMemory, allocInfo.offset); + TEST(res == VK_SUCCESS); + } + printResult("Image OPTIMAL TRANSFER_DST + SAMPLED", res, memReq.memoryTypeBits, allocInfo.memoryType); + vmaDestroyImage(g_hAllocator, img, alloc); + } + + // 5: Image COLOR_ATTACHMENT, OPTIMAL + { + VkImageCreateInfo imgCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imgCreateInfo.imageType = VK_IMAGE_TYPE_2D; + imgCreateInfo.extent.width = 256; + imgCreateInfo.extent.height = 256; + imgCreateInfo.extent.depth = 1; + imgCreateInfo.mipLevels = 1; + imgCreateInfo.arrayLayers = 1; + imgCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imgCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imgCreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + imgCreateInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + imgCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + VkImage img = VK_NULL_HANDLE; + VkResult res = vkCreateImage(g_hDevice, &imgCreateInfo, g_Allocs, &img); + TEST(res == VK_SUCCESS && img != VK_NULL_HANDLE); + + VkMemoryRequirements memReq = {}; + vkGetImageMemoryRequirements(g_hDevice, img, &memReq); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = (VmaMemoryUsage)usage; + VmaAllocation alloc = VK_NULL_HANDLE; + VmaAllocationInfo allocInfo = {}; + res = vmaAllocateMemoryForImage(g_hAllocator, img, &allocCreateInfo, &alloc, &allocInfo); + if(res == VK_SUCCESS) + { + TEST((memReq.memoryTypeBits & (1u << allocInfo.memoryType)) != 0); + res = vkBindImageMemory(g_hDevice, img, allocInfo.deviceMemory, allocInfo.offset); + TEST(res == VK_SUCCESS); + } + printResult("Image OPTIMAL SAMPLED + COLOR_ATTACHMENT", res, memReq.memoryTypeBits, allocInfo.memoryType); + vmaDestroyImage(g_hAllocator, img, alloc); + } + } +} + +static uint32_t FindDeviceCoherentMemoryTypeBits() +{ + VkPhysicalDeviceMemoryProperties memProps; + vkGetPhysicalDeviceMemoryProperties(g_hPhysicalDevice, &memProps); + + uint32_t memTypeBits = 0; + for(uint32_t i = 0; i < memProps.memoryTypeCount; ++i) + { + if(memProps.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD) + memTypeBits |= 1u << i; + } + return memTypeBits; +} + +static void TestDeviceCoherentMemory() +{ + if(!VK_AMD_device_coherent_memory_enabled) + return; + + uint32_t deviceCoherentMemoryTypeBits = FindDeviceCoherentMemoryTypeBits(); + // Extension is enabled, feature is enabled, and the device still doesn't support any such memory type? + // OK then, so it's just fake! + if(deviceCoherentMemoryTypeBits == 0) + return; + + wprintf(L"Testing device coherent memory...\n"); + + // 1. Try to allocate buffer from a memory type that is DEVICE_COHERENT. + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 0x10000; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + allocCreateInfo.requiredFlags = VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD; + + AllocInfo alloc = {}; + VmaAllocationInfo allocInfo = {}; + VkResult res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &alloc.m_Buffer, &alloc.m_Allocation, &allocInfo); + + // Make sure it succeeded and was really created in such memory type. + TEST(res == VK_SUCCESS); + TEST((1u << allocInfo.memoryType) & deviceCoherentMemoryTypeBits); + + alloc.Destroy(); + + // 2. Try to create a pool in such memory type. + { + VmaPoolCreateInfo poolCreateInfo = {}; + + res = vmaFindMemoryTypeIndex(g_hAllocator, UINT32_MAX, &allocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + TEST((1u << poolCreateInfo.memoryTypeIndex) & deviceCoherentMemoryTypeBits); + + VmaPool pool = VK_NULL_HANDLE; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS); + + vmaDestroyPool(g_hAllocator, pool); + } + + // 3. Try the same with a local allocator created without VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT. + + VmaAllocatorCreateInfo allocatorCreateInfo = {}; + SetAllocatorCreateInfo(allocatorCreateInfo); + allocatorCreateInfo.flags &= ~VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT; + + VmaAllocator localAllocator = VK_NULL_HANDLE; + res = vmaCreateAllocator(&allocatorCreateInfo, &localAllocator); + TEST(res == VK_SUCCESS && localAllocator); + + res = vmaCreateBuffer(localAllocator, &bufCreateInfo, &allocCreateInfo, &alloc.m_Buffer, &alloc.m_Allocation, &allocInfo); + + // Make sure it failed. + TEST(res != VK_SUCCESS && !alloc.m_Buffer && !alloc.m_Allocation); + + // 4. Try to find memory type. + { + uint32_t memTypeIndex = UINT_MAX; + res = vmaFindMemoryTypeIndex(localAllocator, UINT32_MAX, &allocCreateInfo, &memTypeIndex); + TEST(res != VK_SUCCESS); + } + + vmaDestroyAllocator(localAllocator); +} + +static void InitEmptyDetailedStatistics(VmaDetailedStatistics& outStats) +{ + outStats = {}; + outStats.allocationSizeMin = VK_WHOLE_SIZE; + outStats.unusedRangeSizeMin = VK_WHOLE_SIZE; +} + +static void AddDetailedStatistics(VmaDetailedStatistics& inoutSum, const VmaDetailedStatistics& stats) +{ + inoutSum.statistics.allocationBytes += stats.statistics.allocationBytes; + inoutSum.statistics.allocationCount += stats.statistics.allocationCount; + inoutSum.statistics.blockBytes += stats.statistics.blockBytes; + inoutSum.statistics.blockCount += stats.statistics.blockCount; + inoutSum.unusedRangeCount += stats.unusedRangeCount; + inoutSum.allocationSizeMax = std::max(inoutSum.allocationSizeMax, stats.allocationSizeMax); + inoutSum.allocationSizeMin = std::min(inoutSum.allocationSizeMin, stats.allocationSizeMin); + inoutSum.unusedRangeSizeMax = std::max(inoutSum.unusedRangeSizeMax, stats.unusedRangeSizeMax); + inoutSum.unusedRangeSizeMin = std::min(inoutSum.unusedRangeSizeMin, stats.unusedRangeSizeMin); +} + +static void ValidateTotalStatistics(const VmaTotalStatistics& stats) +{ + const VkPhysicalDeviceMemoryProperties* memProps = nullptr; + vmaGetMemoryProperties(g_hAllocator, &memProps); + + VmaDetailedStatistics sum; + InitEmptyDetailedStatistics(sum); + for(uint32_t i = 0; i < memProps->memoryHeapCount; ++i) + AddDetailedStatistics(sum, stats.memoryHeap[i]); + TEST(sum == stats.total); + + InitEmptyDetailedStatistics(sum); + for(uint32_t i = 0; i < memProps->memoryTypeCount; ++i) + AddDetailedStatistics(sum, stats.memoryType[i]); + TEST(sum == stats.total); +} + +static void TestStatistics() +{ + wprintf(L"Testing statistics...\n"); + + constexpr VkDeviceSize BUF_SIZE = 10ull * 1024 * 1024; + constexpr uint32_t BUF_COUNT = 4; + constexpr VkDeviceSize PREALLOCATED_BLOCK_SIZE = BUF_SIZE * (BUF_COUNT + 1); + + const VkPhysicalDeviceMemoryProperties* memProps = {}; + vmaGetMemoryProperties(g_hAllocator, &memProps); + + /* + Test 0: VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. + Test 1: normal allocations. + Test 2: allocations in a custom pool. + Test 3: allocations in a custom pool, DEDICATED_MEMORY. + Test 4: allocations in a custom pool with preallocated memory. + */ + uint32_t memTypeIndex = UINT32_MAX; + for(uint32_t testIndex = 0; testIndex < 5; ++testIndex) + { + vmaSetCurrentFrameIndex(g_hAllocator, ++g_FrameIndex); + + VmaBudget budgetBeg[VK_MAX_MEMORY_HEAPS] = {}; + vmaGetHeapBudgets(g_hAllocator, budgetBeg); + VmaTotalStatistics statsBeg = {}; + vmaCalculateStatistics(g_hAllocator, &statsBeg); + + for(uint32_t i = 0; i < memProps->memoryHeapCount; ++i) + { + TEST(budgetBeg[i].budget > 0); + TEST(budgetBeg[i].budget <= memProps->memoryHeaps[i].size); + TEST(budgetBeg[i].statistics.allocationBytes <= budgetBeg[i].statistics.blockBytes); + } + + // Create pool. + const bool usePool = testIndex >= 2; + const bool useDedicated = testIndex == 0 || testIndex == 3; + const bool usePreallocated = testIndex == 4; + VmaPool pool = VK_NULL_HANDLE; + if(usePool) + { + assert(memTypeIndex != UINT32_MAX); + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.memoryTypeIndex = memTypeIndex; + if(usePreallocated) + { + poolCreateInfo.blockSize = PREALLOCATED_BLOCK_SIZE; + poolCreateInfo.minBlockCount = poolCreateInfo.maxBlockCount = 1; + } + TEST(vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool) == VK_SUCCESS); + } + + VmaStatistics poolStatsBeg = {}; + VmaDetailedStatistics detailedPoolStatsBeg = {}; + if(usePool) + { + vmaGetPoolStatistics(g_hAllocator, pool, &poolStatsBeg); + vmaCalculatePoolStatistics(g_hAllocator, pool, &detailedPoolStatsBeg); + } + + // CREATE BUFFERS + VkBufferCreateInfo bufInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufInfo.size = BUF_SIZE; + bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + if(usePool) + allocCreateInfo.pool = pool; + else + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; + if(useDedicated) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + uint32_t heapIndex = 0; + BufferInfo bufInfos[BUF_COUNT] = {}; + for(uint32_t bufIndex = 0; bufIndex < BUF_COUNT; ++bufIndex) + { + VmaAllocationInfo allocInfo; + VkResult res = vmaCreateBuffer(g_hAllocator, &bufInfo, &allocCreateInfo, + &bufInfos[bufIndex].Buffer, &bufInfos[bufIndex].Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + if(bufIndex == 0) + { + if(testIndex == 1) + memTypeIndex = allocInfo.memoryType; + heapIndex = MemoryTypeToHeap(allocInfo.memoryType); + } + else + { + // All buffers need to fall into the same heap. + TEST(MemoryTypeToHeap(allocInfo.memoryType) == heapIndex); + } + } + + VmaBudget budgetWithBufs[VK_MAX_MEMORY_HEAPS] = {}; + vmaGetHeapBudgets(g_hAllocator, budgetWithBufs); + VmaTotalStatistics statsWithBufs = {}; + vmaCalculateStatistics(g_hAllocator, &statsWithBufs); + + VmaStatistics poolStatsWithBufs = {}; + VmaDetailedStatistics detailedPoolStatsWithBufs = {}; + if(usePool) + { + vmaGetPoolStatistics(g_hAllocator, pool, &poolStatsWithBufs); + vmaCalculatePoolStatistics(g_hAllocator, pool, &detailedPoolStatsWithBufs); + } + + // DESTROY BUFFERS + for(size_t bufIndex = BUF_COUNT; bufIndex--; ) + { + vmaDestroyBuffer(g_hAllocator, bufInfos[bufIndex].Buffer, bufInfos[bufIndex].Allocation); + } + + VmaStatistics poolStatsEnd = {}; + VmaDetailedStatistics detailedPoolStatsEnd = {}; + if(usePool) + { + vmaGetPoolStatistics(g_hAllocator, pool, &poolStatsEnd); + vmaCalculatePoolStatistics(g_hAllocator, pool, &detailedPoolStatsEnd); + } + + // Destroy the pool. + vmaDestroyPool(g_hAllocator, pool); + + VmaBudget budgetEnd[VK_MAX_MEMORY_HEAPS] = {}; + vmaGetHeapBudgets(g_hAllocator, budgetEnd); + VmaTotalStatistics statsEnd = {}; + vmaCalculateStatistics(g_hAllocator, &statsEnd); + + // CHECK MEMORY HEAPS + for(uint32_t i = 0; i < memProps->memoryHeapCount; ++i) + { + TEST(budgetEnd[i].statistics.allocationBytes <= budgetEnd[i].statistics.blockBytes); + + // The heap in which we allocated the testing buffers. + if(i == heapIndex) + { + // VmaBudget::usage + TEST(budgetWithBufs[i].usage >= budgetBeg[i].usage); + TEST(budgetEnd[i].usage <= budgetWithBufs[i].usage); + + // VmaBudget - VmaStatistics::allocationBytes + TEST(budgetEnd[i].statistics.allocationBytes == budgetBeg[i].statistics.allocationBytes); + TEST(budgetWithBufs[i].statistics.allocationBytes == budgetBeg[i].statistics.allocationBytes + BUF_SIZE * BUF_COUNT); + + // VmaBudget - VmaStatistics::blockBytes + if(usePool) + { + TEST(budgetEnd[i].statistics.blockBytes == budgetBeg[i].statistics.blockBytes); + TEST(budgetWithBufs[i].statistics.blockBytes > budgetBeg[i].statistics.blockBytes); + } + else + TEST(budgetWithBufs[i].statistics.blockBytes >= budgetBeg[i].statistics.blockBytes); + + // VmaBudget - VmaStatistics::allocationCount + TEST(budgetEnd[i].statistics.allocationCount == budgetBeg[i].statistics.allocationCount); + TEST(budgetWithBufs[i].statistics.allocationCount == budgetBeg[i].statistics.allocationCount + BUF_COUNT); + + // VmaBudget - VmaStatistics::blockCount + if(useDedicated) + { + TEST(budgetEnd[i].statistics.blockCount == budgetBeg[i].statistics.blockCount); + TEST(budgetWithBufs[i].statistics.blockCount == budgetBeg[i].statistics.blockCount + BUF_COUNT); + } + else if(usePool) + { + TEST(budgetEnd[i].statistics.blockCount == budgetBeg[i].statistics.blockCount); + if(usePreallocated) + TEST(budgetWithBufs[i].statistics.blockCount == budgetBeg[i].statistics.blockCount + 1); + else + TEST(budgetWithBufs[i].statistics.blockCount > budgetBeg[i].statistics.blockCount); + } + } + else + { + TEST(budgetEnd[i].statistics.allocationBytes == budgetBeg[i].statistics.allocationBytes && + budgetEnd[i].statistics.allocationBytes == budgetWithBufs[i].statistics.allocationBytes); + TEST(budgetEnd[i].statistics.blockBytes == budgetBeg[i].statistics.blockBytes && + budgetEnd[i].statistics.blockBytes == budgetWithBufs[i].statistics.blockBytes); + TEST(budgetEnd[i].statistics.allocationCount == budgetBeg[i].statistics.allocationCount && + budgetEnd[i].statistics.allocationCount == budgetWithBufs[i].statistics.allocationCount); + TEST(budgetEnd[i].statistics.blockCount == budgetBeg[i].statistics.blockCount && + budgetEnd[i].statistics.blockCount == budgetWithBufs[i].statistics.blockCount); + } + + // Validate that statistics per heap and per type sum up to total correctly. + ValidateTotalStatistics(statsBeg); + ValidateTotalStatistics(statsWithBufs); + ValidateTotalStatistics(statsEnd); + + // Compare vmaCalculateStatistics per heap with vmaGetBudget. + TEST(statsBeg.memoryHeap[i].statistics == budgetBeg[i].statistics); + TEST(statsWithBufs.memoryHeap[i].statistics == budgetWithBufs[i].statistics); + TEST(statsEnd.memoryHeap[i].statistics == budgetEnd[i].statistics); + + if(usePool) + { + // Compare simple stats with calculated stats to make sure they are identical. + TEST(poolStatsBeg == detailedPoolStatsBeg.statistics); + TEST(poolStatsWithBufs == detailedPoolStatsWithBufs.statistics); + TEST(poolStatsEnd == detailedPoolStatsEnd.statistics); + + // Validate stats of an empty pool. + TEST(detailedPoolStatsBeg.allocationSizeMax == 0); + TEST(detailedPoolStatsEnd.allocationSizeMax == 0); + TEST(detailedPoolStatsBeg.allocationSizeMin == VK_WHOLE_SIZE); + TEST(detailedPoolStatsEnd.allocationSizeMin == VK_WHOLE_SIZE); + TEST(poolStatsBeg.allocationCount == 0); + TEST(poolStatsBeg.allocationBytes == 0); + TEST(poolStatsEnd.allocationCount == 0); + TEST(poolStatsEnd.allocationBytes == 0); + if(usePreallocated) + { + TEST(poolStatsBeg.blockCount == 1); + TEST(poolStatsEnd.blockCount == 1); + TEST(poolStatsBeg.blockBytes == PREALLOCATED_BLOCK_SIZE); + TEST(poolStatsEnd.blockBytes == PREALLOCATED_BLOCK_SIZE); + } + else + { + TEST(poolStatsBeg.blockCount == 0); + TEST(poolStatsBeg.blockBytes == 0); + // Not checking poolStatsEnd.blockCount, blockBytes, because an empty block may stay allocated. + } + + // Validate stats of a pool with buffers. + TEST(detailedPoolStatsWithBufs.allocationSizeMin == BUF_SIZE); + TEST(detailedPoolStatsWithBufs.allocationSizeMax == BUF_SIZE); + TEST(poolStatsWithBufs.allocationCount == BUF_COUNT); + TEST(poolStatsWithBufs.allocationBytes == BUF_COUNT * BUF_SIZE); + if(usePreallocated) + { + TEST(poolStatsWithBufs.blockCount == 1); + TEST(poolStatsWithBufs.blockBytes == PREALLOCATED_BLOCK_SIZE); + } + else + { + TEST(poolStatsWithBufs.blockCount > 0); + TEST(poolStatsWithBufs.blockBytes >= poolStatsWithBufs.allocationBytes); + } + } + } + } +} + +static void TestAliasing() +{ + wprintf(L"Testing aliasing...\n"); + + /* + This is just a simple test, more like a code sample to demonstrate it's possible. + */ + + // A 512x512 texture to be sampled. + VkImageCreateInfo img1CreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + img1CreateInfo.imageType = VK_IMAGE_TYPE_2D; + img1CreateInfo.extent.width = 512; + img1CreateInfo.extent.height = 512; + img1CreateInfo.extent.depth = 1; + img1CreateInfo.mipLevels = 10; + img1CreateInfo.arrayLayers = 1; + img1CreateInfo.format = VK_FORMAT_R8G8B8A8_SRGB; + img1CreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + img1CreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + img1CreateInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + img1CreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + // A full screen texture to be used as color attachment. + VkImageCreateInfo img2CreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + img2CreateInfo.imageType = VK_IMAGE_TYPE_2D; + img2CreateInfo.extent.width = 1920; + img2CreateInfo.extent.height = 1080; + img2CreateInfo.extent.depth = 1; + img2CreateInfo.mipLevels = 1; + img2CreateInfo.arrayLayers = 1; + img2CreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + img2CreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + img2CreateInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + img2CreateInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + img2CreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + VkImage img1 = VK_NULL_HANDLE; + ERR_GUARD_VULKAN(vkCreateImage(g_hDevice, &img1CreateInfo, g_Allocs, &img1)); + VkImage img2 = VK_NULL_HANDLE; + ERR_GUARD_VULKAN(vkCreateImage(g_hDevice, &img2CreateInfo, g_Allocs, &img2)); + + VkMemoryRequirements img1MemReq = {}; + vkGetImageMemoryRequirements(g_hDevice, img1, &img1MemReq); + VkMemoryRequirements img2MemReq = {}; + vkGetImageMemoryRequirements(g_hDevice, img2, &img2MemReq); + + VkMemoryRequirements finalMemReq = {}; + finalMemReq.size = std::max(img1MemReq.size, img2MemReq.size); + finalMemReq.alignment = std::max(img1MemReq.alignment, img2MemReq.alignment); + finalMemReq.memoryTypeBits = img1MemReq.memoryTypeBits & img2MemReq.memoryTypeBits; + if(finalMemReq.memoryTypeBits != 0) + { + wprintf(L" size: max(%llu, %llu) = %llu\n", + img1MemReq.size, img2MemReq.size, finalMemReq.size); + wprintf(L" alignment: max(%llu, %llu) = %llu\n", + img1MemReq.alignment, img2MemReq.alignment, finalMemReq.alignment); + wprintf(L" memoryTypeBits: %u & %u = %u\n", + img1MemReq.memoryTypeBits, img2MemReq.memoryTypeBits, finalMemReq.memoryTypeBits); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.preferredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + + VmaAllocation alloc = VK_NULL_HANDLE; + ERR_GUARD_VULKAN(vmaAllocateMemory(g_hAllocator, &finalMemReq, &allocCreateInfo, &alloc, nullptr)); + + ERR_GUARD_VULKAN(vmaBindImageMemory(g_hAllocator, alloc, img1)); + ERR_GUARD_VULKAN(vmaBindImageMemory(g_hAllocator, alloc, img2)); + + // You can use img1, img2 here, but not at the same time! + + vmaFreeMemory(g_hAllocator, alloc); + } + else + { + wprintf(L" Textures cannot alias!\n"); + } + + vkDestroyImage(g_hDevice, img2, g_Allocs); + vkDestroyImage(g_hDevice, img1, g_Allocs); +} + +static void TestAllocationAliasing() +{ + wprintf(L"Testing allocation aliasing...\n"); + + /* + * Test whether using VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT suppress validation layer error + * by don't supplying VkMemoryDedicatedAllocateInfoKHR to creation of dedicated memory + * that will be used to alias with some other textures. + */ + + VkImageCreateInfo imageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imageInfo.imageType = VK_IMAGE_TYPE_2D; + imageInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imageInfo.extent.depth = 1; + imageInfo.mipLevels = 1; + imageInfo.arrayLayers = 1; + imageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + imageInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT; + + VmaAllocationCreateInfo allocationCreateInfo = {}; + allocationCreateInfo.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + allocationCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + // Bind 2 textures together into same memory without VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT and then with flag set + /* + { + VkImage originalImage; + VmaAllocation allocation; + imageInfo.extent.width = 640; + imageInfo.extent.height = 480; + VkResult res = vmaCreateImage(g_hAllocator, &imageInfo, &allocationCreateInfo, &originalImage, &allocation, nullptr); + TEST(res == VK_SUCCESS); + + VkImage aliasingImage; + imageInfo.extent.width = 480; + imageInfo.extent.height = 256; + res = vkCreateImage(g_hDevice, &imageInfo, nullptr, &aliasingImage); + TEST(res == VK_SUCCESS); + // After binding there should be inevitable validation layer error VUID-vkBindImageMemory-memory-01509 + res = vmaBindImageMemory(g_hAllocator, allocation, aliasingImage); + TEST(res == VK_SUCCESS); + + vkDestroyImage(g_hDevice, aliasingImage, nullptr); + vmaDestroyImage(g_hAllocator, originalImage, allocation); + } + */ + allocationCreateInfo.flags |= VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT; + { + VkImage originalImage; + VmaAllocation allocation; + imageInfo.extent.width = 640; + imageInfo.extent.height = 480; + VkResult res = vmaCreateImage(g_hAllocator, &imageInfo, &allocationCreateInfo, &originalImage, &allocation, nullptr); + TEST(res == VK_SUCCESS); + + VkImage aliasingImage; + imageInfo.extent.width = 480; + imageInfo.extent.height = 256; + res = vkCreateImage(g_hDevice, &imageInfo, g_Allocs, &aliasingImage); + TEST(res == VK_SUCCESS); + // Now with VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT flag validation error is no more + res = vmaBindImageMemory(g_hAllocator, allocation, aliasingImage); + TEST(res == VK_SUCCESS); + + vkDestroyImage(g_hDevice, aliasingImage, g_Allocs); + vmaDestroyImage(g_hAllocator, originalImage, allocation); + } + + // Test creating buffer without DEDICATED flag, but large enought to end up as dedicated. + allocationCreateInfo.flags = VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT; + + VkBufferCreateInfo bufCreateInfo = {VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT; + bufCreateInfo.size = 300 * MEGABYTE; + + { + VkBuffer origBuf; + VmaAllocation alloc; + VmaAllocationInfo allocInfo; + VkResult res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocationCreateInfo, &origBuf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS && origBuf && alloc); + TEST(allocInfo.offset == 0); // Dedicated + + VkBuffer aliasingBuf; + bufCreateInfo.size = 200 * MEGABYTE; + res = vmaCreateAliasingBuffer(g_hAllocator, alloc, &bufCreateInfo, &aliasingBuf); + TEST(res == VK_SUCCESS && aliasingBuf); + + vkDestroyBuffer(g_hDevice, aliasingBuf, g_Allocs); + vmaDestroyBuffer(g_hAllocator, origBuf, alloc); + } +} + +static void TestMapping() +{ + wprintf(L"Testing mapping...\n"); + + VkResult res; + uint32_t memTypeIndex = UINT32_MAX; + + enum TEST + { + TEST_NORMAL, + TEST_POOL, + TEST_DEDICATED, + TEST_COUNT + }; + for(uint32_t testIndex = 0; testIndex < TEST_COUNT; ++testIndex) + { + VmaPool pool = nullptr; + if(testIndex == TEST_POOL) + { + TEST(memTypeIndex != UINT32_MAX); + VmaPoolCreateInfo poolInfo = {}; + poolInfo.memoryTypeIndex = memTypeIndex; + res = vmaCreatePool(g_hAllocator, &poolInfo, &pool); + TEST(res == VK_SUCCESS); + } + + VkBufferCreateInfo bufInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufInfo.size = 0x10000; + bufInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + allocCreateInfo.pool = pool; + if(testIndex == TEST_DEDICATED) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + VmaAllocationInfo allocInfo; + + // Mapped manually + + // Create 2 buffers. + BufferInfo bufferInfos[3]; + for(size_t i = 0; i < 2; ++i) + { + res = vmaCreateBuffer(g_hAllocator, &bufInfo, &allocCreateInfo, + &bufferInfos[i].Buffer, &bufferInfos[i].Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + TEST(allocInfo.pMappedData == nullptr); + memTypeIndex = allocInfo.memoryType; + } + + // Map buffer 0. + char* data00 = nullptr; + res = vmaMapMemory(g_hAllocator, bufferInfos[0].Allocation, (void**)&data00); + TEST(res == VK_SUCCESS && data00 != nullptr); + data00[0xFFFF] = data00[0]; + + // Map buffer 0 second time. + char* data01 = nullptr; + res = vmaMapMemory(g_hAllocator, bufferInfos[0].Allocation, (void**)&data01); + TEST(res == VK_SUCCESS && data01 == data00); + + // Map buffer 1. + char* data1 = nullptr; + res = vmaMapMemory(g_hAllocator, bufferInfos[1].Allocation, (void**)&data1); + TEST(res == VK_SUCCESS && data1 != nullptr); + TEST(!MemoryRegionsOverlap(data00, (size_t)bufInfo.size, data1, (size_t)bufInfo.size)); + data1[0xFFFF] = data1[0]; + + // Unmap buffer 0 two times. + vmaUnmapMemory(g_hAllocator, bufferInfos[0].Allocation); + vmaUnmapMemory(g_hAllocator, bufferInfos[0].Allocation); + vmaGetAllocationInfo(g_hAllocator, bufferInfos[0].Allocation, &allocInfo); + TEST(allocInfo.pMappedData == nullptr); + + // Unmap buffer 1. + vmaUnmapMemory(g_hAllocator, bufferInfos[1].Allocation); + vmaGetAllocationInfo(g_hAllocator, bufferInfos[1].Allocation, &allocInfo); + TEST(allocInfo.pMappedData == nullptr); + + // Create 3rd buffer - persistently mapped. + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_MAPPED_BIT; + res = vmaCreateBuffer(g_hAllocator, &bufInfo, &allocCreateInfo, + &bufferInfos[2].Buffer, &bufferInfos[2].Allocation, &allocInfo); + TEST(res == VK_SUCCESS && allocInfo.pMappedData != nullptr); + + // Map buffer 2. + char* data2 = nullptr; + res = vmaMapMemory(g_hAllocator, bufferInfos[2].Allocation, (void**)&data2); + TEST(res == VK_SUCCESS && data2 == allocInfo.pMappedData); + data2[0xFFFF] = data2[0]; + + // Unmap buffer 2. + vmaUnmapMemory(g_hAllocator, bufferInfos[2].Allocation); + vmaGetAllocationInfo(g_hAllocator, bufferInfos[2].Allocation, &allocInfo); + TEST(allocInfo.pMappedData == data2); + + // Destroy all buffers. + for(size_t i = 3; i--; ) + vmaDestroyBuffer(g_hAllocator, bufferInfos[i].Buffer, bufferInfos[i].Allocation); + + vmaDestroyPool(g_hAllocator, pool); + } +} + +static void TestAllocationMemoryCopy() +{ + wprintf(L"Testing allocation-memory copy...\n"); + + VkResult res; + + constexpr size_t bufSize = 128 * KILOBYTE; + constexpr size_t bufFragmentSize = 1792; + constexpr size_t bufFragmentOffset = 14080; + std::vector origBufVector = std::vector(bufSize); + std::vector newBufVector = std::vector(bufSize); + uint8_t* const origBufData = origBufVector.data(); + uint8_t* const newBufData = newBufVector.data(); + for(size_t i = 0; i < bufSize; ++i) + { + origBufData[i] = (uint8_t)(i * 13 + 7); + } + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = bufSize; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + enum TEST + { + TEST_HOST_ACCESS_SEQUENTIAL_WRITE, + TEST_HOST_ACCESS_SEQUENTIAL_WRITE_PERSISTENTLY_MAPPED, + TEST_HOST_ACCESS_RANDOM, + TEST_HOST_ACCESS_RANDOM_PERSISTENTLY_MAPPED, + TEST_COUNT + }; + for(size_t test = 0; test < TEST_COUNT; ++test) + { + VkBuffer buf = VK_NULL_HANDLE; + VmaAllocation alloc = VK_NULL_HANDLE; + + switch(test) + { + case TEST_HOST_ACCESS_SEQUENTIAL_WRITE: + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; + break; + case TEST_HOST_ACCESS_SEQUENTIAL_WRITE_PERSISTENTLY_MAPPED: + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | + VMA_ALLOCATION_CREATE_MAPPED_BIT; + break; + case TEST_HOST_ACCESS_RANDOM: + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + break; + case TEST_HOST_ACCESS_RANDOM_PERSISTENTLY_MAPPED: + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | + VMA_ALLOCATION_CREATE_MAPPED_BIT; + break; + } + + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr); + TEST(res == VK_SUCCESS && buf && alloc); + + // Test entire allocation (allocationLocalOffset = 0). + // First, try to write. + res = vmaCopyMemoryToAllocation(g_hAllocator, origBufData, alloc, 0, bufSize); + TEST(res == VK_SUCCESS); + + // If HOST_ACCESS_RANDOM, read back and compare. + if(test == TEST_HOST_ACCESS_RANDOM || + test == TEST_HOST_ACCESS_RANDOM_PERSISTENTLY_MAPPED) + { + ZeroMemory(newBufData, bufSize); + res = vmaCopyAllocationToMemory(g_hAllocator, alloc, 0, newBufData, bufSize); + TEST(res == VK_SUCCESS); + TEST(memcmp(origBufData, newBufData, bufSize) == 0); + } + + // Test fragment (allocationLocalOffset > 0). + // Using host data from the beginning, but placing them in the allocation at bufFragmentOffset. + // First, try to write. + res = vmaCopyMemoryToAllocation(g_hAllocator, origBufData, alloc, bufFragmentOffset, bufFragmentSize); + TEST(res == VK_SUCCESS); + + // If HOST_ACCESS_RANDOM, read back and compare. + if(test == TEST_HOST_ACCESS_RANDOM || + test == TEST_HOST_ACCESS_RANDOM_PERSISTENTLY_MAPPED) + { + ZeroMemory(newBufData, bufFragmentSize); + res = vmaCopyAllocationToMemory(g_hAllocator, alloc, bufFragmentOffset, newBufData, bufFragmentSize); + TEST(res == VK_SUCCESS); + TEST(memcmp(origBufData, newBufData, bufFragmentSize) == 0); + } + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + } +} + +// Test CREATE_MAPPED with required DEVICE_LOCAL. There was a bug with it. +static void TestDeviceLocalMapped() +{ + VkResult res; + + for(uint32_t testIndex = 0; testIndex < 2; ++testIndex) + { + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT; + bufCreateInfo.size = 4096; + + VmaPool pool = VK_NULL_HANDLE; + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.requiredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT; + if(testIndex == 1) + { + VmaPoolCreateInfo poolCreateInfo = {}; + res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS); + allocCreateInfo.pool = pool; + } + + VkBuffer buf = VK_NULL_HANDLE; + VmaAllocation alloc = VK_NULL_HANDLE; + VmaAllocationInfo allocInfo = {}; + res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo); + TEST(res == VK_SUCCESS && alloc); + + VkMemoryPropertyFlags memTypeFlags = 0; + vmaGetMemoryTypeProperties(g_hAllocator, allocInfo.memoryType, &memTypeFlags); + const bool shouldBeMapped = (memTypeFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0; + TEST((allocInfo.pMappedData != nullptr) == shouldBeMapped); + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + vmaDestroyPool(g_hAllocator, pool); + } +} + +static void TestMaintenance5() +{ +#if !defined(VMA_KHR_MAINTENANCE5) || VMA_KHR_MAINTENANCE5 + if(!VK_KHR_maintenance5_enabled) + return; + + wprintf(L"Test VK_KHR_maintenance5\n"); + + VkBufferCreateInfo bufCreateInfo = {VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; + bufCreateInfo.size = 64 * KILOBYTE; + + VkBufferUsageFlags2CreateInfoKHR bufUsageFlags2 = {VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR}; + bufUsageFlags2.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + bufCreateInfo.pNext = &bufUsageFlags2; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + VkBuffer buf = VK_NULL_HANDLE; + VmaAllocation alloc = VK_NULL_HANDLE; + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr) == VK_SUCCESS); + + vmaDestroyBuffer(g_hAllocator, buf, alloc); +#endif +} + +static void TestMappingMultithreaded() +{ + wprintf(L"Testing mapping multithreaded...\n"); + + static const uint32_t threadCount = 16; + static const uint32_t bufferCount = 1024; + static const uint32_t threadBufferCount = bufferCount / threadCount; + + VkResult res; + volatile uint32_t memTypeIndex = UINT32_MAX; + + enum TEST + { + TEST_NORMAL, + TEST_POOL, + TEST_DEDICATED, + TEST_COUNT + }; + for(uint32_t testIndex = 0; testIndex < TEST_COUNT; ++testIndex) + { + VmaPool pool = nullptr; + if(testIndex == TEST_POOL) + { + TEST(memTypeIndex != UINT32_MAX); + VmaPoolCreateInfo poolInfo = {}; + poolInfo.memoryTypeIndex = memTypeIndex; + res = vmaCreatePool(g_hAllocator, &poolInfo, &pool); + TEST(res == VK_SUCCESS); + } + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 0x10000; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + allocCreateInfo.pool = pool; + if(testIndex == TEST_DEDICATED) + allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + std::thread threads[threadCount]; + for(uint32_t threadIndex = 0; threadIndex < threadCount; ++threadIndex) + { + threads[threadIndex] = std::thread([=, &memTypeIndex](){ + // ======== THREAD FUNCTION ======== + + RandomNumberGenerator rand{threadIndex}; + + enum class MODE + { + // Don't map this buffer at all. + DONT_MAP, + // Map and quickly unmap. + MAP_FOR_MOMENT, + // Map and unmap before destruction. + MAP_FOR_LONGER, + // Map two times. Quickly unmap, second unmap before destruction. + MAP_TWO_TIMES, + // Create this buffer as persistently mapped. + PERSISTENTLY_MAPPED, + COUNT + }; + std::vector bufInfos{threadBufferCount}; + std::vector bufModes{threadBufferCount}; + + for(uint32_t bufferIndex = 0; bufferIndex < threadBufferCount; ++bufferIndex) + { + BufferInfo& bufInfo = bufInfos[bufferIndex]; + const MODE mode = (MODE)(rand.Generate() % (uint32_t)MODE::COUNT); + bufModes[bufferIndex] = mode; + + VmaAllocationCreateInfo localAllocCreateInfo = allocCreateInfo; + if(mode == MODE::PERSISTENTLY_MAPPED) + localAllocCreateInfo.flags |= VMA_ALLOCATION_CREATE_MAPPED_BIT; + + VmaAllocationInfo allocInfo; + VkResult res = vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &localAllocCreateInfo, + &bufInfo.Buffer, &bufInfo.Allocation, &allocInfo); + TEST(res == VK_SUCCESS); + + if(memTypeIndex == UINT32_MAX) + memTypeIndex = allocInfo.memoryType; + + char* data = nullptr; + + if(mode == MODE::PERSISTENTLY_MAPPED) + { + data = (char*)allocInfo.pMappedData; + TEST(data != nullptr); + } + else if(mode == MODE::MAP_FOR_MOMENT || mode == MODE::MAP_FOR_LONGER || + mode == MODE::MAP_TWO_TIMES) + { + TEST(data == nullptr); + res = vmaMapMemory(g_hAllocator, bufInfo.Allocation, (void**)&data); + TEST(res == VK_SUCCESS && data != nullptr); + + if(mode == MODE::MAP_TWO_TIMES) + { + char* data2 = nullptr; + res = vmaMapMemory(g_hAllocator, bufInfo.Allocation, (void**)&data2); + TEST(res == VK_SUCCESS && data2 == data); + } + } + else if(mode == MODE::DONT_MAP) + { + TEST(allocInfo.pMappedData == nullptr); + } + else + TEST(0); + + // Test if reading and writing from the beginning and end of mapped memory doesn't crash. + if(data) + data[0xFFFF] = data[0]; + + if(mode == MODE::MAP_FOR_MOMENT || mode == MODE::MAP_TWO_TIMES) + { + vmaUnmapMemory(g_hAllocator, bufInfo.Allocation); + + VmaAllocationInfo allocInfo; + vmaGetAllocationInfo(g_hAllocator, bufInfo.Allocation, &allocInfo); + if(mode == MODE::MAP_FOR_MOMENT) + TEST(allocInfo.pMappedData == nullptr); + else + TEST(allocInfo.pMappedData == data); + } + + switch(rand.Generate() % 3) + { + case 0: Sleep(0); break; // Yield. + case 1: Sleep(10); break; // 10 ms + // default: No sleep. + } + + // Test if reading and writing from the beginning and end of mapped memory doesn't crash. + if(data) + data[0xFFFF] = data[0]; + } + + for(size_t bufferIndex = threadBufferCount; bufferIndex--; ) + { + if(bufModes[bufferIndex] == MODE::MAP_FOR_LONGER || + bufModes[bufferIndex] == MODE::MAP_TWO_TIMES) + { + vmaUnmapMemory(g_hAllocator, bufInfos[bufferIndex].Allocation); + + VmaAllocationInfo allocInfo; + vmaGetAllocationInfo(g_hAllocator, bufInfos[bufferIndex].Allocation, &allocInfo); + TEST(allocInfo.pMappedData == nullptr); + } + + vmaDestroyBuffer(g_hAllocator, bufInfos[bufferIndex].Buffer, bufInfos[bufferIndex].Allocation); + } + }); + } + + for(uint32_t threadIndex = 0; threadIndex < threadCount; ++threadIndex) + threads[threadIndex].join(); + + vmaDestroyPool(g_hAllocator, pool); + } +} + +static void WriteMainTestResultHeader(FILE* file) +{ + fprintf(file, + "Code,Time," + "Threads,Buffers and images,Sizes,Operations,Allocation strategy,Free order," + "Total Time (us)," + "Allocation Time Min (us)," + "Allocation Time Avg (us)," + "Allocation Time Max (us)," + "Deallocation Time Min (us)," + "Deallocation Time Avg (us)," + "Deallocation Time Max (us)," + "Total Memory Allocated (B)," + "Free Range Size Avg (B)," + "Free Range Size Max (B)\n"); +} + +static void WriteMainTestResult( + FILE* file, + const char* codeDescription, + const char* testDescription, + const Config& config, const Result& result) +{ + float totalTimeSeconds = ToFloatSeconds(result.TotalTime); + float allocationTimeMinSeconds = ToFloatSeconds(result.AllocationTimeMin); + float allocationTimeAvgSeconds = ToFloatSeconds(result.AllocationTimeAvg); + float allocationTimeMaxSeconds = ToFloatSeconds(result.AllocationTimeMax); + float deallocationTimeMinSeconds = ToFloatSeconds(result.DeallocationTimeMin); + float deallocationTimeAvgSeconds = ToFloatSeconds(result.DeallocationTimeAvg); + float deallocationTimeMaxSeconds = ToFloatSeconds(result.DeallocationTimeMax); + + std::string currTime; + CurrentTimeToStr(currTime); + + fprintf(file, + "%s,%s,%s," + "%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%I64u,%I64u,%I64u\n", + codeDescription, + currTime.c_str(), + testDescription, + totalTimeSeconds * 1e6f, + allocationTimeMinSeconds * 1e6f, + allocationTimeAvgSeconds * 1e6f, + allocationTimeMaxSeconds * 1e6f, + deallocationTimeMinSeconds * 1e6f, + deallocationTimeAvgSeconds * 1e6f, + deallocationTimeMaxSeconds * 1e6f, + result.TotalMemoryAllocated, + result.FreeRangeSizeAvg, + result.FreeRangeSizeMax); +} + +static void WritePoolTestResultHeader(FILE* file) +{ + fprintf(file, + "Code,Test,Time," + "Config," + "Total Time (us)," + "Allocation Time Min (us)," + "Allocation Time Avg (us)," + "Allocation Time Max (us)," + "Deallocation Time Min (us)," + "Deallocation Time Avg (us)," + "Deallocation Time Max (us)," + "Failed Allocation Count," + "Failed Allocation Total Size (B)\n"); +} + +static void WritePoolTestResult( + FILE* file, + const char* codeDescription, + const char* testDescription, + const PoolTestConfig& config, + const PoolTestResult& result) +{ + float totalTimeSeconds = ToFloatSeconds(result.TotalTime); + float allocationTimeMinSeconds = ToFloatSeconds(result.AllocationTimeMin); + float allocationTimeAvgSeconds = ToFloatSeconds(result.AllocationTimeAvg); + float allocationTimeMaxSeconds = ToFloatSeconds(result.AllocationTimeMax); + float deallocationTimeMinSeconds = ToFloatSeconds(result.DeallocationTimeMin); + float deallocationTimeAvgSeconds = ToFloatSeconds(result.DeallocationTimeAvg); + float deallocationTimeMaxSeconds = ToFloatSeconds(result.DeallocationTimeMax); + + std::string currTime; + CurrentTimeToStr(currTime); + + fprintf(file, + "%s,%s,%s," + "ThreadCount=%u PoolSize=%llu FrameCount=%u TotalItemCount=%u UsedItemCount=%u...%u ItemsToMakeUnusedPercent=%u," + "%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%I64u,%I64u\n", + // General + codeDescription, + testDescription, + currTime.c_str(), + // Config + config.ThreadCount, + (unsigned long long)config.PoolSize, + config.FrameCount, + config.TotalItemCount, + config.UsedItemCountMin, + config.UsedItemCountMax, + config.ItemsToMakeUnusedPercent, + // Results + totalTimeSeconds * 1e6f, + allocationTimeMinSeconds * 1e6f, + allocationTimeAvgSeconds * 1e6f, + allocationTimeMaxSeconds * 1e6f, + deallocationTimeMinSeconds * 1e6f, + deallocationTimeAvgSeconds * 1e6f, + deallocationTimeMaxSeconds * 1e6f, + result.FailedAllocationCount, + result.FailedAllocationTotalSize); +} + +static void PerformCustomMainTest(FILE* file) +{ + Config config{}; + config.RandSeed = 65735476; + //config.MaxBytesToAllocate = 4ull * 1024 * 1024; // 4 MB + config.MaxBytesToAllocate = 4ull * 1024 * 1024 * 1024; // 4 GB + config.MemUsageProbability[0] = 1; // VMA_MEMORY_USAGE_GPU_ONLY + config.FreeOrder = FREE_ORDER::FORWARD; + config.ThreadCount = 16; + config.ThreadsUsingCommonAllocationsProbabilityPercent = 50; + config.AllocationStrategy = 0; + + // Buffers + //config.AllocationSizes.push_back({4, 16, 1024}); + config.AllocationSizes.push_back({4, 0x10000, 0xA00000}); // 64 KB ... 10 MB + + // Images + //config.AllocationSizes.push_back({4, 0, 0, 4, 32}); + //config.AllocationSizes.push_back({4, 0, 0, 256, 2048}); + + config.BeginBytesToAllocate = config.MaxBytesToAllocate * 5 / 100; + config.AdditionalOperationCount = 1024; + + Result result{}; + VkResult res = MainTest(result, config); + TEST(res == VK_SUCCESS); + WriteMainTestResult(file, "Foo", "CustomTest", config, result); +} + +static void PerformCustomPoolTest(FILE* file) +{ + PoolTestConfig config; + config.PoolSize = 100 * 1024 * 1024; + config.RandSeed = 2345764; + config.ThreadCount = 1; + config.FrameCount = 200; + config.ItemsToMakeUnusedPercent = 2; + + AllocationSize allocSize = {}; + allocSize.BufferSizeMin = 1024; + allocSize.BufferSizeMax = 1024 * 1024; + allocSize.Probability = 1; + config.AllocationSizes.push_back(allocSize); + + allocSize.BufferSizeMin = 0; + allocSize.BufferSizeMax = 0; + allocSize.ImageSizeMin = 128; + allocSize.ImageSizeMax = 1024; + allocSize.Probability = 1; + config.AllocationSizes.push_back(allocSize); + + config.PoolSize = config.CalcAvgResourceSize() * 200; + config.UsedItemCountMax = 160; + config.TotalItemCount = config.UsedItemCountMax * 10; + config.UsedItemCountMin = config.UsedItemCountMax * 80 / 100; + + PoolTestResult result = {}; + TestPool_Benchmark(result, config); + + WritePoolTestResult(file, "Code desc", "Test desc", config, result); +} + +static void PerformMainTests(FILE* file) +{ + wprintf(L"MAIN TESTS:\n"); + + uint32_t repeatCount = 1; + if(ConfigType >= CONFIG_TYPE_MAXIMUM) repeatCount = 3; + + Config config{}; + config.RandSeed = 65735476; + config.MemUsageProbability[0] = 1; // VMA_MEMORY_USAGE_GPU_ONLY + config.FreeOrder = FREE_ORDER::FORWARD; + + size_t threadCountCount = 1; + switch(ConfigType) + { + case CONFIG_TYPE_MINIMUM: threadCountCount = 1; break; + case CONFIG_TYPE_SMALL: threadCountCount = 2; break; + case CONFIG_TYPE_AVERAGE: threadCountCount = 3; break; + case CONFIG_TYPE_LARGE: threadCountCount = 5; break; + case CONFIG_TYPE_MAXIMUM: threadCountCount = 7; break; + default: assert(0); + } + + const size_t strategyCount = GetAllocationStrategyCount(); + + for(size_t threadCountIndex = 0; threadCountIndex < threadCountCount; ++threadCountIndex) + { + std::string desc1; + + switch(threadCountIndex) + { + case 0: + desc1 += "1_thread"; + config.ThreadCount = 1; + config.ThreadsUsingCommonAllocationsProbabilityPercent = 0; + break; + case 1: + desc1 += "16_threads+0%_common"; + config.ThreadCount = 16; + config.ThreadsUsingCommonAllocationsProbabilityPercent = 0; + break; + case 2: + desc1 += "16_threads+50%_common"; + config.ThreadCount = 16; + config.ThreadsUsingCommonAllocationsProbabilityPercent = 50; + break; + case 3: + desc1 += "16_threads+100%_common"; + config.ThreadCount = 16; + config.ThreadsUsingCommonAllocationsProbabilityPercent = 100; + break; + case 4: + desc1 += "2_threads+0%_common"; + config.ThreadCount = 2; + config.ThreadsUsingCommonAllocationsProbabilityPercent = 0; + break; + case 5: + desc1 += "2_threads+50%_common"; + config.ThreadCount = 2; + config.ThreadsUsingCommonAllocationsProbabilityPercent = 50; + break; + case 6: + desc1 += "2_threads+100%_common"; + config.ThreadCount = 2; + config.ThreadsUsingCommonAllocationsProbabilityPercent = 100; + break; + default: + assert(0); + } + + // 0 = buffers, 1 = images, 2 = buffers and images + size_t buffersVsImagesCount = 2; + if(ConfigType >= CONFIG_TYPE_LARGE) ++buffersVsImagesCount; + for(size_t buffersVsImagesIndex = 0; buffersVsImagesIndex < buffersVsImagesCount; ++buffersVsImagesIndex) + { + std::string desc2 = desc1; + switch(buffersVsImagesIndex) + { + case 0: desc2 += ",Buffers"; break; + case 1: desc2 += ",Images"; break; + case 2: desc2 += ",Buffers+Images"; break; + default: assert(0); + } + + // 0 = small, 1 = large, 2 = small and large + size_t smallVsLargeCount = 2; + if(ConfigType >= CONFIG_TYPE_LARGE) ++smallVsLargeCount; + for(size_t smallVsLargeIndex = 0; smallVsLargeIndex < smallVsLargeCount; ++smallVsLargeIndex) + { + std::string desc3 = desc2; + switch(smallVsLargeIndex) + { + case 0: desc3 += ",Small"; break; + case 1: desc3 += ",Large"; break; + case 2: desc3 += ",Small+Large"; break; + default: assert(0); + } + + if(smallVsLargeIndex == 1 || smallVsLargeIndex == 2) + config.MaxBytesToAllocate = 4ull * 1024 * 1024 * 1024; // 4 GB + else + config.MaxBytesToAllocate = 4ull * 1024 * 1024; + + // 0 = varying sizes min...max, 1 = set of constant sizes + size_t constantSizesCount = 1; + if(ConfigType >= CONFIG_TYPE_SMALL) ++constantSizesCount; + for(size_t constantSizesIndex = 0; constantSizesIndex < constantSizesCount; ++constantSizesIndex) + { + std::string desc4 = desc3; + switch(constantSizesIndex) + { + case 0: desc4 += " Varying_sizes"; break; + case 1: desc4 += " Constant_sizes"; break; + default: assert(0); + } + + config.AllocationSizes.clear(); + // Buffers present + if(buffersVsImagesIndex == 0 || buffersVsImagesIndex == 2) + { + // Small + if(smallVsLargeIndex == 0 || smallVsLargeIndex == 2) + { + // Varying size + if(constantSizesIndex == 0) + config.AllocationSizes.push_back({4, 16, 1024}); + // Constant sizes + else + { + config.AllocationSizes.push_back({1, 16, 16}); + config.AllocationSizes.push_back({1, 64, 64}); + config.AllocationSizes.push_back({1, 256, 256}); + config.AllocationSizes.push_back({1, 1024, 1024}); + } + } + // Large + if(smallVsLargeIndex == 1 || smallVsLargeIndex == 2) + { + // Varying size + if(constantSizesIndex == 0) + config.AllocationSizes.push_back({4, 0x10000, 0xA00000}); // 64 KB ... 10 MB + // Constant sizes + else + { + config.AllocationSizes.push_back({1, 0x10000, 0x10000}); + config.AllocationSizes.push_back({1, 0x80000, 0x80000}); + config.AllocationSizes.push_back({1, 0x200000, 0x200000}); + config.AllocationSizes.push_back({1, 0xA00000, 0xA00000}); + } + } + } + // Images present + if(buffersVsImagesIndex == 1 || buffersVsImagesIndex == 2) + { + // Small + if(smallVsLargeIndex == 0 || smallVsLargeIndex == 2) + { + // Varying size + if(constantSizesIndex == 0) + config.AllocationSizes.push_back({4, 0, 0, 4, 32}); + // Constant sizes + else + { + config.AllocationSizes.push_back({1, 0, 0, 4, 4}); + config.AllocationSizes.push_back({1, 0, 0, 8, 8}); + config.AllocationSizes.push_back({1, 0, 0, 16, 16}); + config.AllocationSizes.push_back({1, 0, 0, 32, 32}); + } + } + // Large + if(smallVsLargeIndex == 1 || smallVsLargeIndex == 2) + { + // Varying size + if(constantSizesIndex == 0) + config.AllocationSizes.push_back({4, 0, 0, 256, 2048}); + // Constant sizes + else + { + config.AllocationSizes.push_back({1, 0, 0, 256, 256}); + config.AllocationSizes.push_back({1, 0, 0, 512, 512}); + config.AllocationSizes.push_back({1, 0, 0, 1024, 1024}); + config.AllocationSizes.push_back({1, 0, 0, 2048, 2048}); + } + } + } + + // 0 = 100%, additional_operations = 0, 1 = 50%, 2 = 5%, 3 = 95% additional_operations = a lot + size_t beginBytesToAllocateCount = 1; + if(ConfigType >= CONFIG_TYPE_SMALL) ++beginBytesToAllocateCount; + if(ConfigType >= CONFIG_TYPE_AVERAGE) ++beginBytesToAllocateCount; + if(ConfigType >= CONFIG_TYPE_LARGE) ++beginBytesToAllocateCount; + for(size_t beginBytesToAllocateIndex = 0; beginBytesToAllocateIndex < beginBytesToAllocateCount; ++beginBytesToAllocateIndex) + { + std::string desc5 = desc4; + + switch(beginBytesToAllocateIndex) + { + case 0: + desc5 += ",Allocate_100%"; + config.BeginBytesToAllocate = config.MaxBytesToAllocate; + config.AdditionalOperationCount = 0; + break; + case 1: + desc5 += ",Allocate_50%+Operations"; + config.BeginBytesToAllocate = config.MaxBytesToAllocate * 50 / 100; + config.AdditionalOperationCount = 1024; + break; + case 2: + desc5 += ",Allocate_5%+Operations"; + config.BeginBytesToAllocate = config.MaxBytesToAllocate * 5 / 100; + config.AdditionalOperationCount = 1024; + break; + case 3: + desc5 += ",Allocate_95%+Operations"; + config.BeginBytesToAllocate = config.MaxBytesToAllocate * 95 / 100; + config.AdditionalOperationCount = 1024; + break; + default: + assert(0); + } + + for(size_t strategyIndex = 0; strategyIndex < strategyCount; ++strategyIndex) + { + std::string desc6 = desc5; + switch(strategyIndex) + { + case 0: + desc6 += ",MinMemory"; + config.AllocationStrategy = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT; + break; + case 1: + desc6 += ",MinTime"; + config.AllocationStrategy = VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT; + break; + default: + assert(0); + } + + desc6 += ','; + desc6 += FREE_ORDER_NAMES[(uint32_t)config.FreeOrder]; + + const char* testDescription = desc6.c_str(); + + for(size_t repeat = 0; repeat < repeatCount; ++repeat) + { + printf("%s #%u\n", testDescription, (uint32_t)repeat); + + Result result{}; + VkResult res = MainTest(result, config); + TEST(res == VK_SUCCESS); + if(file) + { + WriteMainTestResult(file, CODE_DESCRIPTION, testDescription, config, result); + } + } + } + } + } + } + } + } +} + +static void PerformPoolTests(FILE* file) +{ + wprintf(L"POOL TESTS:\n"); + + const size_t AVG_RESOURCES_PER_POOL = 300; + + uint32_t repeatCount = 1; + if(ConfigType >= CONFIG_TYPE_MAXIMUM) repeatCount = 3; + + PoolTestConfig config{}; + config.RandSeed = 2346343; + config.FrameCount = 200; + config.ItemsToMakeUnusedPercent = 2; + + size_t threadCountCount = 1; + switch(ConfigType) + { + case CONFIG_TYPE_MINIMUM: threadCountCount = 1; break; + case CONFIG_TYPE_SMALL: threadCountCount = 2; break; + case CONFIG_TYPE_AVERAGE: threadCountCount = 2; break; + case CONFIG_TYPE_LARGE: threadCountCount = 3; break; + case CONFIG_TYPE_MAXIMUM: threadCountCount = 3; break; + default: assert(0); + } + for(size_t threadCountIndex = 0; threadCountIndex < threadCountCount; ++threadCountIndex) + { + std::string desc1; + + switch(threadCountIndex) + { + case 0: + desc1 += "1_thread"; + config.ThreadCount = 1; + break; + case 1: + desc1 += "16_threads"; + config.ThreadCount = 16; + break; + case 2: + desc1 += "2_threads"; + config.ThreadCount = 2; + break; + default: + assert(0); + } + + // 0 = buffers, 1 = images, 2 = buffers and images + size_t buffersVsImagesCount = 2; + if(ConfigType >= CONFIG_TYPE_LARGE) ++buffersVsImagesCount; + for(size_t buffersVsImagesIndex = 0; buffersVsImagesIndex < buffersVsImagesCount; ++buffersVsImagesIndex) + { + std::string desc2 = desc1; + switch(buffersVsImagesIndex) + { + case 0: desc2 += " Buffers"; break; + case 1: desc2 += " Images"; break; + case 2: desc2 += " Buffers+Images"; break; + default: assert(0); + } + + // 0 = small, 1 = large, 2 = small and large + size_t smallVsLargeCount = 2; + if(ConfigType >= CONFIG_TYPE_LARGE) ++smallVsLargeCount; + for(size_t smallVsLargeIndex = 0; smallVsLargeIndex < smallVsLargeCount; ++smallVsLargeIndex) + { + std::string desc3 = desc2; + switch(smallVsLargeIndex) + { + case 0: desc3 += " Small"; break; + case 1: desc3 += " Large"; break; + case 2: desc3 += " Small+Large"; break; + default: assert(0); + } + + if(smallVsLargeIndex == 1 || smallVsLargeIndex == 2) + config.PoolSize = 6ull * 1024 * 1024 * 1024; // 6 GB + else + config.PoolSize = 4ull * 1024 * 1024; + + // 0 = varying sizes min...max, 1 = set of constant sizes + size_t constantSizesCount = 1; + if(ConfigType >= CONFIG_TYPE_SMALL) ++constantSizesCount; + for(size_t constantSizesIndex = 0; constantSizesIndex < constantSizesCount; ++constantSizesIndex) + { + std::string desc4 = desc3; + switch(constantSizesIndex) + { + case 0: desc4 += " Varying_sizes"; break; + case 1: desc4 += " Constant_sizes"; break; + default: assert(0); + } + + config.AllocationSizes.clear(); + // Buffers present + if(buffersVsImagesIndex == 0 || buffersVsImagesIndex == 2) + { + // Small + if(smallVsLargeIndex == 0 || smallVsLargeIndex == 2) + { + // Varying size + if(constantSizesIndex == 0) + config.AllocationSizes.push_back({4, 16, 1024}); + // Constant sizes + else + { + config.AllocationSizes.push_back({1, 16, 16}); + config.AllocationSizes.push_back({1, 64, 64}); + config.AllocationSizes.push_back({1, 256, 256}); + config.AllocationSizes.push_back({1, 1024, 1024}); + } + } + // Large + if(smallVsLargeIndex == 1 || smallVsLargeIndex == 2) + { + // Varying size + if(constantSizesIndex == 0) + config.AllocationSizes.push_back({4, 0x10000, 0xA00000}); // 64 KB ... 10 MB + // Constant sizes + else + { + config.AllocationSizes.push_back({1, 0x10000, 0x10000}); + config.AllocationSizes.push_back({1, 0x80000, 0x80000}); + config.AllocationSizes.push_back({1, 0x200000, 0x200000}); + config.AllocationSizes.push_back({1, 0xA00000, 0xA00000}); + } + } + } + // Images present + if(buffersVsImagesIndex == 1 || buffersVsImagesIndex == 2) + { + // Small + if(smallVsLargeIndex == 0 || smallVsLargeIndex == 2) + { + // Varying size + if(constantSizesIndex == 0) + config.AllocationSizes.push_back({4, 0, 0, 4, 32}); + // Constant sizes + else + { + config.AllocationSizes.push_back({1, 0, 0, 4, 4}); + config.AllocationSizes.push_back({1, 0, 0, 8, 8}); + config.AllocationSizes.push_back({1, 0, 0, 16, 16}); + config.AllocationSizes.push_back({1, 0, 0, 32, 32}); + } + } + // Large + if(smallVsLargeIndex == 1 || smallVsLargeIndex == 2) + { + // Varying size + if(constantSizesIndex == 0) + config.AllocationSizes.push_back({4, 0, 0, 256, 2048}); + // Constant sizes + else + { + config.AllocationSizes.push_back({1, 0, 0, 256, 256}); + config.AllocationSizes.push_back({1, 0, 0, 512, 512}); + config.AllocationSizes.push_back({1, 0, 0, 1024, 1024}); + config.AllocationSizes.push_back({1, 0, 0, 2048, 2048}); + } + } + } + + const VkDeviceSize avgResourceSize = config.CalcAvgResourceSize(); + config.PoolSize = avgResourceSize * AVG_RESOURCES_PER_POOL; + + // 0 = 66%, 1 = 133%, 2 = 100%, 3 = 33%, 4 = 166% + size_t subscriptionModeCount; + switch(ConfigType) + { + case CONFIG_TYPE_MINIMUM: subscriptionModeCount = 2; break; + case CONFIG_TYPE_SMALL: subscriptionModeCount = 2; break; + case CONFIG_TYPE_AVERAGE: subscriptionModeCount = 3; break; + case CONFIG_TYPE_LARGE: subscriptionModeCount = 5; break; + case CONFIG_TYPE_MAXIMUM: subscriptionModeCount = 5; break; + default: assert(0); + } + for(size_t subscriptionModeIndex = 0; subscriptionModeIndex < subscriptionModeCount; ++subscriptionModeIndex) + { + std::string desc5 = desc4; + + switch(subscriptionModeIndex) + { + case 0: + desc5 += " Subscription_66%"; + config.UsedItemCountMax = AVG_RESOURCES_PER_POOL * 66 / 100; + break; + case 1: + desc5 += " Subscription_133%"; + config.UsedItemCountMax = AVG_RESOURCES_PER_POOL * 133 / 100; + break; + case 2: + desc5 += " Subscription_100%"; + config.UsedItemCountMax = AVG_RESOURCES_PER_POOL; + break; + case 3: + desc5 += " Subscription_33%"; + config.UsedItemCountMax = AVG_RESOURCES_PER_POOL * 33 / 100; + break; + case 4: + desc5 += " Subscription_166%"; + config.UsedItemCountMax = AVG_RESOURCES_PER_POOL * 166 / 100; + break; + default: + assert(0); + } + + config.TotalItemCount = config.UsedItemCountMax * 5; + config.UsedItemCountMin = config.UsedItemCountMax * 80 / 100; + + const char* testDescription = desc5.c_str(); + + for(size_t repeat = 0; repeat < repeatCount; ++repeat) + { + printf("%s #%u\n", testDescription, (uint32_t)repeat); + + PoolTestResult result{}; + TestPool_Benchmark(result, config); + WritePoolTestResult(file, CODE_DESCRIPTION, testDescription, config, result); + } + } + } + } + } + } +} + +static void BasicTestTLSF() +{ + wprintf(L"Basic test TLSF\n"); + + VmaVirtualBlock block; + + VmaVirtualBlockCreateInfo blockInfo = {}; + blockInfo.flags = 0; + blockInfo.size = 50331648; + vmaCreateVirtualBlock(&blockInfo, &block); + + VmaVirtualAllocationCreateInfo info = {}; + info.alignment = 2; + + VmaVirtualAllocation allocation[3] = {}; + + info.size = 576; + vmaVirtualAllocate(block, &info, allocation + 0, nullptr); + + info.size = 648; + vmaVirtualAllocate(block, &info, allocation + 1, nullptr); + + vmaVirtualFree(block, allocation[0]); + + info.size = 720; + vmaVirtualAllocate(block, &info, allocation + 2, nullptr); + + vmaVirtualFree(block, allocation[1]); + vmaVirtualFree(block, allocation[2]); + vmaDestroyVirtualBlock(block); +} + +static void BasicTestAllocatePages() +{ + wprintf(L"Basic test allocate pages\n"); + + RandomNumberGenerator rand{765461}; + + VkBufferCreateInfo sampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + sampleBufCreateInfo.size = 1024; // Whatever. + sampleBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + VmaAllocationCreateInfo sampleAllocCreateInfo = {}; + sampleAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + sampleAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; + + VmaPoolCreateInfo poolCreateInfo = {}; + VkResult res = vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, &sampleBufCreateInfo, &sampleAllocCreateInfo, &poolCreateInfo.memoryTypeIndex); + TEST(res == VK_SUCCESS); + + // 1 block of 1 MB. + poolCreateInfo.blockSize = 1024 * 1024; + poolCreateInfo.minBlockCount = poolCreateInfo.maxBlockCount = 1; + + // Create pool. + VmaPool pool = nullptr; + res = vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool); + TEST(res == VK_SUCCESS); + + // Make 100 allocations of 4 KB - they should fit into the pool. + VkMemoryRequirements memReq; + memReq.memoryTypeBits = UINT32_MAX; + memReq.alignment = 4 * 1024; + memReq.size = 4 * 1024; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT; + allocCreateInfo.pool = pool; + + constexpr uint32_t allocCount = 100; + + std::vector alloc{allocCount}; + std::vector allocInfo{allocCount}; + res = vmaAllocateMemoryPages(g_hAllocator, &memReq, &allocCreateInfo, allocCount, alloc.data(), allocInfo.data()); + TEST(res == VK_SUCCESS); + for(uint32_t i = 0; i < allocCount; ++i) + { + TEST(alloc[i] != VK_NULL_HANDLE && + allocInfo[i].pMappedData != nullptr && + allocInfo[i].deviceMemory == allocInfo[0].deviceMemory && + allocInfo[i].memoryType == allocInfo[0].memoryType); + } + + // Free the allocations. + vmaFreeMemoryPages(g_hAllocator, allocCount, alloc.data()); + std::fill(alloc.begin(), alloc.end(), nullptr); + std::fill(allocInfo.begin(), allocInfo.end(), VmaAllocationInfo{}); + + // Try to make 100 allocations of 100 KB. This call should fail due to not enough memory. + // Also test optional allocationInfo = null. + memReq.size = 100 * 1024; + res = vmaAllocateMemoryPages(g_hAllocator, &memReq, &allocCreateInfo, allocCount, alloc.data(), nullptr); + TEST(res != VK_SUCCESS); + TEST(std::find_if(alloc.begin(), alloc.end(), [](VmaAllocation alloc){ return alloc != VK_NULL_HANDLE; }) == alloc.end()); + + // Make 100 allocations of 4 KB, but with required alignment of 128 KB. This should also fail. + memReq.size = 4 * 1024; + memReq.alignment = 128 * 1024; + res = vmaAllocateMemoryPages(g_hAllocator, &memReq, &allocCreateInfo, allocCount, alloc.data(), allocInfo.data()); + TEST(res != VK_SUCCESS); + + // Make 100 dedicated allocations of 4 KB. + memReq.alignment = 4 * 1024; + memReq.size = 4 * 1024; + + VmaAllocationCreateInfo dedicatedAllocCreateInfo = {}; + dedicatedAllocCreateInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; + dedicatedAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT | VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + res = vmaAllocateMemoryPages(g_hAllocator, &memReq, &dedicatedAllocCreateInfo, allocCount, alloc.data(), allocInfo.data()); + TEST(res == VK_SUCCESS); + for(uint32_t i = 0; i < allocCount; ++i) + { + TEST(alloc[i] != VK_NULL_HANDLE && + allocInfo[i].pMappedData != nullptr && + allocInfo[i].memoryType == allocInfo[0].memoryType && + allocInfo[i].offset == 0); + if(i > 0) + { + TEST(allocInfo[i].deviceMemory != allocInfo[0].deviceMemory); + } + } + + // Free the allocations. + vmaFreeMemoryPages(g_hAllocator, allocCount, alloc.data()); + std::fill(alloc.begin(), alloc.end(), nullptr); + std::fill(allocInfo.begin(), allocInfo.end(), VmaAllocationInfo{}); + + vmaDestroyPool(g_hAllocator, pool); +} + +// Test the testing environment. +static void TestGpuData() +{ + RandomNumberGenerator rand = { 53434 }; + + std::vector allocInfo; + + for(size_t i = 0; i < 100; ++i) + { + AllocInfo info = {}; + + info.m_BufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; + info.m_BufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | + VK_BUFFER_USAGE_TRANSFER_SRC_BIT | + VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + info.m_BufferInfo.size = 1024 * 1024 * (rand.Generate() % 9 + 1); + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + VkResult res = vmaCreateBuffer(g_hAllocator, &info.m_BufferInfo, &allocCreateInfo, &info.m_Buffer, &info.m_Allocation, nullptr); + TEST(res == VK_SUCCESS); + + info.m_StartValue = rand.Generate(); + + allocInfo.push_back(std::move(info)); + } + + UploadGpuData(allocInfo.data(), allocInfo.size()); + + ValidateGpuData(allocInfo.data(), allocInfo.size()); + + DestroyAllAllocations(allocInfo); +} + +static void TestVirtualBlocksAlgorithmsBenchmark() +{ + wprintf(L"Benchmark virtual blocks algorithms\n"); + wprintf(L"Alignment,Algorithm,Strategy,Alloc time ms,Random operation time ms,Free time ms\n"); + + const size_t ALLOCATION_COUNT = 7200; + const uint32_t MAX_ALLOC_SIZE = 2056; + const size_t RANDOM_OPERATION_COUNT = ALLOCATION_COUNT * 2; + + VmaVirtualBlockCreateInfo blockCreateInfo = {}; + blockCreateInfo.pAllocationCallbacks = g_Allocs; + blockCreateInfo.size = 0; + + RandomNumberGenerator rand{ 20092010 }; + + uint32_t allocSizes[ALLOCATION_COUNT]; + for (size_t i = 0; i < ALLOCATION_COUNT; ++i) + { + allocSizes[i] = rand.Generate() % MAX_ALLOC_SIZE + 1; + blockCreateInfo.size += allocSizes[i]; + } + blockCreateInfo.size = static_cast(blockCreateInfo.size * 2.5); // 150% size margin in case of buddy fragmentation + + for (uint8_t alignmentIndex = 0; alignmentIndex < 4; ++alignmentIndex) + { + VkDeviceSize alignment; + switch (alignmentIndex) + { + case 0: alignment = 1; break; + case 1: alignment = 16; break; + case 2: alignment = 64; break; + case 3: alignment = 256; break; + default: assert(0); break; + } + + for (uint8_t allocStrategyIndex = 0; allocStrategyIndex < 3; ++allocStrategyIndex) + { + VmaVirtualAllocationCreateFlags allocFlags; + switch (allocStrategyIndex) + { + case 0: allocFlags = 0; break; + case 1: allocFlags = VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT; break; + case 2: allocFlags = VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT; break; + default: assert(0); + } + + for (uint8_t algorithmIndex = 0; algorithmIndex < 2; ++algorithmIndex) + { + switch (algorithmIndex) + { + case 0: + blockCreateInfo.flags = (VmaVirtualBlockCreateFlagBits)0; + break; + case 1: + blockCreateInfo.flags = VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT; + break; + default: + assert(0); + } + + std::vector allocs; + allocs.reserve(ALLOCATION_COUNT + RANDOM_OPERATION_COUNT); + allocs.resize(ALLOCATION_COUNT); + VmaVirtualBlock block; + TEST(vmaCreateVirtualBlock(&blockCreateInfo, &block) == VK_SUCCESS && block); + + // Alloc + time_point timeBegin = std::chrono::high_resolution_clock::now(); + for (size_t i = 0; i < ALLOCATION_COUNT; ++i) + { + VmaVirtualAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.size = allocSizes[i]; + allocCreateInfo.alignment = alignment; + allocCreateInfo.flags = allocFlags; + + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &allocs[i], nullptr) == VK_SUCCESS); + TEST(allocs[i] != VK_NULL_HANDLE); + } + duration allocDuration = std::chrono::high_resolution_clock::now() - timeBegin; + + // Random operations + timeBegin = std::chrono::high_resolution_clock::now(); + for (size_t opIndex = 0; opIndex < RANDOM_OPERATION_COUNT; ++opIndex) + { + if(rand.Generate() % 2) + { + VmaVirtualAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.size = rand.Generate() % MAX_ALLOC_SIZE + 1; + allocCreateInfo.alignment = alignment; + allocCreateInfo.flags = allocFlags; + + VmaVirtualAllocation alloc; + TEST(vmaVirtualAllocate(block, &allocCreateInfo, &alloc, nullptr) == VK_SUCCESS); + TEST(alloc != VK_NULL_HANDLE); + allocs.push_back(alloc); + } + else + { + size_t index = rand.Generate() % allocs.size(); + vmaVirtualFree(block, allocs[index]); + if(index < allocs.size()) + allocs[index] = allocs.back(); + allocs.pop_back(); + } + } + duration randomDuration = std::chrono::high_resolution_clock::now() - timeBegin; + + // Free + timeBegin = std::chrono::high_resolution_clock::now(); + for (size_t i = ALLOCATION_COUNT; i;) + vmaVirtualFree(block, allocs[--i]); + duration freeDuration = std::chrono::high_resolution_clock::now() - timeBegin; + + vmaDestroyVirtualBlock(block); + + printf("%llu,%s,%s,%g,%g,%g\n", + alignment, + VirtualAlgorithmToStr(blockCreateInfo.flags), + GetVirtualAllocationStrategyName(allocFlags), + ToFloatSeconds(allocDuration) * 1000.f, + ToFloatSeconds(randomDuration) * 1000.f, + ToFloatSeconds(freeDuration) * 1000.f); + } + } + } +} + +static void TestMappingHysteresis() +{ + /* + We have no way to check here if hysteresis worked as expected, + but at least we provoke some cases and make sure it doesn't crash or assert. + You can always check details with the debugger. + */ + + wprintf(L"Test mapping hysteresis\n"); + + VkBufferCreateInfo bufCreateInfo = {VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + bufCreateInfo.size = 0x10000; + + VmaAllocationCreateInfo templateAllocCreateInfo = {}; + templateAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + templateAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.blockSize = 10 * MEGABYTE; + poolCreateInfo.minBlockCount = poolCreateInfo.maxBlockCount = 1; + TEST(vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, + &bufCreateInfo, &templateAllocCreateInfo, &poolCreateInfo.memoryTypeIndex) == VK_SUCCESS); + + constexpr uint32_t BUF_COUNT = 30; + bool endOfScenarios = false; + for(uint32_t scenarioIndex = 0; !endOfScenarios; ++scenarioIndex) + { + VmaPool pool; + TEST(vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool) == VK_SUCCESS); + + BufferInfo buf; + VmaAllocationInfo allocInfo; + + std::vector bufs; + + // Scenario: Create + destroy buffers without mapping. Hysteresis should not launch. + if(scenarioIndex == 0) + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + + for(uint32_t bufIndex = 0; bufIndex < BUF_COUNT; ++bufIndex) + { + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf.Buffer, &buf.Allocation, &allocInfo) == VK_SUCCESS); + TEST(allocInfo.pMappedData == nullptr); + vmaDestroyBuffer(g_hAllocator, buf.Buffer, buf.Allocation); + } + } + // Scenario: + // - Create one buffer mapped that stays there. + // - Create + destroy mapped buffers back and forth. Hysteresis should launch. + else if(scenarioIndex == 1) + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT; + + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf.Buffer, &buf.Allocation, &allocInfo) == VK_SUCCESS); + TEST(allocInfo.pMappedData != nullptr); + bufs.push_back(buf); + + for(uint32_t bufIndex = 0; bufIndex < BUF_COUNT; ++bufIndex) + { + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf.Buffer, &buf.Allocation, &allocInfo) == VK_SUCCESS); + TEST(allocInfo.pMappedData != nullptr); + vmaDestroyBuffer(g_hAllocator, buf.Buffer, buf.Allocation); + } + } + // Scenario: Create + destroy mapped buffers. + // Hysteresis should launch as it maps and unmaps back and forth. + else if(scenarioIndex == 2) + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT; + + for(uint32_t bufIndex = 0; bufIndex < BUF_COUNT; ++bufIndex) + { + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf.Buffer, &buf.Allocation, &allocInfo) == VK_SUCCESS); + TEST(allocInfo.pMappedData != nullptr); + vmaDestroyBuffer(g_hAllocator, buf.Buffer, buf.Allocation); + } + } + // Scenario: Create one buffer and map it back and forth. Hysteresis should launch. + else if(scenarioIndex == 3) + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf.Buffer, &buf.Allocation, &allocInfo) == VK_SUCCESS); + + for(uint32_t i = 0; i < BUF_COUNT; ++i) + { + void* mappedData = nullptr; + TEST(vmaMapMemory(g_hAllocator, buf.Allocation, &mappedData) == VK_SUCCESS); + TEST(mappedData != nullptr); + vmaUnmapMemory(g_hAllocator, buf.Allocation); + } + + vmaDestroyBuffer(g_hAllocator, buf.Buffer, buf.Allocation); + } + // Scenario: + // - Create many buffers + // - Map + unmap one of them many times. Hysteresis should launch. + // - Hysteresis should unmap during freeing the buffers. + else if(scenarioIndex == 4) + { + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.pool = pool; + + for(uint32_t bufIndex = 0; bufIndex < BUF_COUNT; ++bufIndex) + { + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf.Buffer, &buf.Allocation, &allocInfo) == VK_SUCCESS); + TEST(allocInfo.pMappedData == nullptr); + bufs.push_back(buf); + } + + for(uint32_t i = 0; i < BUF_COUNT; ++i) + { + void* mappedData = nullptr; + TEST(vmaMapMemory(g_hAllocator, buf.Allocation, &mappedData) == VK_SUCCESS); + TEST(mappedData != nullptr); + vmaUnmapMemory(g_hAllocator, buf.Allocation); + } + } + else + endOfScenarios = true; + + for(size_t i = bufs.size(); i--; ) + vmaDestroyBuffer(g_hAllocator, bufs[i].Buffer, bufs[i].Allocation); + + vmaDestroyPool(g_hAllocator, pool); + } + + // Test hysteresis working currectly in case the mapping fails. See issue #407. + { + VkBufferCreateInfo bufCreateInfo = {VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; + bufCreateInfo.size = 1 * MEGABYTE; + bufCreateInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + VkBuffer buf; + VmaAllocation alloc; + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + &buf, &alloc, nullptr) == VK_SUCCESS); + + VkMemoryPropertyFlags memProps = 0; + vmaGetAllocationMemoryProperties(g_hAllocator, alloc, &memProps); + + // It makes sense to test only if this buffer ended up in a non-HOST_VISIBLE memory, + // which may not be the case on some integrated graphics. + if((memProps & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0) + { + void* ptr; + for (size_t i = 0; i < 10; ++i) + { + TEST(vmaMapMemory(g_hAllocator, alloc, &ptr) == VK_ERROR_MEMORY_MAP_FAILED); + } + } + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + } +} + +void Test() +{ + wprintf(L"TESTING:\n"); + + if(false) + { + //////////////////////////////////////////////////////////////////////////////// + // Temporarily insert custom tests here: + return; + } + + // # Simple tests + +#if VMA_DEBUG_MARGIN + TestDebugMargin(); + TestDebugMarginNotInVirtualAllocator(); +#else + TestJson(); + TestBasics(); + TestVirtualBlocks(); + TestVirtualBlocksAlgorithms(); + TestVirtualBlocksAlgorithmsBenchmark(); + TestAllocationVersusResourceSize(); + //TestGpuData(); // Not calling this because it's just testing the testing environment. + TestPool_SameSize(); + TestPool_MinBlockCount(); + TestPool_MinAllocationAlignment(); + TestPoolsAndAllocationParameters(); + TestHeapSizeLimit(); +#if VMA_DEBUG_INITIALIZE_ALLOCATIONS + TestAllocationsInitialization(); +#endif + TestMemoryUsage(); + TestDeviceCoherentMemory(); + TestStatistics(); + TestAliasing(); + TestAllocationAliasing(); + TestMapping(); + TestAllocationMemoryCopy(); + TestMappingHysteresis(); + TestDeviceLocalMapped(); + TestMaintenance5(); + TestMappingMultithreaded(); + TestLinearAllocator(); + ManuallyTestLinearAllocator(); + TestLinearAllocatorMultiBlock(); + TestAllocationAlgorithmsCorrectness(); + + BasicTestTLSF(); + BasicTestAllocatePages(); + + if (VK_KHR_buffer_device_address_enabled) + TestBufferDeviceAddress(); + if (VK_EXT_memory_priority_enabled) + TestMemoryPriority(); + + { + FILE* file; + fopen_s(&file, "Algorithms.csv", "w"); + assert(file != NULL); + BenchmarkAlgorithms(file); + fclose(file); + } + + TestDefragmentationSimple(); + TestDefragmentationVsMapping(); + if (ConfigType >= CONFIG_TYPE_AVERAGE) + { + TestDefragmentationAlgorithms(); + TestDefragmentationFull(); + TestDefragmentationGpu(); + TestDefragmentationIncrementalBasic(); + TestDefragmentationIncrementalComplex(); + } + + // # Detailed tests + FILE* file; + fopen_s(&file, "Results.csv", "w"); + assert(file != NULL); + + WriteMainTestResultHeader(file); + PerformMainTests(file); + PerformCustomMainTest(file); + + WritePoolTestResultHeader(file); + PerformPoolTests(file); + PerformCustomPoolTest(file); + + fclose(file); +#endif // #if defined(VMA_DEBUG_MARGIN) && VMA_DEBUG_MARGIN > 0 + + wprintf(L"Done, all PASSED.\n"); +} + +#endif // #ifdef _WIN32 diff --git a/deps/VulkanMemoryAllocator/src/Tests.h b/deps/VulkanMemoryAllocator/src/Tests.h new file mode 100644 index 0000000..7dbbef6 --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/Tests.h @@ -0,0 +1,32 @@ +// +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifndef TESTS_H_ +#define TESTS_H_ + +#ifdef _WIN32 + +void Test(); + +#endif // #ifdef _WIN32 + +#endif diff --git a/deps/VulkanMemoryAllocator/src/VmaUsage.cpp b/deps/VulkanMemoryAllocator/src/VmaUsage.cpp index d3b5d5d..778e74e 100644 --- a/deps/VulkanMemoryAllocator/src/VmaUsage.cpp +++ b/deps/VulkanMemoryAllocator/src/VmaUsage.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/deps/VulkanMemoryAllocator/src/VmaUsage.h b/deps/VulkanMemoryAllocator/src/VmaUsage.h index 0140ce4..4676fcd 100644 --- a/deps/VulkanMemoryAllocator/src/VmaUsage.h +++ b/deps/VulkanMemoryAllocator/src/VmaUsage.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -64,6 +64,7 @@ include all public interface declarations. Example: //#define VMA_MEMORY_BUDGET 0 //#define VMA_STATS_STRING_ENABLED 0 //#define VMA_MAPPING_HYSTERESIS_ENABLED 0 +//#define VMA_KHR_MAINTENANCE5 0 //#define VMA_VULKAN_VERSION 1003000 // Vulkan 1.3 //#define VMA_VULKAN_VERSION 1002000 // Vulkan 1.2 @@ -82,6 +83,7 @@ include all public interface declarations. Example: #pragma warning(disable: 4100) // unreferenced formal parameter #pragma warning(disable: 4189) // local variable is initialized but not referenced #pragma warning(disable: 4324) // structure was padded due to alignment specifier +#pragma warning(disable: 4820) // 'X': 'N' bytes padding added after data member 'X' #endif // #ifdef _MSVC_LANG @@ -94,7 +96,7 @@ include all public interface declarations. Example: #pragma clang diagnostic ignored "-Wnullability-completeness" #endif -#include "../include/vk_mem_alloc.h" +#include "vk_mem_alloc.h" #ifdef __clang__ #pragma clang diagnostic pop diff --git a/deps/VulkanMemoryAllocator/src/VulkanSample.cpp b/deps/VulkanMemoryAllocator/src/VulkanSample.cpp new file mode 100644 index 0000000..1a2ebf1 --- /dev/null +++ b/deps/VulkanMemoryAllocator/src/VulkanSample.cpp @@ -0,0 +1,2711 @@ +// +// Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#ifdef _WIN32 + +#include "SparseBindingTest.h" +#include "Tests.h" +#include "VmaUsage.h" +#include "Common.h" +#include +#include +#include + +#pragma comment(lib, "shlwapi.lib") + +static const char* const SHADER_PATH1 = "./"; +static const char* const SHADER_PATH2 = "../bin/"; +static const wchar_t* const WINDOW_CLASS_NAME = L"VULKAN_MEMORY_ALLOCATOR_SAMPLE"; +static const char* const VALIDATION_LAYER_NAME = "VK_LAYER_KHRONOS_validation"; +static const char* const APP_TITLE_A = "Vulkan Memory Allocator Sample 3.1.0"; +static const wchar_t* const APP_TITLE_W = L"Vulkan Memory Allocator Sample 3.1.0"; + +static const bool VSYNC = true; +static const uint32_t COMMAND_BUFFER_COUNT = 2; +static void* const CUSTOM_CPU_ALLOCATION_CALLBACK_USER_DATA = (void*)(intptr_t)43564544; +static const bool USE_CUSTOM_CPU_ALLOCATION_CALLBACKS = true; + +enum class ExitCode : int +{ + GPUList = 2, + Help = 1, + Success = 0, + RuntimeError = -1, + CommandLineError = -2, +}; + +VkPhysicalDevice g_hPhysicalDevice; +VkDevice g_hDevice; +VmaAllocator g_hAllocator; +VkInstance g_hVulkanInstance; + +bool g_EnableValidationLayer = true; +bool VK_KHR_get_memory_requirements2_enabled = false; +bool VK_KHR_get_physical_device_properties2_enabled = false; +bool VK_KHR_dedicated_allocation_enabled = false; +bool VK_KHR_bind_memory2_enabled = false; +bool VK_EXT_memory_budget_enabled = false; +bool VK_AMD_device_coherent_memory_enabled = false; +bool VK_KHR_buffer_device_address_enabled = false; +bool VK_EXT_memory_priority_enabled = false; +bool VK_EXT_debug_utils_enabled = false; +bool VK_KHR_maintenance5_enabled = false; +bool g_SparseBindingEnabled = false; + +// # Pointers to functions from extensions +PFN_vkGetBufferDeviceAddressKHR g_vkGetBufferDeviceAddressKHR; + +static HINSTANCE g_hAppInstance; +static HWND g_hWnd; +static LONG g_SizeX = 1280, g_SizeY = 720; +static VkSurfaceKHR g_hSurface; +static VkQueue g_hPresentQueue; +static VkSurfaceFormatKHR g_SurfaceFormat; +static VkExtent2D g_Extent; +static VkSwapchainKHR g_hSwapchain; +static std::vector g_SwapchainImages; +static std::vector g_SwapchainImageViews; +static std::vector g_Framebuffers; +static VkCommandPool g_hCommandPool; +static VkCommandBuffer g_MainCommandBuffers[COMMAND_BUFFER_COUNT]; +static VkFence g_MainCommandBufferExecutedFences[COMMAND_BUFFER_COUNT]; +VkFence g_ImmediateFence; +static uint32_t g_NextCommandBufferIndex; +// Notice we need as many semaphores as there are swapchain images +static std::vector g_hImageAvailableSemaphores; +static std::vector g_hRenderFinishedSemaphores; +static uint32_t g_SwapchainImageCount = 0; +static uint32_t g_SwapchainImageIndex = 0; +static uint32_t g_GraphicsQueueFamilyIndex = UINT_MAX; +static uint32_t g_PresentQueueFamilyIndex = UINT_MAX; +static uint32_t g_SparseBindingQueueFamilyIndex = UINT_MAX; +static VkDescriptorSetLayout g_hDescriptorSetLayout; +static VkDescriptorPool g_hDescriptorPool; +static VkDescriptorSet g_hDescriptorSet; // Automatically destroyed with m_DescriptorPool. +static VkSampler g_hSampler; +static VkFormat g_DepthFormat; +static VkImage g_hDepthImage; +static VmaAllocation g_hDepthImageAlloc; +static VkImageView g_hDepthImageView; + +static VkSurfaceCapabilitiesKHR g_SurfaceCapabilities; +static std::vector g_SurfaceFormats; +static std::vector g_PresentModes; + +static const VkDebugUtilsMessageSeverityFlagsEXT DEBUG_UTILS_MESSENGER_MESSAGE_SEVERITY = + //VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT | + //VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; +static const VkDebugUtilsMessageTypeFlagsEXT DEBUG_UTILS_MESSENGER_MESSAGE_TYPE = + VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | + VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; +static PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT_Func; +static PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT_Func; +static PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT_Func; + +static VkQueue g_hGraphicsQueue; +VkQueue g_hSparseBindingQueue; +VkCommandBuffer g_hTemporaryCommandBuffer; + +static VkPipelineLayout g_hPipelineLayout; +static VkRenderPass g_hRenderPass; +static VkPipeline g_hPipeline; + +static VkBuffer g_hVertexBuffer; +static VmaAllocation g_hVertexBufferAlloc; +static VkBuffer g_hIndexBuffer; +static VmaAllocation g_hIndexBufferAlloc; +static uint32_t g_VertexCount; +static uint32_t g_IndexCount; + +static VkImage g_hTextureImage; +static VmaAllocation g_hTextureImageAlloc; +static VkImageView g_hTextureImageView; + +static std::atomic_uint32_t g_CpuAllocCount; + +static void* CustomCpuAllocation( + void* pUserData, size_t size, size_t alignment, + VkSystemAllocationScope allocationScope) +{ + assert(pUserData == CUSTOM_CPU_ALLOCATION_CALLBACK_USER_DATA); + void* const result = _aligned_malloc(size, alignment); + if(result) + { + ++g_CpuAllocCount; + } + return result; +} + +static void* CustomCpuReallocation( + void* pUserData, void* pOriginal, size_t size, size_t alignment, + VkSystemAllocationScope allocationScope) +{ + assert(pUserData == CUSTOM_CPU_ALLOCATION_CALLBACK_USER_DATA); + void* const result = _aligned_realloc(pOriginal, size, alignment); + if(pOriginal && !result) + { + --g_CpuAllocCount; + } + else if(!pOriginal && result) + { + ++g_CpuAllocCount; + } + return result; +} + +static void CustomCpuFree(void* pUserData, void* pMemory) +{ + assert(pUserData == CUSTOM_CPU_ALLOCATION_CALLBACK_USER_DATA); + if(pMemory) + { + const uint32_t oldAllocCount = g_CpuAllocCount.fetch_sub(1); + TEST(oldAllocCount > 0); + _aligned_free(pMemory); + } +} + +static const VkAllocationCallbacks g_CpuAllocationCallbacks = { + CUSTOM_CPU_ALLOCATION_CALLBACK_USER_DATA, // pUserData + &CustomCpuAllocation, // pfnAllocation + &CustomCpuReallocation, // pfnReallocation + &CustomCpuFree // pfnFree +}; + +const VkAllocationCallbacks* g_Allocs; + +struct GPUSelection +{ + uint32_t Index = UINT32_MAX; + std::wstring Substring; +}; + +class VulkanUsage +{ +public: + void Init(); + ~VulkanUsage(); + void PrintPhysicalDeviceList() const; + // If failed, returns VK_NULL_HANDLE. + VkPhysicalDevice SelectPhysicalDevice(const GPUSelection& GPUSelection) const; + +private: + VkDebugUtilsMessengerEXT m_DebugUtilsMessenger = VK_NULL_HANDLE; + + void RegisterDebugCallbacks(); + static bool IsLayerSupported(const VkLayerProperties* pProps, size_t propCount, const char* pLayerName); +}; + +struct CommandLineParameters +{ + bool m_Help = false; + bool m_List = false; + bool m_Test = false; + bool m_TestSparseBinding = false; + GPUSelection m_GPUSelection; + + bool Parse(int argc, wchar_t** argv) + { + for(int i = 1; i < argc; ++i) + { + if(_wcsicmp(argv[i], L"-h") == 0 || _wcsicmp(argv[i], L"--Help") == 0) + { + m_Help = true; + } + else if(_wcsicmp(argv[i], L"-l") == 0 || _wcsicmp(argv[i], L"--List") == 0) + { + m_List = true; + } + else if((_wcsicmp(argv[i], L"-g") == 0 || _wcsicmp(argv[i], L"--GPU") == 0) && i + 1 < argc) + { + m_GPUSelection.Substring = argv[i + 1]; + ++i; + } + else if((_wcsicmp(argv[i], L"-i") == 0 || _wcsicmp(argv[i], L"--GPUIndex") == 0) && i + 1 < argc) + { + m_GPUSelection.Index = _wtoi(argv[i + 1]); + ++i; + } + else if (_wcsicmp(argv[i], L"-t") == 0 || _wcsicmp(argv[i], L"--Test") == 0) + { + m_Test = true; + } + else if (_wcsicmp(argv[i], L"-s") == 0 || _wcsicmp(argv[i], L"--TestSparseBinding") == 0) + { + m_TestSparseBinding = true; + } + else + return false; + } + return true; + } +} g_CommandLineParameters; + +void SetDebugUtilsObjectName(VkObjectType type, uint64_t handle, const std::string &name) +{ + if (vkSetDebugUtilsObjectNameEXT_Func == nullptr) + return; + + VkDebugUtilsObjectNameInfoEXT info = { VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT }; + info.objectType = type; + info.objectHandle = handle; + info.pObjectName = name.c_str(); + ERR_GUARD_VULKAN( vkSetDebugUtilsObjectNameEXT_Func(g_hDevice, &info) ); +} + +void BeginSingleTimeCommands() +{ + VkCommandBufferBeginInfo cmdBufBeginInfo = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO }; + cmdBufBeginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; + ERR_GUARD_VULKAN( vkBeginCommandBuffer(g_hTemporaryCommandBuffer, &cmdBufBeginInfo) ); +} + +void EndSingleTimeCommands() +{ + ERR_GUARD_VULKAN( vkEndCommandBuffer(g_hTemporaryCommandBuffer) ); + + SetDebugUtilsObjectName(VK_OBJECT_TYPE_COMMAND_BUFFER, reinterpret_cast(g_hTemporaryCommandBuffer), "g_hTemporaryCommandBuffer"); + + VkSubmitInfo submitInfo = { VK_STRUCTURE_TYPE_SUBMIT_INFO }; + submitInfo.commandBufferCount = 1; + submitInfo.pCommandBuffers = &g_hTemporaryCommandBuffer; + + ERR_GUARD_VULKAN( vkQueueSubmit(g_hGraphicsQueue, 1, &submitInfo, VK_NULL_HANDLE) ); + ERR_GUARD_VULKAN( vkQueueWaitIdle(g_hGraphicsQueue) ); +} + +void LoadShader(std::vector& out, const char* fileName) +{ + std::ifstream file(std::string(SHADER_PATH1) + fileName, std::ios::ate | std::ios::binary); + if(file.is_open() == false) + file.open(std::string(SHADER_PATH2) + fileName, std::ios::ate | std::ios::binary); + assert(file.is_open()); + size_t fileSize = (size_t)file.tellg(); + if(fileSize > 0) + { + out.resize(fileSize); + file.seekg(0); + file.read(out.data(), fileSize); + file.close(); + } + else + out.clear(); +} + +static VkBool32 VKAPI_PTR MyDebugReportCallback( + VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, + VkDebugUtilsMessageTypeFlagsEXT messageTypes, + const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, + void* pUserData) +{ + assert(pCallbackData && pCallbackData->pMessageIdName && pCallbackData->pMessage); + + switch(messageSeverity) + { + case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT: + SetConsoleColor(CONSOLE_COLOR::WARNING); + break; + case VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT: + SetConsoleColor(CONSOLE_COLOR::ERROR_); + break; + case VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT: + SetConsoleColor(CONSOLE_COLOR::NORMAL); + break; + default: // VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT + SetConsoleColor(CONSOLE_COLOR::INFO); + } + + printf("%s \xBA %s\n", pCallbackData->pMessageIdName, pCallbackData->pMessage); + + SetConsoleColor(CONSOLE_COLOR::NORMAL); + + if(messageSeverity == VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT || + messageSeverity == VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) + { + OutputDebugStringA(pCallbackData->pMessage); + OutputDebugStringA("\n"); + } + + return VK_FALSE; +} + +static VkSurfaceFormatKHR ChooseSurfaceFormat() +{ + assert(!g_SurfaceFormats.empty()); + + if((g_SurfaceFormats.size() == 1) && (g_SurfaceFormats[0].format == VK_FORMAT_UNDEFINED)) + { + VkSurfaceFormatKHR result = { VK_FORMAT_B8G8R8A8_UNORM, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR }; + return result; + } + + for(const auto& format : g_SurfaceFormats) + { + if((format.format == VK_FORMAT_B8G8R8A8_UNORM) && + (format.colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR)) + { + return format; + } + } + + return g_SurfaceFormats[0]; +} + +VkPresentModeKHR ChooseSwapPresentMode() +{ + VkPresentModeKHR preferredMode = VSYNC ? VK_PRESENT_MODE_MAILBOX_KHR : VK_PRESENT_MODE_IMMEDIATE_KHR; + + if(std::find(g_PresentModes.begin(), g_PresentModes.end(), preferredMode) != + g_PresentModes.end()) + { + return preferredMode; + } + + return VK_PRESENT_MODE_FIFO_KHR; +} + +static VkExtent2D ChooseSwapExtent() +{ + if(g_SurfaceCapabilities.currentExtent.width != UINT_MAX) + return g_SurfaceCapabilities.currentExtent; + + VkExtent2D result = { + std::max(g_SurfaceCapabilities.minImageExtent.width, + std::min(g_SurfaceCapabilities.maxImageExtent.width, (uint32_t)g_SizeX)), + std::max(g_SurfaceCapabilities.minImageExtent.height, + std::min(g_SurfaceCapabilities.maxImageExtent.height, (uint32_t)g_SizeY)) }; + return result; +} + +static constexpr uint32_t GetVulkanApiVersion() +{ +#if VMA_VULKAN_VERSION == 1003000 + return VK_API_VERSION_1_3; +#elif VMA_VULKAN_VERSION == 1002000 + return VK_API_VERSION_1_2; +#elif VMA_VULKAN_VERSION == 1001000 + return VK_API_VERSION_1_1; +#elif VMA_VULKAN_VERSION == 1000000 + return VK_API_VERSION_1_0; +#else +#error Invalid VMA_VULKAN_VERSION. + return UINT32_MAX; +#endif +} + +void VulkanUsage::Init() +{ + g_hAppInstance = (HINSTANCE)GetModuleHandle(NULL); + + if(USE_CUSTOM_CPU_ALLOCATION_CALLBACKS) + { + g_Allocs = &g_CpuAllocationCallbacks; + } + + uint32_t instanceLayerPropCount = 0; + ERR_GUARD_VULKAN( vkEnumerateInstanceLayerProperties(&instanceLayerPropCount, nullptr) ); + std::vector instanceLayerProps(instanceLayerPropCount); + if(instanceLayerPropCount > 0) + { + ERR_GUARD_VULKAN( vkEnumerateInstanceLayerProperties(&instanceLayerPropCount, instanceLayerProps.data()) ); + } + + if(g_EnableValidationLayer) + { + if(IsLayerSupported(instanceLayerProps.data(), instanceLayerProps.size(), VALIDATION_LAYER_NAME) == false) + { + wprintf(L"Layer \"%hs\" not supported.", VALIDATION_LAYER_NAME); + g_EnableValidationLayer = false; + } + } + + uint32_t availableInstanceExtensionCount = 0; + ERR_GUARD_VULKAN( vkEnumerateInstanceExtensionProperties(nullptr, &availableInstanceExtensionCount, nullptr) ); + std::vector availableInstanceExtensions(availableInstanceExtensionCount); + if(availableInstanceExtensionCount > 0) + { + ERR_GUARD_VULKAN( vkEnumerateInstanceExtensionProperties(nullptr, &availableInstanceExtensionCount, availableInstanceExtensions.data()) ); + } + + std::vector enabledInstanceExtensions; + enabledInstanceExtensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME); + enabledInstanceExtensions.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME); + + std::vector instanceLayers; + if(g_EnableValidationLayer) + { + instanceLayers.push_back(VALIDATION_LAYER_NAME); + } + + for(const auto& extensionProperties : availableInstanceExtensions) + { + if(strcmp(extensionProperties.extensionName, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) == 0) + { + if(GetVulkanApiVersion() == VK_API_VERSION_1_0) + { + enabledInstanceExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + VK_KHR_get_physical_device_properties2_enabled = true; + } + } + else if(strcmp(extensionProperties.extensionName, VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == 0) + { + enabledInstanceExtensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); + VK_EXT_debug_utils_enabled = true; + } + } + + VkApplicationInfo appInfo = { VK_STRUCTURE_TYPE_APPLICATION_INFO }; + appInfo.pApplicationName = APP_TITLE_A; + appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0); + appInfo.pEngineName = "Adam Sawicki Engine"; + appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0); + appInfo.apiVersion = GetVulkanApiVersion(); + + VkInstanceCreateInfo instInfo = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO }; + instInfo.pApplicationInfo = &appInfo; + instInfo.enabledExtensionCount = static_cast(enabledInstanceExtensions.size()); + instInfo.ppEnabledExtensionNames = enabledInstanceExtensions.data(); + instInfo.enabledLayerCount = static_cast(instanceLayers.size()); + instInfo.ppEnabledLayerNames = instanceLayers.data(); + + wprintf(L"Vulkan API version used: "); + switch(appInfo.apiVersion) + { + case VK_API_VERSION_1_0: wprintf(L"1.0\n"); break; +#ifdef VK_VERSION_1_1 + case VK_API_VERSION_1_1: wprintf(L"1.1\n"); break; +#endif +#ifdef VK_VERSION_1_2 + case VK_API_VERSION_1_2: wprintf(L"1.2\n"); break; +#endif +#ifdef VK_VERSION_1_3 + case VK_API_VERSION_1_3: wprintf(L"1.3\n"); break; +#endif + default: assert(0); + } + + ERR_GUARD_VULKAN( vkCreateInstance(&instInfo, g_Allocs, &g_hVulkanInstance) ); + + if(VK_EXT_debug_utils_enabled) + { + RegisterDebugCallbacks(); + } +} + +VulkanUsage::~VulkanUsage() +{ + if(m_DebugUtilsMessenger) + { + vkDestroyDebugUtilsMessengerEXT_Func(g_hVulkanInstance, m_DebugUtilsMessenger, g_Allocs); + } + + if(g_hVulkanInstance) + { + vkDestroyInstance(g_hVulkanInstance, g_Allocs); + g_hVulkanInstance = VK_NULL_HANDLE; + } +} + +void VulkanUsage::PrintPhysicalDeviceList() const +{ + uint32_t deviceCount = 0; + ERR_GUARD_VULKAN(vkEnumeratePhysicalDevices(g_hVulkanInstance, &deviceCount, nullptr)); + std::vector physicalDevices(deviceCount); + if(deviceCount > 0) + { + ERR_GUARD_VULKAN(vkEnumeratePhysicalDevices(g_hVulkanInstance, &deviceCount, physicalDevices.data())); + } + + for(size_t i = 0; i < deviceCount; ++i) + { + VkPhysicalDeviceProperties props = {}; + vkGetPhysicalDeviceProperties(physicalDevices[i], &props); + wprintf(L"Physical device %zu: %hs\n", i, props.deviceName); + } +} + +VkPhysicalDevice VulkanUsage::SelectPhysicalDevice(const GPUSelection& GPUSelection) const +{ + uint32_t deviceCount = 0; + ERR_GUARD_VULKAN(vkEnumeratePhysicalDevices(g_hVulkanInstance, &deviceCount, nullptr)); + std::vector physicalDevices(deviceCount); + if(deviceCount > 0) + { + ERR_GUARD_VULKAN(vkEnumeratePhysicalDevices(g_hVulkanInstance, &deviceCount, physicalDevices.data())); + } + + if(GPUSelection.Index != UINT32_MAX) + { + // Cannot specify both index and name. + if(!GPUSelection.Substring.empty()) + { + return VK_NULL_HANDLE; + } + + return GPUSelection.Index < deviceCount ? physicalDevices[GPUSelection.Index] : VK_NULL_HANDLE; + } + + if(!GPUSelection.Substring.empty()) + { + VkPhysicalDevice result = VK_NULL_HANDLE; + std::wstring name; + for(uint32_t i = 0; i < deviceCount; ++i) + { + VkPhysicalDeviceProperties props = {}; + vkGetPhysicalDeviceProperties(physicalDevices[i], &props); + if(ConvertCharsToUnicode(&name, props.deviceName, strlen(props.deviceName), CP_UTF8) && + StrStrI(name.c_str(), GPUSelection.Substring.c_str())) + { + // Second matching device found - error. + if(result != VK_NULL_HANDLE) + { + return VK_NULL_HANDLE; + } + // First matching device found. + result = physicalDevices[i]; + } + } + // Found or not, return it. + return result; + } + + // Select first one. + return deviceCount > 0 ? physicalDevices[0] : VK_NULL_HANDLE; +} + +void VulkanUsage::RegisterDebugCallbacks() +{ + vkCreateDebugUtilsMessengerEXT_Func = (PFN_vkCreateDebugUtilsMessengerEXT)vkGetInstanceProcAddr( + g_hVulkanInstance, "vkCreateDebugUtilsMessengerEXT"); + vkDestroyDebugUtilsMessengerEXT_Func = (PFN_vkDestroyDebugUtilsMessengerEXT)vkGetInstanceProcAddr( + g_hVulkanInstance, "vkDestroyDebugUtilsMessengerEXT"); + vkSetDebugUtilsObjectNameEXT_Func = (PFN_vkSetDebugUtilsObjectNameEXT)vkGetInstanceProcAddr( + g_hVulkanInstance, "vkSetDebugUtilsObjectNameEXT"); + assert(vkCreateDebugUtilsMessengerEXT_Func); + assert(vkDestroyDebugUtilsMessengerEXT_Func); + assert(vkSetDebugUtilsObjectNameEXT_Func); + + VkDebugUtilsMessengerCreateInfoEXT messengerCreateInfo = { VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT }; + messengerCreateInfo.messageSeverity = DEBUG_UTILS_MESSENGER_MESSAGE_SEVERITY; + messengerCreateInfo.messageType = DEBUG_UTILS_MESSENGER_MESSAGE_TYPE; + messengerCreateInfo.pfnUserCallback = MyDebugReportCallback; + ERR_GUARD_VULKAN( vkCreateDebugUtilsMessengerEXT_Func(g_hVulkanInstance, &messengerCreateInfo, g_Allocs, &m_DebugUtilsMessenger) ); +} + +bool VulkanUsage::IsLayerSupported(const VkLayerProperties* pProps, size_t propCount, const char* pLayerName) +{ + const VkLayerProperties* propsEnd = pProps + propCount; + return std::find_if( + pProps, + propsEnd, + [pLayerName](const VkLayerProperties& prop) -> bool { + return strcmp(pLayerName, prop.layerName) == 0; + }) != propsEnd; +} + +struct Vertex +{ + float pos[3]; + float color[3]; + float texCoord[2]; +}; + +static void CreateMesh() +{ + assert(g_hAllocator); + + static Vertex vertices[] = { + // -X + { { -1.f, -1.f, -1.f}, {1.0f, 0.0f, 0.0f}, {0.f, 0.f} }, + { { -1.f, -1.f, 1.f}, {1.0f, 0.0f, 0.0f}, {1.f, 0.f} }, + { { -1.f, 1.f, -1.f}, {1.0f, 0.0f, 0.0f}, {0.f, 1.f} }, + { { -1.f, 1.f, 1.f}, {1.0f, 0.0f, 0.0f}, {1.f, 1.f} }, + // +X + { { 1.f, -1.f, 1.f}, {0.0f, 1.0f, 0.0f}, {0.f, 0.f} }, + { { 1.f, -1.f, -1.f}, {0.0f, 1.0f, 0.0f}, {1.f, 0.f} }, + { { 1.f, 1.f, 1.f}, {0.0f, 1.0f, 0.0f}, {0.f, 1.f} }, + { { 1.f, 1.f, -1.f}, {0.0f, 1.0f, 0.0f}, {1.f, 1.f} }, + // -Z + { { 1.f, -1.f, -1.f}, {0.0f, 0.0f, 1.0f}, {0.f, 0.f} }, + { {-1.f, -1.f, -1.f}, {0.0f, 0.0f, 1.0f}, {1.f, 0.f} }, + { { 1.f, 1.f, -1.f}, {0.0f, 0.0f, 1.0f}, {0.f, 1.f} }, + { {-1.f, 1.f, -1.f}, {0.0f, 0.0f, 1.0f}, {1.f, 1.f} }, + // +Z + { {-1.f, -1.f, 1.f}, {1.0f, 1.0f, 0.0f}, {0.f, 0.f} }, + { { 1.f, -1.f, 1.f}, {1.0f, 1.0f, 0.0f}, {1.f, 0.f} }, + { {-1.f, 1.f, 1.f}, {1.0f, 1.0f, 0.0f}, {0.f, 1.f} }, + { { 1.f, 1.f, 1.f}, {1.0f, 1.0f, 0.0f}, {1.f, 1.f} }, + // -Y + { {-1.f, -1.f, -1.f}, {0.0f, 1.0f, 1.0f}, {0.f, 0.f} }, + { { 1.f, -1.f, -1.f}, {0.0f, 1.0f, 1.0f}, {1.f, 0.f} }, + { {-1.f, -1.f, 1.f}, {0.0f, 1.0f, 1.0f}, {0.f, 1.f} }, + { { 1.f, -1.f, 1.f}, {0.0f, 1.0f, 1.0f}, {1.f, 1.f} }, + // +Y + { { 1.f, 1.f, -1.f}, {1.0f, 0.0f, 1.0f}, {0.f, 0.f} }, + { {-1.f, 1.f, -1.f}, {1.0f, 0.0f, 1.0f}, {1.f, 0.f} }, + { { 1.f, 1.f, 1.f}, {1.0f, 0.0f, 1.0f}, {0.f, 1.f} }, + { {-1.f, 1.f, 1.f}, {1.0f, 0.0f, 1.0f}, {1.f, 1.f} }, + }; + static uint16_t indices[] = { + 0, 1, 2, 3, USHRT_MAX, + 4, 5, 6, 7, USHRT_MAX, + 8, 9, 10, 11, USHRT_MAX, + 12, 13, 14, 15, USHRT_MAX, + 16, 17, 18, 19, USHRT_MAX, + 20, 21, 22, 23, USHRT_MAX, + }; + + size_t vertexBufferSize = sizeof(Vertex) * _countof(vertices); + size_t indexBufferSize = sizeof(uint16_t) * _countof(indices); + g_IndexCount = (uint32_t)_countof(indices); + + // Create vertex buffer + + VkBufferCreateInfo vbInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + vbInfo.size = vertexBufferSize; + vbInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + vbInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; + + VmaAllocationCreateInfo vbAllocCreateInfo = {}; + vbAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + vbAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; + + VkBuffer stagingVertexBuffer = VK_NULL_HANDLE; + VmaAllocation stagingVertexBufferAlloc = VK_NULL_HANDLE; + VmaAllocationInfo stagingVertexBufferAllocInfo = {}; + ERR_GUARD_VULKAN( vmaCreateBuffer(g_hAllocator, &vbInfo, &vbAllocCreateInfo, &stagingVertexBuffer, &stagingVertexBufferAlloc, &stagingVertexBufferAllocInfo) ); + + memcpy(stagingVertexBufferAllocInfo.pMappedData, vertices, vertexBufferSize); + + // No need to flush stagingVertexBuffer memory because CPU_ONLY memory is always HOST_COHERENT. + + vbInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; + vbAllocCreateInfo.flags = 0; + ERR_GUARD_VULKAN( vmaCreateBuffer(g_hAllocator, &vbInfo, &vbAllocCreateInfo, &g_hVertexBuffer, &g_hVertexBufferAlloc, nullptr) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_BUFFER, reinterpret_cast(g_hVertexBuffer), "g_hVertexBuffer"); + + // Create index buffer + + VkBufferCreateInfo ibInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + ibInfo.size = indexBufferSize; + ibInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + ibInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; + + VmaAllocationCreateInfo ibAllocCreateInfo = {}; + ibAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + ibAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; + + VkBuffer stagingIndexBuffer = VK_NULL_HANDLE; + VmaAllocation stagingIndexBufferAlloc = VK_NULL_HANDLE; + VmaAllocationInfo stagingIndexBufferAllocInfo = {}; + ERR_GUARD_VULKAN( vmaCreateBuffer(g_hAllocator, &ibInfo, &ibAllocCreateInfo, &stagingIndexBuffer, &stagingIndexBufferAlloc, &stagingIndexBufferAllocInfo) ); + + memcpy(stagingIndexBufferAllocInfo.pMappedData, indices, indexBufferSize); + + // No need to flush stagingIndexBuffer memory because CPU_ONLY memory is always HOST_COHERENT. + + ibInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT; + ibAllocCreateInfo.flags = 0; + ERR_GUARD_VULKAN( vmaCreateBuffer(g_hAllocator, &ibInfo, &ibAllocCreateInfo, &g_hIndexBuffer, &g_hIndexBufferAlloc, nullptr) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_BUFFER, reinterpret_cast(g_hIndexBuffer), "g_hIndexBuffer"); + + // Copy buffers + + BeginSingleTimeCommands(); + + VkBufferCopy vbCopyRegion = {}; + vbCopyRegion.srcOffset = 0; + vbCopyRegion.dstOffset = 0; + vbCopyRegion.size = vbInfo.size; + vkCmdCopyBuffer(g_hTemporaryCommandBuffer, stagingVertexBuffer, g_hVertexBuffer, 1, &vbCopyRegion); + + VkBufferCopy ibCopyRegion = {}; + ibCopyRegion.srcOffset = 0; + ibCopyRegion.dstOffset = 0; + ibCopyRegion.size = ibInfo.size; + vkCmdCopyBuffer(g_hTemporaryCommandBuffer, stagingIndexBuffer, g_hIndexBuffer, 1, &ibCopyRegion); + + EndSingleTimeCommands(); + + vmaDestroyBuffer(g_hAllocator, stagingIndexBuffer, stagingIndexBufferAlloc); + vmaDestroyBuffer(g_hAllocator, stagingVertexBuffer, stagingVertexBufferAlloc); +} + +static void CreateTexture(uint32_t sizeX, uint32_t sizeY) +{ + // Create staging buffer. + + const VkDeviceSize imageSize = sizeX * sizeY * 4; + + VkBufferCreateInfo stagingBufInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + stagingBufInfo.size = imageSize; + stagingBufInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; + + VmaAllocationCreateInfo stagingBufAllocCreateInfo = {}; + stagingBufAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + stagingBufAllocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; + + VkBuffer stagingBuf = VK_NULL_HANDLE; + VmaAllocation stagingBufAlloc = VK_NULL_HANDLE; + VmaAllocationInfo stagingBufAllocInfo = {}; + ERR_GUARD_VULKAN( vmaCreateBuffer(g_hAllocator, &stagingBufInfo, &stagingBufAllocCreateInfo, &stagingBuf, &stagingBufAlloc, &stagingBufAllocInfo) ); + + char* const pImageData = (char*)stagingBufAllocInfo.pMappedData; + uint8_t* pRowData = (uint8_t*)pImageData; + for(uint32_t y = 0; y < sizeY; ++y) + { + uint32_t* pPixelData = (uint32_t*)pRowData; + for(uint32_t x = 0; x < sizeX; ++x) + { + *pPixelData = + ((x & 0x18) == 0x08 ? 0x000000FF : 0x00000000) | + ((x & 0x18) == 0x10 ? 0x0000FFFF : 0x00000000) | + ((y & 0x18) == 0x08 ? 0x0000FF00 : 0x00000000) | + ((y & 0x18) == 0x10 ? 0x00FF0000 : 0x00000000); + ++pPixelData; + } + pRowData += sizeX * 4; + } + + // No need to flush stagingImage memory because CPU_ONLY memory is always HOST_COHERENT. + + // Create g_hTextureImage in GPU memory. + + VkImageCreateInfo imageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imageInfo.imageType = VK_IMAGE_TYPE_2D; + imageInfo.extent.width = sizeX; + imageInfo.extent.height = sizeY; + imageInfo.extent.depth = 1; + imageInfo.mipLevels = 1; + imageInfo.arrayLayers = 1; + imageInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imageInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + imageInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + imageInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; + imageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + imageInfo.flags = 0; + + VmaAllocationCreateInfo imageAllocCreateInfo = {}; + imageAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + VmaAllocationInfo textureImageAllocInfo = {}; + + ERR_GUARD_VULKAN( vmaCreateImage(g_hAllocator, &imageInfo, &imageAllocCreateInfo, &g_hTextureImage, &g_hTextureImageAlloc, &textureImageAllocInfo) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_IMAGE, reinterpret_cast(g_hTextureImage), "g_hTextureImage"); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_DEVICE_MEMORY, reinterpret_cast(textureImageAllocInfo.deviceMemory), "textureImageAllocInfo.deviceMemory"); + + // Transition image layouts, copy image. + + BeginSingleTimeCommands(); + + VkImageMemoryBarrier imgMemBarrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER }; + imgMemBarrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + imgMemBarrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; + imgMemBarrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + imgMemBarrier.subresourceRange.baseMipLevel = 0; + imgMemBarrier.subresourceRange.levelCount = 1; + imgMemBarrier.subresourceRange.baseArrayLayer = 0; + imgMemBarrier.subresourceRange.layerCount = 1; + imgMemBarrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; + imgMemBarrier.newLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; + imgMemBarrier.image = g_hTextureImage; + imgMemBarrier.srcAccessMask = 0; + imgMemBarrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; + + vkCmdPipelineBarrier( + g_hTemporaryCommandBuffer, + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, + VK_PIPELINE_STAGE_TRANSFER_BIT, + 0, + 0, nullptr, + 0, nullptr, + 1, &imgMemBarrier); + + VkBufferImageCopy region = {}; + region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + region.imageSubresource.layerCount = 1; + region.imageExtent.width = sizeX; + region.imageExtent.height = sizeY; + region.imageExtent.depth = 1; + + vkCmdCopyBufferToImage(g_hTemporaryCommandBuffer, stagingBuf, g_hTextureImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion); + + imgMemBarrier.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; + imgMemBarrier.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + imgMemBarrier.image = g_hTextureImage; + imgMemBarrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; + imgMemBarrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; + + vkCmdPipelineBarrier( + g_hTemporaryCommandBuffer, + VK_PIPELINE_STAGE_TRANSFER_BIT, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, + 0, + 0, nullptr, + 0, nullptr, + 1, &imgMemBarrier); + + EndSingleTimeCommands(); + + vmaDestroyBuffer(g_hAllocator, stagingBuf, stagingBufAlloc); + + // Create ImageView + + VkImageViewCreateInfo textureImageViewInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO }; + textureImageViewInfo.image = g_hTextureImage; + textureImageViewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; + textureImageViewInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + textureImageViewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + textureImageViewInfo.subresourceRange.baseMipLevel = 0; + textureImageViewInfo.subresourceRange.levelCount = 1; + textureImageViewInfo.subresourceRange.baseArrayLayer = 0; + textureImageViewInfo.subresourceRange.layerCount = 1; + ERR_GUARD_VULKAN( vkCreateImageView(g_hDevice, &textureImageViewInfo, g_Allocs, &g_hTextureImageView) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_IMAGE_VIEW, reinterpret_cast(g_hTextureImageView), "g_hTextureImageView"); +} + +struct UniformBufferObject +{ + mat4 ModelViewProj; +}; + +static VkFormat FindSupportedFormat( + const std::vector& candidates, + VkImageTiling tiling, + VkFormatFeatureFlags features) +{ + for (VkFormat format : candidates) + { + VkFormatProperties props; + vkGetPhysicalDeviceFormatProperties(g_hPhysicalDevice, format, &props); + + if ((tiling == VK_IMAGE_TILING_LINEAR) && + ((props.linearTilingFeatures & features) == features)) + { + return format; + } + else if ((tiling == VK_IMAGE_TILING_OPTIMAL) && + ((props.optimalTilingFeatures & features) == features)) + { + return format; + } + } + return VK_FORMAT_UNDEFINED; +} + +static VkFormat FindDepthFormat() +{ + std::vector formats; + formats.push_back(VK_FORMAT_D32_SFLOAT); + formats.push_back(VK_FORMAT_D32_SFLOAT_S8_UINT); + formats.push_back(VK_FORMAT_D24_UNORM_S8_UINT); + + return FindSupportedFormat( + formats, + VK_IMAGE_TILING_OPTIMAL, + VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT); +} + +static void CreateSwapchain() +{ + // Query surface formats. + + ERR_GUARD_VULKAN( vkGetPhysicalDeviceSurfaceCapabilitiesKHR(g_hPhysicalDevice, g_hSurface, &g_SurfaceCapabilities) ); + + uint32_t formatCount = 0; + ERR_GUARD_VULKAN( vkGetPhysicalDeviceSurfaceFormatsKHR(g_hPhysicalDevice, g_hSurface, &formatCount, nullptr) ); + g_SurfaceFormats.resize(formatCount); + ERR_GUARD_VULKAN( vkGetPhysicalDeviceSurfaceFormatsKHR(g_hPhysicalDevice, g_hSurface, &formatCount, g_SurfaceFormats.data()) ); + + uint32_t presentModeCount = 0; + ERR_GUARD_VULKAN( vkGetPhysicalDeviceSurfacePresentModesKHR(g_hPhysicalDevice, g_hSurface, &presentModeCount, nullptr) ); + g_PresentModes.resize(presentModeCount); + ERR_GUARD_VULKAN( vkGetPhysicalDeviceSurfacePresentModesKHR(g_hPhysicalDevice, g_hSurface, &presentModeCount, g_PresentModes.data()) ); + + // Create swap chain + + g_SurfaceFormat = ChooseSurfaceFormat(); + VkPresentModeKHR presentMode = ChooseSwapPresentMode(); + g_Extent = ChooseSwapExtent(); + + g_SwapchainImageCount = g_SurfaceCapabilities.minImageCount + 1; + if((g_SurfaceCapabilities.maxImageCount > 0) && + (g_SwapchainImageCount > g_SurfaceCapabilities.maxImageCount)) + { + g_SwapchainImageCount = g_SurfaceCapabilities.maxImageCount; + } + + VkSwapchainCreateInfoKHR swapChainInfo = { VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR }; + swapChainInfo.surface = g_hSurface; + swapChainInfo.minImageCount = g_SwapchainImageCount; + swapChainInfo.imageFormat = g_SurfaceFormat.format; + swapChainInfo.imageColorSpace = g_SurfaceFormat.colorSpace; + swapChainInfo.imageExtent = g_Extent; + swapChainInfo.imageArrayLayers = 1; + swapChainInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + swapChainInfo.preTransform = g_SurfaceCapabilities.currentTransform; + swapChainInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; + swapChainInfo.presentMode = presentMode; + swapChainInfo.clipped = VK_TRUE; + swapChainInfo.oldSwapchain = g_hSwapchain; + + uint32_t queueFamilyIndices[] = { g_GraphicsQueueFamilyIndex, g_PresentQueueFamilyIndex }; + if(g_PresentQueueFamilyIndex != g_GraphicsQueueFamilyIndex) + { + swapChainInfo.imageSharingMode = VK_SHARING_MODE_CONCURRENT; + swapChainInfo.queueFamilyIndexCount = 2; + swapChainInfo.pQueueFamilyIndices = queueFamilyIndices; + } + else + { + swapChainInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; + } + + VkSwapchainKHR hNewSwapchain = VK_NULL_HANDLE; + ERR_GUARD_VULKAN( vkCreateSwapchainKHR(g_hDevice, &swapChainInfo, g_Allocs, &hNewSwapchain) ); + if(g_hSwapchain != VK_NULL_HANDLE) + vkDestroySwapchainKHR(g_hDevice, g_hSwapchain, g_Allocs); + g_hSwapchain = hNewSwapchain; + + SetDebugUtilsObjectName(VK_OBJECT_TYPE_SWAPCHAIN_KHR, reinterpret_cast(g_hSwapchain), "g_hSwapchain"); + + // Retrieve swapchain images. + + uint32_t swapchainImageCount = 0; + ERR_GUARD_VULKAN( vkGetSwapchainImagesKHR(g_hDevice, g_hSwapchain, &swapchainImageCount, nullptr) ); + g_SwapchainImages.resize(swapchainImageCount); + ERR_GUARD_VULKAN( vkGetSwapchainImagesKHR(g_hDevice, g_hSwapchain, &swapchainImageCount, g_SwapchainImages.data()) ); + + for (size_t i = 0; i < swapchainImageCount; i++) { + std::string swapchainImgName = "g_SwapchainImages[" + std::to_string(i) + "]"; + SetDebugUtilsObjectName(VK_OBJECT_TYPE_IMAGE, reinterpret_cast(g_SwapchainImages[i]), swapchainImgName); + } + + // Create swapchain image views. + + for(size_t i = g_SwapchainImageViews.size(); i--; ) + vkDestroyImageView(g_hDevice, g_SwapchainImageViews[i], g_Allocs); + g_SwapchainImageViews.clear(); + + VkImageViewCreateInfo swapchainImageViewInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO }; + g_SwapchainImageViews.resize(swapchainImageCount); + for(uint32_t i = 0; i < swapchainImageCount; ++i) + { + swapchainImageViewInfo.image = g_SwapchainImages[i]; + swapchainImageViewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; + swapchainImageViewInfo.format = g_SurfaceFormat.format; + swapchainImageViewInfo.components.r = VK_COMPONENT_SWIZZLE_IDENTITY; + swapchainImageViewInfo.components.g = VK_COMPONENT_SWIZZLE_IDENTITY; + swapchainImageViewInfo.components.b = VK_COMPONENT_SWIZZLE_IDENTITY; + swapchainImageViewInfo.components.a = VK_COMPONENT_SWIZZLE_IDENTITY; + swapchainImageViewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + swapchainImageViewInfo.subresourceRange.baseMipLevel = 0; + swapchainImageViewInfo.subresourceRange.levelCount = 1; + swapchainImageViewInfo.subresourceRange.baseArrayLayer = 0; + swapchainImageViewInfo.subresourceRange.layerCount = 1; + ERR_GUARD_VULKAN( vkCreateImageView(g_hDevice, &swapchainImageViewInfo, g_Allocs, &g_SwapchainImageViews[i]) ); + std::string imgViewName = "g_SwapchainImageViews["+ std::to_string(i) + "]"; + SetDebugUtilsObjectName(VK_OBJECT_TYPE_IMAGE_VIEW, reinterpret_cast(g_SwapchainImageViews[i]), imgViewName); + } + + // Create depth buffer + + g_DepthFormat = FindDepthFormat(); + assert(g_DepthFormat != VK_FORMAT_UNDEFINED); + + VkImageCreateInfo depthImageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + depthImageInfo.imageType = VK_IMAGE_TYPE_2D; + depthImageInfo.extent.width = g_Extent.width; + depthImageInfo.extent.height = g_Extent.height; + depthImageInfo.extent.depth = 1; + depthImageInfo.mipLevels = 1; + depthImageInfo.arrayLayers = 1; + depthImageInfo.format = g_DepthFormat; + depthImageInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + depthImageInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + depthImageInfo.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT; + depthImageInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; + depthImageInfo.samples = VK_SAMPLE_COUNT_1_BIT; + depthImageInfo.flags = 0; + + VmaAllocationCreateInfo depthImageAllocCreateInfo = {}; + depthImageAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + VmaAllocationInfo depthImageAllocInfo = {}; + + ERR_GUARD_VULKAN( vmaCreateImage(g_hAllocator, &depthImageInfo, &depthImageAllocCreateInfo, &g_hDepthImage, &g_hDepthImageAlloc, &depthImageAllocInfo) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_IMAGE, reinterpret_cast(g_hDepthImage), "g_hDepthImage"); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_DEVICE_MEMORY, reinterpret_cast(depthImageAllocInfo.deviceMemory), "depthImageAllocInfo.deviceMemory"); + + VkImageViewCreateInfo depthImageViewInfo = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO }; + depthImageViewInfo.image = g_hDepthImage; + depthImageViewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; + depthImageViewInfo.format = g_DepthFormat; + depthImageViewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT; + depthImageViewInfo.subresourceRange.baseMipLevel = 0; + depthImageViewInfo.subresourceRange.levelCount = 1; + depthImageViewInfo.subresourceRange.baseArrayLayer = 0; + depthImageViewInfo.subresourceRange.layerCount = 1; + + ERR_GUARD_VULKAN( vkCreateImageView(g_hDevice, &depthImageViewInfo, g_Allocs, &g_hDepthImageView) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_IMAGE_VIEW, reinterpret_cast(g_hDepthImageView), "g_hDepthImageView"); + + // Create pipeline layout + { + if(g_hPipelineLayout != VK_NULL_HANDLE) + { + vkDestroyPipelineLayout(g_hDevice, g_hPipelineLayout, g_Allocs); + g_hPipelineLayout = VK_NULL_HANDLE; + } + + VkPushConstantRange pushConstantRanges[1]; + ZeroMemory(&pushConstantRanges, sizeof pushConstantRanges); + pushConstantRanges[0].offset = 0; + pushConstantRanges[0].size = sizeof(UniformBufferObject); + pushConstantRanges[0].stageFlags = VK_SHADER_STAGE_VERTEX_BIT; + + VkDescriptorSetLayout descriptorSetLayouts[] = { g_hDescriptorSetLayout }; + VkPipelineLayoutCreateInfo pipelineLayoutInfo = { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO }; + pipelineLayoutInfo.setLayoutCount = 1; + pipelineLayoutInfo.pSetLayouts = descriptorSetLayouts; + pipelineLayoutInfo.pushConstantRangeCount = 1; + pipelineLayoutInfo.pPushConstantRanges = pushConstantRanges; + ERR_GUARD_VULKAN( vkCreatePipelineLayout(g_hDevice, &pipelineLayoutInfo, g_Allocs, &g_hPipelineLayout) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_PIPELINE_LAYOUT, reinterpret_cast(g_hPipelineLayout), "g_hPipelineLayout"); + } + + // Create render pass + { + if(g_hRenderPass != VK_NULL_HANDLE) + { + vkDestroyRenderPass(g_hDevice, g_hRenderPass, g_Allocs); + g_hRenderPass = VK_NULL_HANDLE; + } + + VkAttachmentDescription attachments[2]; + ZeroMemory(attachments, sizeof(attachments)); + + attachments[0].format = g_SurfaceFormat.format; + attachments[0].samples = VK_SAMPLE_COUNT_1_BIT; + attachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; + attachments[0].storeOp = VK_ATTACHMENT_STORE_OP_STORE; + attachments[0].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; + attachments[0].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; + attachments[0].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + attachments[0].finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + + attachments[1].format = g_DepthFormat; + attachments[1].samples = VK_SAMPLE_COUNT_1_BIT; + attachments[1].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; + attachments[1].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; + attachments[1].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; + attachments[1].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; + attachments[1].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + attachments[1].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + + VkAttachmentReference colorAttachmentRef = {}; + colorAttachmentRef.attachment = 0; + colorAttachmentRef.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; + + VkAttachmentReference depthStencilAttachmentRef = {}; + depthStencilAttachmentRef.attachment = 1; + depthStencilAttachmentRef.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + + VkSubpassDescription subpassDesc = {}; + subpassDesc.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; + subpassDesc.colorAttachmentCount = 1; + subpassDesc.pColorAttachments = &colorAttachmentRef; + subpassDesc.pDepthStencilAttachment = &depthStencilAttachmentRef; + + VkRenderPassCreateInfo renderPassInfo = { VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO }; + renderPassInfo.attachmentCount = (uint32_t)_countof(attachments); + renderPassInfo.pAttachments = attachments; + renderPassInfo.subpassCount = 1; + renderPassInfo.pSubpasses = &subpassDesc; + renderPassInfo.dependencyCount = 0; + ERR_GUARD_VULKAN( vkCreateRenderPass(g_hDevice, &renderPassInfo, g_Allocs, &g_hRenderPass) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_RENDER_PASS, reinterpret_cast(g_hRenderPass), "g_hRenderPass"); + } + + // Create pipeline + { + std::vector vertShaderCode; + LoadShader(vertShaderCode, "Shader.vert.spv"); + VkShaderModuleCreateInfo shaderModuleInfo = { VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO }; + shaderModuleInfo.codeSize = vertShaderCode.size(); + shaderModuleInfo.pCode = (const uint32_t*)vertShaderCode.data(); + VkShaderModule hVertShaderModule = VK_NULL_HANDLE; + ERR_GUARD_VULKAN( vkCreateShaderModule(g_hDevice, &shaderModuleInfo, g_Allocs, &hVertShaderModule) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_SHADER_MODULE, reinterpret_cast(hVertShaderModule), "hVertShaderModule"); + + std::vector hFragShaderCode; + LoadShader(hFragShaderCode, "Shader.frag.spv"); + shaderModuleInfo.codeSize = hFragShaderCode.size(); + shaderModuleInfo.pCode = (const uint32_t*)hFragShaderCode.data(); + VkShaderModule fragShaderModule = VK_NULL_HANDLE; + ERR_GUARD_VULKAN( vkCreateShaderModule(g_hDevice, &shaderModuleInfo, g_Allocs, &fragShaderModule) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_SHADER_MODULE, reinterpret_cast(fragShaderModule), "fragShaderModule"); + + VkPipelineShaderStageCreateInfo vertPipelineShaderStageInfo = { VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO }; + vertPipelineShaderStageInfo.stage = VK_SHADER_STAGE_VERTEX_BIT; + vertPipelineShaderStageInfo.module = hVertShaderModule; + vertPipelineShaderStageInfo.pName = "main"; + + VkPipelineShaderStageCreateInfo fragPipelineShaderStageInfo = { VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO }; + fragPipelineShaderStageInfo.stage = VK_SHADER_STAGE_FRAGMENT_BIT; + fragPipelineShaderStageInfo.module = fragShaderModule; + fragPipelineShaderStageInfo.pName = "main"; + + VkPipelineShaderStageCreateInfo pipelineShaderStageInfos[] = { + vertPipelineShaderStageInfo, + fragPipelineShaderStageInfo + }; + + VkVertexInputBindingDescription bindingDescription = {}; + bindingDescription.binding = 0; + bindingDescription.stride = sizeof(Vertex); + bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX; + + VkVertexInputAttributeDescription attributeDescriptions[3]; + ZeroMemory(attributeDescriptions, sizeof(attributeDescriptions)); + + attributeDescriptions[0].binding = 0; + attributeDescriptions[0].location = 0; + attributeDescriptions[0].format = VK_FORMAT_R32G32B32_SFLOAT; + attributeDescriptions[0].offset = offsetof(Vertex, pos); + + attributeDescriptions[1].binding = 0; + attributeDescriptions[1].location = 1; + attributeDescriptions[1].format = VK_FORMAT_R32G32B32_SFLOAT; + attributeDescriptions[1].offset = offsetof(Vertex, color); + + attributeDescriptions[2].binding = 0; + attributeDescriptions[2].location = 2; + attributeDescriptions[2].format = VK_FORMAT_R32G32_SFLOAT; + attributeDescriptions[2].offset = offsetof(Vertex, texCoord); + + VkPipelineVertexInputStateCreateInfo pipelineVertexInputStateInfo = { VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO }; + pipelineVertexInputStateInfo.vertexBindingDescriptionCount = 1; + pipelineVertexInputStateInfo.pVertexBindingDescriptions = &bindingDescription; + pipelineVertexInputStateInfo.vertexAttributeDescriptionCount = _countof(attributeDescriptions); + pipelineVertexInputStateInfo.pVertexAttributeDescriptions = attributeDescriptions; + + VkPipelineInputAssemblyStateCreateInfo pipelineInputAssemblyStateInfo = { VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO }; + pipelineInputAssemblyStateInfo.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP; + pipelineInputAssemblyStateInfo.primitiveRestartEnable = VK_TRUE; + + VkViewport viewport = {}; + viewport.x = 0.f; + viewport.y = 0.f; + viewport.width = (float)g_Extent.width; + viewport.height = (float)g_Extent.height; + viewport.minDepth = 0.f; + viewport.maxDepth = 1.f; + + VkRect2D scissor = {}; + scissor.offset.x = 0; + scissor.offset.y = 0; + scissor.extent = g_Extent; + + VkPipelineViewportStateCreateInfo pipelineViewportStateInfo = { VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO }; + pipelineViewportStateInfo.viewportCount = 1; + pipelineViewportStateInfo.pViewports = &viewport; + pipelineViewportStateInfo.scissorCount = 1; + pipelineViewportStateInfo.pScissors = &scissor; + + VkPipelineRasterizationStateCreateInfo pipelineRasterizationStateInfo = { VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO }; + pipelineRasterizationStateInfo.depthClampEnable = VK_FALSE; + pipelineRasterizationStateInfo.rasterizerDiscardEnable = VK_FALSE; + pipelineRasterizationStateInfo.polygonMode = VK_POLYGON_MODE_FILL; + pipelineRasterizationStateInfo.lineWidth = 1.f; + pipelineRasterizationStateInfo.cullMode = VK_CULL_MODE_BACK_BIT; + pipelineRasterizationStateInfo.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE; + pipelineRasterizationStateInfo.depthBiasEnable = VK_FALSE; + pipelineRasterizationStateInfo.depthBiasConstantFactor = 0.f; + pipelineRasterizationStateInfo.depthBiasClamp = 0.f; + pipelineRasterizationStateInfo.depthBiasSlopeFactor = 0.f; + + VkPipelineMultisampleStateCreateInfo pipelineMultisampleStateInfo = { VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO }; + pipelineMultisampleStateInfo.sampleShadingEnable = VK_FALSE; + pipelineMultisampleStateInfo.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; + pipelineMultisampleStateInfo.minSampleShading = 1.f; + pipelineMultisampleStateInfo.pSampleMask = nullptr; + pipelineMultisampleStateInfo.alphaToCoverageEnable = VK_FALSE; + pipelineMultisampleStateInfo.alphaToOneEnable = VK_FALSE; + + VkPipelineColorBlendAttachmentState pipelineColorBlendAttachmentState = {}; + pipelineColorBlendAttachmentState.colorWriteMask = + VK_COLOR_COMPONENT_R_BIT | + VK_COLOR_COMPONENT_G_BIT | + VK_COLOR_COMPONENT_B_BIT | + VK_COLOR_COMPONENT_A_BIT; + pipelineColorBlendAttachmentState.blendEnable = VK_FALSE; + pipelineColorBlendAttachmentState.srcColorBlendFactor = VK_BLEND_FACTOR_ONE; // Optional + pipelineColorBlendAttachmentState.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO; // Optional + pipelineColorBlendAttachmentState.colorBlendOp = VK_BLEND_OP_ADD; // Optional + pipelineColorBlendAttachmentState.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE; // Optional + pipelineColorBlendAttachmentState.dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO; // Optional + pipelineColorBlendAttachmentState.alphaBlendOp = VK_BLEND_OP_ADD; // Optional + + VkPipelineColorBlendStateCreateInfo pipelineColorBlendStateInfo = { VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO }; + pipelineColorBlendStateInfo.logicOpEnable = VK_FALSE; + pipelineColorBlendStateInfo.logicOp = VK_LOGIC_OP_COPY; + pipelineColorBlendStateInfo.attachmentCount = 1; + pipelineColorBlendStateInfo.pAttachments = &pipelineColorBlendAttachmentState; + + VkPipelineDepthStencilStateCreateInfo depthStencilStateInfo = { VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO }; + depthStencilStateInfo.depthTestEnable = VK_TRUE; + depthStencilStateInfo.depthWriteEnable = VK_TRUE; + depthStencilStateInfo.depthCompareOp = VK_COMPARE_OP_LESS; + depthStencilStateInfo.depthBoundsTestEnable = VK_FALSE; + depthStencilStateInfo.stencilTestEnable = VK_FALSE; + + VkGraphicsPipelineCreateInfo pipelineInfo = { VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO }; + pipelineInfo.stageCount = 2; + pipelineInfo.pStages = pipelineShaderStageInfos; + pipelineInfo.pVertexInputState = &pipelineVertexInputStateInfo; + pipelineInfo.pInputAssemblyState = &pipelineInputAssemblyStateInfo; + pipelineInfo.pViewportState = &pipelineViewportStateInfo; + pipelineInfo.pRasterizationState = &pipelineRasterizationStateInfo; + pipelineInfo.pMultisampleState = &pipelineMultisampleStateInfo; + pipelineInfo.pDepthStencilState = &depthStencilStateInfo; + pipelineInfo.pColorBlendState = &pipelineColorBlendStateInfo; + pipelineInfo.pDynamicState = nullptr; + pipelineInfo.layout = g_hPipelineLayout; + pipelineInfo.renderPass = g_hRenderPass; + pipelineInfo.subpass = 0; + pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; + pipelineInfo.basePipelineIndex = -1; + ERR_GUARD_VULKAN( vkCreateGraphicsPipelines( + g_hDevice, + VK_NULL_HANDLE, + 1, + &pipelineInfo, + g_Allocs, + &g_hPipeline) ); + + SetDebugUtilsObjectName(VK_OBJECT_TYPE_PIPELINE, reinterpret_cast(g_hPipeline), "g_hPipeline"); + + vkDestroyShaderModule(g_hDevice, fragShaderModule, g_Allocs); + vkDestroyShaderModule(g_hDevice, hVertShaderModule, g_Allocs); + } + + // Create frambuffers + + for(size_t i = g_Framebuffers.size(); i--; ) + vkDestroyFramebuffer(g_hDevice, g_Framebuffers[i], g_Allocs); + g_Framebuffers.clear(); + + g_Framebuffers.resize(g_SwapchainImageViews.size()); + for(size_t i = 0; i < g_SwapchainImages.size(); ++i) + { + VkImageView attachments[] = { g_SwapchainImageViews[i], g_hDepthImageView }; + + VkFramebufferCreateInfo framebufferInfo = { VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO }; + framebufferInfo.renderPass = g_hRenderPass; + framebufferInfo.attachmentCount = (uint32_t)_countof(attachments); + framebufferInfo.pAttachments = attachments; + framebufferInfo.width = g_Extent.width; + framebufferInfo.height = g_Extent.height; + framebufferInfo.layers = 1; + ERR_GUARD_VULKAN( vkCreateFramebuffer(g_hDevice, &framebufferInfo, g_Allocs, &g_Framebuffers[i]) ); + std::string framebufName = "g_Framebuffers["+ std::to_string(i) + "]"; + SetDebugUtilsObjectName(VK_OBJECT_TYPE_FRAMEBUFFER, reinterpret_cast(g_Framebuffers[i]), framebufName); + } + + // Destroy the old semaphores and create new ones + + if (g_hImageAvailableSemaphores.size() < g_SwapchainImageCount) { + g_hImageAvailableSemaphores.resize(g_SwapchainImageCount); + } + if (g_hRenderFinishedSemaphores.size() < g_SwapchainImageCount) { + g_hRenderFinishedSemaphores.resize(g_SwapchainImageCount); + } + + VkSemaphoreCreateInfo semaphoreInfo = { VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO }; + + for (std::size_t swapchain_img_index = 0; swapchain_img_index < g_SwapchainImageCount; swapchain_img_index++) { + if (g_hImageAvailableSemaphores.at(swapchain_img_index) != VK_NULL_HANDLE) { + vkDestroySemaphore(g_hDevice, g_hImageAvailableSemaphores[swapchain_img_index], g_Allocs); + g_hImageAvailableSemaphores[swapchain_img_index] = VK_NULL_HANDLE; + } + if (g_hRenderFinishedSemaphores.at(swapchain_img_index) != VK_NULL_HANDLE) { + vkDestroySemaphore(g_hDevice, g_hRenderFinishedSemaphores[swapchain_img_index], g_Allocs); + g_hRenderFinishedSemaphores[swapchain_img_index] = VK_NULL_HANDLE; + } + } + + for (std::size_t swapchain_img_index = 0; swapchain_img_index < g_SwapchainImageCount; swapchain_img_index++) { + ERR_GUARD_VULKAN(vkCreateSemaphore(g_hDevice, &semaphoreInfo, g_Allocs, &g_hImageAvailableSemaphores[swapchain_img_index])); + std::string semaphoreName = "g_hImageAvailableSemaphores[" + std::to_string(swapchain_img_index) + "]"; + SetDebugUtilsObjectName(VK_OBJECT_TYPE_SEMAPHORE, reinterpret_cast(g_hImageAvailableSemaphores[swapchain_img_index]), semaphoreName); + + ERR_GUARD_VULKAN(vkCreateSemaphore(g_hDevice, &semaphoreInfo, g_Allocs, &g_hRenderFinishedSemaphores[swapchain_img_index])); + semaphoreName = "g_hRenderFinishedSemaphores[" + std::to_string(swapchain_img_index) + "]"; + SetDebugUtilsObjectName(VK_OBJECT_TYPE_SEMAPHORE, reinterpret_cast(g_hRenderFinishedSemaphores[swapchain_img_index]), semaphoreName); + } +} + +static void DestroySwapchain(bool destroyActualSwapchain) +{ + for (std::size_t swapchain_img_index = 0; swapchain_img_index < g_SwapchainImageCount; swapchain_img_index++) { + if (g_hImageAvailableSemaphores.at(swapchain_img_index) != VK_NULL_HANDLE) { + vkDestroySemaphore(g_hDevice, g_hImageAvailableSemaphores[swapchain_img_index], g_Allocs); + g_hImageAvailableSemaphores[swapchain_img_index] = VK_NULL_HANDLE; + } + if (g_hRenderFinishedSemaphores.at(swapchain_img_index) != VK_NULL_HANDLE) { + vkDestroySemaphore(g_hDevice, g_hRenderFinishedSemaphores[swapchain_img_index], g_Allocs); + g_hRenderFinishedSemaphores[swapchain_img_index] = VK_NULL_HANDLE; + } + } + + for(size_t i = g_Framebuffers.size(); i--; ) + vkDestroyFramebuffer(g_hDevice, g_Framebuffers[i], g_Allocs); + g_Framebuffers.clear(); + + if(g_hDepthImageView != VK_NULL_HANDLE) + { + vkDestroyImageView(g_hDevice, g_hDepthImageView, g_Allocs); + g_hDepthImageView = VK_NULL_HANDLE; + } + if(g_hDepthImage != VK_NULL_HANDLE) + { + vmaDestroyImage(g_hAllocator, g_hDepthImage, g_hDepthImageAlloc); + g_hDepthImage = VK_NULL_HANDLE; + } + + if(g_hPipeline != VK_NULL_HANDLE) + { + vkDestroyPipeline(g_hDevice, g_hPipeline, g_Allocs); + g_hPipeline = VK_NULL_HANDLE; + } + + if(g_hRenderPass != VK_NULL_HANDLE) + { + vkDestroyRenderPass(g_hDevice, g_hRenderPass, g_Allocs); + g_hRenderPass = VK_NULL_HANDLE; + } + + if(g_hPipelineLayout != VK_NULL_HANDLE) + { + vkDestroyPipelineLayout(g_hDevice, g_hPipelineLayout, g_Allocs); + g_hPipelineLayout = VK_NULL_HANDLE; + } + + for(size_t i = g_SwapchainImageViews.size(); i--; ) + vkDestroyImageView(g_hDevice, g_SwapchainImageViews[i], g_Allocs); + g_SwapchainImageViews.clear(); + + if(destroyActualSwapchain && (g_hSwapchain != VK_NULL_HANDLE)) + { + vkDestroySwapchainKHR(g_hDevice, g_hSwapchain, g_Allocs); + g_hSwapchain = VK_NULL_HANDLE; + } +} + +static void PrintEnabledFeatures() +{ + wprintf(L"Enabled extensions and features:\n"); + wprintf(L"Validation layer: %d\n", g_EnableValidationLayer ? 1 : 0); + wprintf(L"Sparse binding: %d\n", g_SparseBindingEnabled ? 1 : 0); + if(GetVulkanApiVersion() == VK_API_VERSION_1_0) + { + wprintf(L"VK_KHR_get_memory_requirements2: %d\n", VK_KHR_get_memory_requirements2_enabled ? 1 : 0); + wprintf(L"VK_KHR_get_physical_device_properties2: %d\n", VK_KHR_get_physical_device_properties2_enabled ? 1 : 0); + wprintf(L"VK_KHR_dedicated_allocation: %d\n", VK_KHR_dedicated_allocation_enabled ? 1 : 0); + wprintf(L"VK_KHR_bind_memory2: %d\n", VK_KHR_bind_memory2_enabled ? 1 : 0); + } + wprintf(L"VK_EXT_memory_budget: %d\n", VK_EXT_memory_budget_enabled ? 1 : 0); + wprintf(L"VK_AMD_device_coherent_memory: %d\n", VK_AMD_device_coherent_memory_enabled ? 1 : 0); + if(GetVulkanApiVersion() < VK_API_VERSION_1_2) + { + wprintf(L"VK_KHR_buffer_device_address: %d\n", VK_KHR_buffer_device_address_enabled ? 1 : 0); + } + else + { + wprintf(L"bufferDeviceAddress: %d\n", VK_KHR_buffer_device_address_enabled ? 1 : 0); + } + wprintf(L"VK_EXT_memory_priority: %d\n", VK_EXT_memory_priority_enabled ? 1 : 0); + wprintf(L"VK_KHR_maintenance5: %d\n", VK_KHR_maintenance5_enabled? 1 : 0); +} + +void SetAllocatorCreateInfo(VmaAllocatorCreateInfo& outInfo) +{ + outInfo = {}; + + outInfo.physicalDevice = g_hPhysicalDevice; + outInfo.device = g_hDevice; + outInfo.instance = g_hVulkanInstance; + outInfo.vulkanApiVersion = GetVulkanApiVersion(); + + if(VK_KHR_dedicated_allocation_enabled) + { + outInfo.flags |= VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT; + } + if(VK_KHR_bind_memory2_enabled) + { + outInfo.flags |= VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT; + } +#if !defined(VMA_MEMORY_BUDGET) || VMA_MEMORY_BUDGET == 1 + if(VK_EXT_memory_budget_enabled && ( + GetVulkanApiVersion() >= VK_API_VERSION_1_1 || VK_KHR_get_physical_device_properties2_enabled)) + { + outInfo.flags |= VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT; + } +#endif + if(VK_AMD_device_coherent_memory_enabled) + { + outInfo.flags |= VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT; + } + if(VK_KHR_buffer_device_address_enabled) + { + outInfo.flags |= VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT; + } +#if !defined(VMA_MEMORY_PRIORITY) || VMA_MEMORY_PRIORITY == 1 + if(VK_EXT_memory_priority_enabled) + { + outInfo.flags |= VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT; + } +#endif + if(VK_KHR_maintenance5_enabled) + { + outInfo.flags |= VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT; + } + + if(USE_CUSTOM_CPU_ALLOCATION_CALLBACKS) + { + outInfo.pAllocationCallbacks = &g_CpuAllocationCallbacks; + } + +#if VMA_DYNAMIC_VULKAN_FUNCTIONS + static VmaVulkanFunctions vulkanFunctions = {}; + vulkanFunctions.vkGetInstanceProcAddr = vkGetInstanceProcAddr; + vulkanFunctions.vkGetDeviceProcAddr = vkGetDeviceProcAddr; + outInfo.pVulkanFunctions = &vulkanFunctions; +#endif + + // Uncomment to enable HeapSizeLimit. + /* + static std::array heapSizeLimit; + std::fill(heapSizeLimit.begin(), heapSizeLimit.end(), VK_WHOLE_SIZE); + heapSizeLimit[0] = 512ull * 1024 * 1024; + outInfo.pHeapSizeLimit = heapSizeLimit.data(); + */ +} + +static void PrintPhysicalDeviceProperties(const VkPhysicalDeviceProperties& properties) +{ + wprintf(L"physicalDeviceProperties:\n"); + wprintf(L" driverVersion: 0x%X\n", properties.driverVersion); + wprintf(L" vendorID: 0x%X (%s)\n", properties.vendorID, VendorIDToStr(properties.vendorID)); + wprintf(L" deviceID: 0x%X\n", properties.deviceID); + wprintf(L" deviceType: %u (%s)\n", properties.deviceType, PhysicalDeviceTypeToStr(properties.deviceType)); + wprintf(L" deviceName: %hs\n", properties.deviceName); + wprintf(L" limits:\n"); + wprintf(L" maxMemoryAllocationCount: %u\n", properties.limits.maxMemoryAllocationCount); + wprintf(L" bufferImageGranularity: %llu B\n", properties.limits.bufferImageGranularity); + wprintf(L" nonCoherentAtomSize: %llu B\n", properties.limits.nonCoherentAtomSize); +} + +#if VMA_VULKAN_VERSION >= 1002000 +static void PrintPhysicalDeviceVulkan11Properties(const VkPhysicalDeviceVulkan11Properties& properties) +{ + wprintf(L"physicalDeviceVulkan11Properties:\n"); + std::wstring sizeStr = SizeToStr(properties.maxMemoryAllocationSize); + wprintf(L" maxMemoryAllocationSize: %llu B (%s)\n", properties.maxMemoryAllocationSize, sizeStr.c_str()); +} +static void PrintPhysicalDeviceVulkan12Properties(const VkPhysicalDeviceVulkan12Properties& properties) +{ + wprintf(L"physicalDeviceVulkan12Properties:\n"); + std::wstring str = DriverIDToStr(properties.driverID); + wprintf(L" driverID: %u (%s)\n", properties.driverID, str.c_str()); + wprintf(L" driverName: %hs\n", properties.driverName); + wprintf(L" driverInfo: %hs\n", properties.driverInfo); +} +#endif // #if VMA_VULKAN_VERSION > 1002000 + +static void AddFlagToStr(std::wstring& inout, const wchar_t* flagStr) +{ + if(!inout.empty()) + inout += L", "; + inout += flagStr; +} + +static std::wstring HeapFlagsToStr(VkMemoryHeapFlags flags) +{ + std::wstring result; + if(flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) + AddFlagToStr(result, L"DEVICE_LOCAL"); + if(flags & VK_MEMORY_HEAP_MULTI_INSTANCE_BIT) + AddFlagToStr(result, L"MULTI_INSTANCE"); + return result; +} + +static std::wstring PropertyFlagsToStr(VkMemoryPropertyFlags flags) +{ + std::wstring result; + if(flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) + AddFlagToStr(result, L"DEVICE_LOCAL"); + if(flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) + AddFlagToStr(result, L"HOST_VISIBLE"); + if(flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) + AddFlagToStr(result, L"HOST_COHERENT"); + if(flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) + AddFlagToStr(result, L"HOST_CACHED"); + if(flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) + AddFlagToStr(result, L"LAZILY_ALLOCATED"); + +#if VMA_VULKAN_VERSION >= 1001000 + if(flags & VK_MEMORY_PROPERTY_PROTECTED_BIT) + AddFlagToStr(result, L"PROTECTED"); +#endif + +#if VK_AMD_device_coherent_memory + if(flags & VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD) + AddFlagToStr(result, L"DEVICE_COHERENT (AMD)"); + if(flags & VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD) + AddFlagToStr(result, L"DEVICE_UNCACHED (AMD)"); +#endif + + return result; +} + +static void PrintMemoryTypes() +{ + wprintf(L"MEMORY HEAPS:\n"); + const VkPhysicalDeviceMemoryProperties* memProps = nullptr; + vmaGetMemoryProperties(g_hAllocator, &memProps); + + wprintf(L"heapCount=%u, typeCount=%u\n", memProps->memoryHeapCount, memProps->memoryTypeCount); + + std::wstring sizeStr, flagsStr; + for(uint32_t heapIndex = 0; heapIndex < memProps->memoryHeapCount; ++heapIndex) + { + const VkMemoryHeap& heap = memProps->memoryHeaps[heapIndex]; + sizeStr = SizeToStr(heap.size); + flagsStr = HeapFlagsToStr(heap.flags); + wprintf(L"Heap %u: %llu B (%s) %s\n", heapIndex, heap.size, sizeStr.c_str(), flagsStr.c_str()); + + for(uint32_t typeIndex = 0; typeIndex < memProps->memoryTypeCount; ++typeIndex) + { + const VkMemoryType& type = memProps->memoryTypes[typeIndex]; + if(type.heapIndex == heapIndex) + { + flagsStr = PropertyFlagsToStr(type.propertyFlags); + wprintf(L" Type %u: %s\n", typeIndex, flagsStr.c_str()); + } + } + } +} + +static bool CanCreateVertexBuffer(uint32_t allowedMemoryTypeBits) +{ + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 0x10000; + bufCreateInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + VkBuffer buf = VK_NULL_HANDLE; + VkResult res = vkCreateBuffer(g_hDevice, &bufCreateInfo, g_Allocs, &buf); + assert(res == VK_SUCCESS); + + VkMemoryRequirements memReq = {}; + vkGetBufferMemoryRequirements(g_hDevice, buf, &memReq); + + vkDestroyBuffer(g_hDevice, buf, g_Allocs); + + return (memReq.memoryTypeBits & allowedMemoryTypeBits) != 0; +} + +static bool CanCreateOptimalSampledImage(uint32_t allowedMemoryTypeBits) +{ + VkImageCreateInfo imgCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; + imgCreateInfo.imageType = VK_IMAGE_TYPE_2D; + imgCreateInfo.extent.width = 256; + imgCreateInfo.extent.height = 256; + imgCreateInfo.extent.depth = 1; + imgCreateInfo.mipLevels = 1; + imgCreateInfo.arrayLayers = 1; + imgCreateInfo.format = VK_FORMAT_R8G8B8A8_UNORM; + imgCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; + imgCreateInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; + imgCreateInfo.usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; + imgCreateInfo.samples = VK_SAMPLE_COUNT_1_BIT; + + VkImage img = VK_NULL_HANDLE; + VkResult res = vkCreateImage(g_hDevice, &imgCreateInfo, g_Allocs, &img); + assert(res == VK_SUCCESS); + + VkMemoryRequirements memReq = {}; + vkGetImageMemoryRequirements(g_hDevice, img, &memReq); + + vkDestroyImage(g_hDevice, img, g_Allocs); + + return (memReq.memoryTypeBits & allowedMemoryTypeBits) != 0; +} + +static void PrintMemoryConclusions() +{ + wprintf(L"Conclusions:\n"); + + const VkPhysicalDeviceProperties* props = nullptr; + const VkPhysicalDeviceMemoryProperties* memProps = nullptr; + vmaGetPhysicalDeviceProperties(g_hAllocator, &props); + vmaGetMemoryProperties(g_hAllocator, &memProps); + + const uint32_t heapCount = memProps->memoryHeapCount; + + uint32_t deviceLocalHeapCount = 0; + uint32_t hostVisibleHeapCount = 0; + uint32_t deviceLocalAndHostVisibleHeapCount = 0; + VkDeviceSize deviceLocalHeapSumSize = 0; + VkDeviceSize hostVisibleHeapSumSize = 0; + VkDeviceSize deviceLocalAndHostVisibleHeapSumSize = 0; + + for(uint32_t heapIndex = 0; heapIndex < heapCount; ++heapIndex) + { + const VkMemoryHeap& heap = memProps->memoryHeaps[heapIndex]; + const bool isDeviceLocal = (heap.flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) != 0; + bool isHostVisible = false; + for(uint32_t typeIndex = 0; typeIndex < memProps->memoryTypeCount; ++typeIndex) + { + const VkMemoryType& type = memProps->memoryTypes[typeIndex]; + if(type.heapIndex == heapIndex && (type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)) + { + isHostVisible = true; + break; + } + } + if(isDeviceLocal) + { + ++deviceLocalHeapCount; + deviceLocalHeapSumSize += heap.size; + } + if(isHostVisible) + { + ++hostVisibleHeapCount; + hostVisibleHeapSumSize += heap.size; + if(isDeviceLocal) + { + ++deviceLocalAndHostVisibleHeapCount; + deviceLocalAndHostVisibleHeapSumSize += heap.size; + } + } + } + + uint32_t hostVisibleNotHostCoherentTypeCount = 0; + uint32_t notDeviceLocalNotHostVisibleTypeCount = 0; + uint32_t amdSpecificTypeCount = 0; + uint32_t lazilyAllocatedTypeCount = 0; + uint32_t allTypeBits = 0; + uint32_t deviceLocalTypeBits = 0; + for(uint32_t typeIndex = 0; typeIndex < memProps->memoryTypeCount; ++typeIndex) + { + const VkMemoryType& type = memProps->memoryTypes[typeIndex]; + allTypeBits |= 1u << typeIndex; + if(type.propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) + { + deviceLocalTypeBits |= 1u << typeIndex; + } + if((type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) && + (type.propertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) == 0) + { + ++hostVisibleNotHostCoherentTypeCount; + } + if((type.propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) == 0 && + (type.propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0) + { + ++notDeviceLocalNotHostVisibleTypeCount; + } + if(type.propertyFlags & (VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD | VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD)) + { + ++amdSpecificTypeCount; + } + if(type.propertyFlags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) + { + ++lazilyAllocatedTypeCount; + } + } + + assert(deviceLocalHeapCount > 0); + if(deviceLocalHeapCount == heapCount) + wprintf(L"- All heaps are DEVICE_LOCAL.\n"); + else + wprintf(L"- %u heaps are DEVICE_LOCAL, total %s.\n", deviceLocalHeapCount, SizeToStr(deviceLocalHeapSumSize).c_str()); + + assert(hostVisibleHeapCount > 0); + if(hostVisibleHeapCount == heapCount) + wprintf(L"- All heaps are HOST_VISIBLE.\n"); + else + wprintf(L"- %u heaps are HOST_VISIBLE, total %s.\n", deviceLocalHeapCount, SizeToStr(hostVisibleHeapSumSize).c_str()); + + if(deviceLocalHeapCount < heapCount && hostVisibleHeapCount < heapCount) + { + if(deviceLocalAndHostVisibleHeapCount == 0) + wprintf(L"- No heaps are DEVICE_LOCAL and HOST_VISIBLE.\n"); + if(deviceLocalAndHostVisibleHeapCount == heapCount) + wprintf(L"- All heaps are DEVICE_LOCAL and HOST_VISIBLE.\n"); + else + wprintf(L"- %u heaps are DEVICE_LOCAL and HOST_VISIBLE, total %s.\n", deviceLocalAndHostVisibleHeapCount, SizeToStr(deviceLocalAndHostVisibleHeapSumSize).c_str()); + } + + if(hostVisibleNotHostCoherentTypeCount == 0) + wprintf(L"- No types are HOST_VISIBLE but not HOST_COHERENT.\n"); + else + wprintf(L"- %u types are HOST_VISIBLE but not HOST_COHERENT.\n", hostVisibleNotHostCoherentTypeCount); + + if(notDeviceLocalNotHostVisibleTypeCount == 0) + wprintf(L"- No types are not DEVICE_LOCAL and not HOST_VISIBLE.\n"); + else + wprintf(L"- %u types are not DEVICE_LOCAL and not HOST_VISIBLE.\n", notDeviceLocalNotHostVisibleTypeCount); + + if(amdSpecificTypeCount == 0) + wprintf(L"- No types are AMD-specific DEVICE_COHERENT or DEVICE_UNCACHED.\n"); + else + wprintf(L"- %u types are AMD-specific DEVICE_COHERENT or DEVICE_UNCACHED.\n", amdSpecificTypeCount); + + if(lazilyAllocatedTypeCount == 0) + wprintf(L"- No types are LAZILY_ALLOCATED.\n"); + else + wprintf(L"- %u types are LAZILY_ALLOCATED.\n", lazilyAllocatedTypeCount); + + if(props->vendorID == VENDOR_ID_AMD && + props->deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU && + deviceLocalAndHostVisibleHeapSumSize > 256llu * 1024 * 1024) + { + wprintf(L"- AMD Smart Access Memory (SAM) is enabled!\n"); + } + + if(deviceLocalHeapCount < heapCount) + { + const uint32_t nonDeviceLocalTypeBits = ~deviceLocalTypeBits & allTypeBits; + + if(CanCreateVertexBuffer(nonDeviceLocalTypeBits)) + wprintf(L"- A buffer with VERTEX_BUFFER usage can be created in some non-DEVICE_LOCAL type.\n"); + else + wprintf(L"- A buffer with VERTEX_BUFFER usage cannot be created in some non-DEVICE_LOCAL type.\n"); + + if(CanCreateOptimalSampledImage(nonDeviceLocalTypeBits)) + wprintf(L"- An image with OPTIMAL tiling and SAMPLED usage can be created in some non-DEVICE_LOCAL type.\n"); + else + wprintf(L"- An image with OPTIMAL tiling and SAMPLED usage cannot be created in some non-DEVICE_LOCAL type.\n"); + } + + //wprintf(L"\n"); +} + +static void InitializeApplication() +{ + // Create VkSurfaceKHR. + VkWin32SurfaceCreateInfoKHR surfaceInfo = { VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR }; + surfaceInfo.hinstance = g_hAppInstance; + surfaceInfo.hwnd = g_hWnd; + VkResult result = vkCreateWin32SurfaceKHR(g_hVulkanInstance, &surfaceInfo, g_Allocs, &g_hSurface); + assert(result == VK_SUCCESS); + + // Query for device extensions + + uint32_t physicalDeviceExtensionPropertyCount = 0; + ERR_GUARD_VULKAN( vkEnumerateDeviceExtensionProperties(g_hPhysicalDevice, nullptr, &physicalDeviceExtensionPropertyCount, nullptr) ); + std::vector physicalDeviceExtensionProperties{physicalDeviceExtensionPropertyCount}; + if(physicalDeviceExtensionPropertyCount) + { + ERR_GUARD_VULKAN( vkEnumerateDeviceExtensionProperties( + g_hPhysicalDevice, + nullptr, + &physicalDeviceExtensionPropertyCount, + physicalDeviceExtensionProperties.data()) ); + } + + for(uint32_t i = 0; i < physicalDeviceExtensionPropertyCount; ++i) + { + if(strcmp(physicalDeviceExtensionProperties[i].extensionName, VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME) == 0) + { + if(GetVulkanApiVersion() == VK_API_VERSION_1_0) + { + VK_KHR_get_memory_requirements2_enabled = true; + } + } + else if(strcmp(physicalDeviceExtensionProperties[i].extensionName, VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME) == 0) + { + if(GetVulkanApiVersion() == VK_API_VERSION_1_0) + { + VK_KHR_dedicated_allocation_enabled = true; + } + } + else if(strcmp(physicalDeviceExtensionProperties[i].extensionName, VK_KHR_BIND_MEMORY_2_EXTENSION_NAME) == 0) + { + if(GetVulkanApiVersion() == VK_API_VERSION_1_0) + { + VK_KHR_bind_memory2_enabled = true; + } + } + else if(strcmp(physicalDeviceExtensionProperties[i].extensionName, VK_EXT_MEMORY_BUDGET_EXTENSION_NAME) == 0) + VK_EXT_memory_budget_enabled = true; + else if(strcmp(physicalDeviceExtensionProperties[i].extensionName, VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME) == 0) + VK_AMD_device_coherent_memory_enabled = true; + else if(strcmp(physicalDeviceExtensionProperties[i].extensionName, VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME) == 0) + { + if(GetVulkanApiVersion() < VK_API_VERSION_1_2) + { + VK_KHR_buffer_device_address_enabled = true; + } + } + else if(strcmp(physicalDeviceExtensionProperties[i].extensionName, VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME) == 0) + VK_EXT_memory_priority_enabled = true; + else if(strcmp(physicalDeviceExtensionProperties[i].extensionName, VK_KHR_MAINTENANCE_5_EXTENSION_NAME) == 0) + VK_KHR_maintenance5_enabled = true; + } + + if(GetVulkanApiVersion() >= VK_API_VERSION_1_2) + VK_KHR_buffer_device_address_enabled = true; // Promoted to core Vulkan 1.2. + + // Query for features + +#if VMA_VULKAN_VERSION >= 1001000 + VkPhysicalDeviceProperties2 physicalDeviceProperties2 = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 }; + +#if VMA_VULKAN_VERSION >= 1002000 + // Vulkan spec says structure VkPhysicalDeviceVulkan11Properties is "Provided by VK_VERSION_1_2" - is this a mistake? Assuming not... + VkPhysicalDeviceVulkan11Properties physicalDeviceVulkan11Properties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES }; + VkPhysicalDeviceVulkan12Properties physicalDeviceVulkan12Properties = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES }; + PnextChainPushFront(&physicalDeviceProperties2, &physicalDeviceVulkan11Properties); + PnextChainPushFront(&physicalDeviceProperties2, &physicalDeviceVulkan12Properties); +#endif + + vkGetPhysicalDeviceProperties2(g_hPhysicalDevice, &physicalDeviceProperties2); + + PrintPhysicalDeviceProperties(physicalDeviceProperties2.properties); +#if VMA_VULKAN_VERSION >= 1002000 + PrintPhysicalDeviceVulkan11Properties(physicalDeviceVulkan11Properties); + PrintPhysicalDeviceVulkan12Properties(physicalDeviceVulkan12Properties); +#endif + +#else // #if VMA_VULKAN_VERSION >= 1001000 + VkPhysicalDeviceProperties physicalDeviceProperties = {}; + vkGetPhysicalDeviceProperties(g_hPhysicalDevice, &physicalDeviceProperties); + PrintPhysicalDeviceProperties(physicalDeviceProperties); + +#endif // #if VMA_VULKAN_VERSION >= 1001000 + + wprintf(L"\n"); + + VkPhysicalDeviceFeatures2 physicalDeviceFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 }; + + VkPhysicalDeviceCoherentMemoryFeaturesAMD physicalDeviceCoherentMemoryFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD }; + if(VK_AMD_device_coherent_memory_enabled) + { + PnextChainPushFront(&physicalDeviceFeatures, &physicalDeviceCoherentMemoryFeatures); + } + + VkPhysicalDeviceBufferDeviceAddressFeaturesKHR physicalDeviceBufferDeviceAddressFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR }; + if(VK_KHR_buffer_device_address_enabled) + { + PnextChainPushFront(&physicalDeviceFeatures, &physicalDeviceBufferDeviceAddressFeatures); + } + + VkPhysicalDeviceMemoryPriorityFeaturesEXT physicalDeviceMemoryPriorityFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT }; + if(VK_EXT_memory_priority_enabled) + { + PnextChainPushFront(&physicalDeviceFeatures, &physicalDeviceMemoryPriorityFeatures); + } + + vkGetPhysicalDeviceFeatures2(g_hPhysicalDevice, &physicalDeviceFeatures); + + g_SparseBindingEnabled = physicalDeviceFeatures.features.sparseBinding != 0; + + // The extension is supported as fake with no real support for this feature? Don't use it. + if(VK_AMD_device_coherent_memory_enabled && !physicalDeviceCoherentMemoryFeatures.deviceCoherentMemory) + VK_AMD_device_coherent_memory_enabled = false; + if(VK_KHR_buffer_device_address_enabled && !physicalDeviceBufferDeviceAddressFeatures.bufferDeviceAddress) + VK_KHR_buffer_device_address_enabled = false; + if(VK_EXT_memory_priority_enabled && !physicalDeviceMemoryPriorityFeatures.memoryPriority) + VK_EXT_memory_priority_enabled = false; + + // Find queue family index + + uint32_t queueFamilyCount = 0; + vkGetPhysicalDeviceQueueFamilyProperties(g_hPhysicalDevice, &queueFamilyCount, nullptr); + assert(queueFamilyCount > 0); + std::vector queueFamilies(queueFamilyCount); + vkGetPhysicalDeviceQueueFamilyProperties(g_hPhysicalDevice, &queueFamilyCount, queueFamilies.data()); + for(uint32_t i = 0; + (i < queueFamilyCount) && + (g_GraphicsQueueFamilyIndex == UINT_MAX || + g_PresentQueueFamilyIndex == UINT_MAX || + (g_SparseBindingEnabled && g_SparseBindingQueueFamilyIndex == UINT_MAX)); + ++i) + { + if(queueFamilies[i].queueCount > 0) + { + const uint32_t flagsForGraphicsQueue = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT; + if((g_GraphicsQueueFamilyIndex != 0) && + ((queueFamilies[i].queueFlags & flagsForGraphicsQueue) == flagsForGraphicsQueue)) + { + g_GraphicsQueueFamilyIndex = i; + } + + VkBool32 surfaceSupported = 0; + VkResult res = vkGetPhysicalDeviceSurfaceSupportKHR(g_hPhysicalDevice, i, g_hSurface, &surfaceSupported); + if((res >= 0) && (surfaceSupported == VK_TRUE)) + { + g_PresentQueueFamilyIndex = i; + } + + if(g_SparseBindingEnabled && + g_SparseBindingQueueFamilyIndex == UINT32_MAX && + (queueFamilies[i].queueFlags & VK_QUEUE_SPARSE_BINDING_BIT) != 0) + { + g_SparseBindingQueueFamilyIndex = i; + } + } + } + assert(g_GraphicsQueueFamilyIndex != UINT_MAX); + + g_SparseBindingEnabled = g_SparseBindingEnabled && g_SparseBindingQueueFamilyIndex != UINT32_MAX; + + // Create logical device + + const float queuePriority = 1.f; + + VkDeviceQueueCreateInfo queueCreateInfo[3] = {}; + uint32_t queueCount = 1; + queueCreateInfo[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; + queueCreateInfo[0].queueFamilyIndex = g_GraphicsQueueFamilyIndex; + queueCreateInfo[0].queueCount = 1; + queueCreateInfo[0].pQueuePriorities = &queuePriority; + + if(g_PresentQueueFamilyIndex != g_GraphicsQueueFamilyIndex) + { + + queueCreateInfo[queueCount].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; + queueCreateInfo[queueCount].queueFamilyIndex = g_PresentQueueFamilyIndex; + queueCreateInfo[queueCount].queueCount = 1; + queueCreateInfo[queueCount].pQueuePriorities = &queuePriority; + ++queueCount; + } + + if(g_SparseBindingEnabled && + g_SparseBindingQueueFamilyIndex != g_GraphicsQueueFamilyIndex && + g_SparseBindingQueueFamilyIndex != g_PresentQueueFamilyIndex) + { + + queueCreateInfo[queueCount].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; + queueCreateInfo[queueCount].queueFamilyIndex = g_SparseBindingQueueFamilyIndex; + queueCreateInfo[queueCount].queueCount = 1; + queueCreateInfo[queueCount].pQueuePriorities = &queuePriority; + ++queueCount; + } + + std::vector enabledDeviceExtensions; + enabledDeviceExtensions.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME); + if(VK_KHR_get_memory_requirements2_enabled) + enabledDeviceExtensions.push_back(VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME); + if(VK_KHR_dedicated_allocation_enabled) + enabledDeviceExtensions.push_back(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME); + if(VK_KHR_bind_memory2_enabled) + enabledDeviceExtensions.push_back(VK_KHR_BIND_MEMORY_2_EXTENSION_NAME); + if(VK_EXT_memory_budget_enabled) + enabledDeviceExtensions.push_back(VK_EXT_MEMORY_BUDGET_EXTENSION_NAME); + if(VK_AMD_device_coherent_memory_enabled) + enabledDeviceExtensions.push_back(VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME); + if(VK_KHR_buffer_device_address_enabled && GetVulkanApiVersion() < VK_API_VERSION_1_2) + enabledDeviceExtensions.push_back(VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME); + if(VK_EXT_memory_priority_enabled) + enabledDeviceExtensions.push_back(VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME); + if(VK_KHR_maintenance5_enabled) + enabledDeviceExtensions.push_back(VK_KHR_MAINTENANCE_5_EXTENSION_NAME); + + VkPhysicalDeviceFeatures2 deviceFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 }; + deviceFeatures.features.samplerAnisotropy = VK_TRUE; + deviceFeatures.features.sparseBinding = g_SparseBindingEnabled ? VK_TRUE : VK_FALSE; + + if(VK_AMD_device_coherent_memory_enabled) + { + physicalDeviceCoherentMemoryFeatures.deviceCoherentMemory = VK_TRUE; + PnextChainPushBack(&deviceFeatures, &physicalDeviceCoherentMemoryFeatures); + } + if(VK_KHR_buffer_device_address_enabled) + { + physicalDeviceBufferDeviceAddressFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR }; + physicalDeviceBufferDeviceAddressFeatures.bufferDeviceAddress = VK_TRUE; + PnextChainPushBack(&deviceFeatures, &physicalDeviceBufferDeviceAddressFeatures); + } + if(VK_EXT_memory_priority_enabled) + { + PnextChainPushBack(&deviceFeatures, &physicalDeviceMemoryPriorityFeatures); + } + + VkDeviceCreateInfo deviceCreateInfo = { VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO }; + deviceCreateInfo.pNext = &deviceFeatures; + deviceCreateInfo.enabledLayerCount = 0; + deviceCreateInfo.ppEnabledLayerNames = nullptr; + deviceCreateInfo.enabledExtensionCount = (uint32_t)enabledDeviceExtensions.size(); + deviceCreateInfo.ppEnabledExtensionNames = !enabledDeviceExtensions.empty() ? enabledDeviceExtensions.data() : nullptr; + deviceCreateInfo.queueCreateInfoCount = queueCount; + deviceCreateInfo.pQueueCreateInfos = queueCreateInfo; + + ERR_GUARD_VULKAN( vkCreateDevice(g_hPhysicalDevice, &deviceCreateInfo, g_Allocs, &g_hDevice) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_DEVICE, reinterpret_cast(g_hDevice), "g_hDevice"); + // Only now that SetDebugUtilsObjectName is loaded, we can assign a name to g_hVulkanInstance as well + SetDebugUtilsObjectName(VK_OBJECT_TYPE_INSTANCE, reinterpret_cast(g_hVulkanInstance), "g_hVulkanInstance"); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_PHYSICAL_DEVICE, reinterpret_cast(g_hPhysicalDevice), "g_hPhysicalDevice"); + + // Fetch pointers to extension functions + if(VK_KHR_buffer_device_address_enabled) + { + if(GetVulkanApiVersion() >= VK_API_VERSION_1_2) + { + g_vkGetBufferDeviceAddressKHR = (PFN_vkGetBufferDeviceAddressEXT)vkGetDeviceProcAddr(g_hDevice, "vkGetBufferDeviceAddress"); + } + else if(VK_KHR_buffer_device_address_enabled) + { + g_vkGetBufferDeviceAddressKHR = (PFN_vkGetBufferDeviceAddressEXT)vkGetDeviceProcAddr(g_hDevice, "vkGetBufferDeviceAddressKHR"); + } + assert(g_vkGetBufferDeviceAddressKHR != nullptr); + } + + // Create memory allocator + + VmaAllocatorCreateInfo allocatorInfo = {}; + SetAllocatorCreateInfo(allocatorInfo); + ERR_GUARD_VULKAN( vmaCreateAllocator(&allocatorInfo, &g_hAllocator) ); + + PrintMemoryTypes(); + wprintf(L"\n"); + PrintMemoryConclusions(); + wprintf(L"\n"); + PrintEnabledFeatures(); + wprintf(L"\n"); + + // Retrieve queues (don't need to be destroyed). + + vkGetDeviceQueue(g_hDevice, g_GraphicsQueueFamilyIndex, 0, &g_hGraphicsQueue); + vkGetDeviceQueue(g_hDevice, g_PresentQueueFamilyIndex, 0, &g_hPresentQueue); + assert(g_hGraphicsQueue); + assert(g_hPresentQueue); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_QUEUE, reinterpret_cast(g_hGraphicsQueue), "g_hGraphicsQueue"); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_QUEUE, reinterpret_cast(g_hPresentQueue), "g_hPresentQueue"); + + if(g_SparseBindingEnabled) + { + vkGetDeviceQueue(g_hDevice, g_SparseBindingQueueFamilyIndex, 0, &g_hSparseBindingQueue); + assert(g_hSparseBindingQueue); + } + + // Create command pool + + VkCommandPoolCreateInfo commandPoolInfo = { VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO }; + commandPoolInfo.queueFamilyIndex = g_GraphicsQueueFamilyIndex; + commandPoolInfo.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT; + ERR_GUARD_VULKAN( vkCreateCommandPool(g_hDevice, &commandPoolInfo, g_Allocs, &g_hCommandPool) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_COMMAND_POOL, reinterpret_cast(g_hCommandPool), "g_hCommandPool"); + + VkCommandBufferAllocateInfo commandBufferInfo = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO }; + commandBufferInfo.commandPool = g_hCommandPool; + commandBufferInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; + commandBufferInfo.commandBufferCount = COMMAND_BUFFER_COUNT; + ERR_GUARD_VULKAN( vkAllocateCommandBuffers(g_hDevice, &commandBufferInfo, g_MainCommandBuffers) ); + for (size_t i = 0; i < COMMAND_BUFFER_COUNT; i++) { + std::string cmdBufName = "g_MainCommandBuffers[" + std::to_string(i) + "]"; + SetDebugUtilsObjectName(VK_OBJECT_TYPE_COMMAND_BUFFER, reinterpret_cast(g_MainCommandBuffers[i]), cmdBufName); + } + + VkFenceCreateInfo fenceInfo = { VK_STRUCTURE_TYPE_FENCE_CREATE_INFO }; + fenceInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT; + for(size_t i = 0; i < COMMAND_BUFFER_COUNT; ++i) + { + ERR_GUARD_VULKAN( vkCreateFence(g_hDevice, &fenceInfo, g_Allocs, &g_MainCommandBufferExecutedFences[i]) ); + std::string fenceName = "g_MainCommandBufferExecutedFences[" + std::to_string(i) + "]"; + SetDebugUtilsObjectName(VK_OBJECT_TYPE_FENCE, reinterpret_cast(g_MainCommandBufferExecutedFences[i]), fenceName); + } + + ERR_GUARD_VULKAN( vkCreateFence(g_hDevice, &fenceInfo, g_Allocs, &g_ImmediateFence) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_FENCE, reinterpret_cast(g_ImmediateFence), "g_ImmediateFence"); + + commandBufferInfo.commandBufferCount = 1; + ERR_GUARD_VULKAN( vkAllocateCommandBuffers(g_hDevice, &commandBufferInfo, &g_hTemporaryCommandBuffer) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_COMMAND_BUFFER, reinterpret_cast(g_hTemporaryCommandBuffer), "g_hTemporaryCommandBuffer"); + + // Create texture sampler + + VkSamplerCreateInfo samplerInfo = { VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO }; + samplerInfo.magFilter = VK_FILTER_LINEAR; + samplerInfo.minFilter = VK_FILTER_LINEAR; + samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT; + samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT; + samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT; + samplerInfo.anisotropyEnable = VK_TRUE; + samplerInfo.maxAnisotropy = 16; + samplerInfo.borderColor = VK_BORDER_COLOR_INT_OPAQUE_BLACK; + samplerInfo.unnormalizedCoordinates = VK_FALSE; + samplerInfo.compareEnable = VK_FALSE; + samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS; + samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; + samplerInfo.mipLodBias = 0.f; + samplerInfo.minLod = 0.f; + samplerInfo.maxLod = FLT_MAX; + ERR_GUARD_VULKAN( vkCreateSampler(g_hDevice, &samplerInfo, g_Allocs, &g_hSampler) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_SAMPLER, reinterpret_cast(g_hSampler), "g_hSampler"); + + CreateTexture(128, 128); + CreateMesh(); + + VkDescriptorSetLayoutBinding samplerLayoutBinding = {}; + samplerLayoutBinding.binding = 1; + samplerLayoutBinding.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + samplerLayoutBinding.descriptorCount = 1; + samplerLayoutBinding.stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; + + VkDescriptorSetLayoutCreateInfo descriptorSetLayoutInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO }; + descriptorSetLayoutInfo.bindingCount = 1; + descriptorSetLayoutInfo.pBindings = &samplerLayoutBinding; + ERR_GUARD_VULKAN( vkCreateDescriptorSetLayout(g_hDevice, &descriptorSetLayoutInfo, g_Allocs, &g_hDescriptorSetLayout) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, reinterpret_cast(g_hDescriptorSetLayout), "g_hDescriptorSetLayout"); + + // Create descriptor pool + + VkDescriptorPoolSize descriptorPoolSizes[2]; + ZeroMemory(descriptorPoolSizes, sizeof(descriptorPoolSizes)); + descriptorPoolSizes[0].type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; + descriptorPoolSizes[0].descriptorCount = 1; + descriptorPoolSizes[1].type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + descriptorPoolSizes[1].descriptorCount = 1; + + VkDescriptorPoolCreateInfo descriptorPoolInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO }; + descriptorPoolInfo.poolSizeCount = (uint32_t)_countof(descriptorPoolSizes); + descriptorPoolInfo.pPoolSizes = descriptorPoolSizes; + descriptorPoolInfo.maxSets = 1; + ERR_GUARD_VULKAN( vkCreateDescriptorPool(g_hDevice, &descriptorPoolInfo, g_Allocs, &g_hDescriptorPool) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_DESCRIPTOR_POOL, reinterpret_cast(g_hDescriptorPool), "g_hDescriptorPool"); + + // Create descriptor set layout + + VkDescriptorSetLayout descriptorSetLayouts[] = { g_hDescriptorSetLayout }; + VkDescriptorSetAllocateInfo descriptorSetInfo = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO }; + descriptorSetInfo.descriptorPool = g_hDescriptorPool; + descriptorSetInfo.descriptorSetCount = 1; + descriptorSetInfo.pSetLayouts = descriptorSetLayouts; + ERR_GUARD_VULKAN( vkAllocateDescriptorSets(g_hDevice, &descriptorSetInfo, &g_hDescriptorSet) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_DESCRIPTOR_SET, reinterpret_cast(g_hDescriptorSet), "g_hDescriptorSet"); + + VkDescriptorImageInfo descriptorImageInfo = {}; + descriptorImageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + descriptorImageInfo.imageView = g_hTextureImageView; + descriptorImageInfo.sampler = g_hSampler; + + VkWriteDescriptorSet writeDescriptorSet = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET }; + writeDescriptorSet.dstSet = g_hDescriptorSet; + writeDescriptorSet.dstBinding = 1; + writeDescriptorSet.dstArrayElement = 0; + writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + writeDescriptorSet.descriptorCount = 1; + writeDescriptorSet.pImageInfo = &descriptorImageInfo; + + vkUpdateDescriptorSets(g_hDevice, 1, &writeDescriptorSet, 0, nullptr); + + CreateSwapchain(); +} + +static void FinalizeApplication() +{ + vkDeviceWaitIdle(g_hDevice); + + DestroySwapchain(true); + + if(g_hDescriptorPool != VK_NULL_HANDLE) + { + vkDestroyDescriptorPool(g_hDevice, g_hDescriptorPool, g_Allocs); + g_hDescriptorPool = VK_NULL_HANDLE; + } + + if(g_hDescriptorSetLayout != VK_NULL_HANDLE) + { + vkDestroyDescriptorSetLayout(g_hDevice, g_hDescriptorSetLayout, g_Allocs); + g_hDescriptorSetLayout = VK_NULL_HANDLE; + } + + if(g_hTextureImageView != VK_NULL_HANDLE) + { + vkDestroyImageView(g_hDevice, g_hTextureImageView, g_Allocs); + g_hTextureImageView = VK_NULL_HANDLE; + } + if(g_hTextureImage != VK_NULL_HANDLE) + { + vmaDestroyImage(g_hAllocator, g_hTextureImage, g_hTextureImageAlloc); + g_hTextureImage = VK_NULL_HANDLE; + } + + if(g_hIndexBuffer != VK_NULL_HANDLE) + { + vmaDestroyBuffer(g_hAllocator, g_hIndexBuffer, g_hIndexBufferAlloc); + g_hIndexBuffer = VK_NULL_HANDLE; + } + if(g_hVertexBuffer != VK_NULL_HANDLE) + { + vmaDestroyBuffer(g_hAllocator, g_hVertexBuffer, g_hVertexBufferAlloc); + g_hVertexBuffer = VK_NULL_HANDLE; + } + + if(g_hSampler != VK_NULL_HANDLE) + { + vkDestroySampler(g_hDevice, g_hSampler, g_Allocs); + g_hSampler = VK_NULL_HANDLE; + } + + if(g_ImmediateFence) + { + vkDestroyFence(g_hDevice, g_ImmediateFence, g_Allocs); + g_ImmediateFence = VK_NULL_HANDLE; + } + + for(size_t i = COMMAND_BUFFER_COUNT; i--; ) + { + if(g_MainCommandBufferExecutedFences[i] != VK_NULL_HANDLE) + { + vkDestroyFence(g_hDevice, g_MainCommandBufferExecutedFences[i], g_Allocs); + g_MainCommandBufferExecutedFences[i] = VK_NULL_HANDLE; + } + } + if(g_MainCommandBuffers[0] != VK_NULL_HANDLE) + { + vkFreeCommandBuffers(g_hDevice, g_hCommandPool, COMMAND_BUFFER_COUNT, g_MainCommandBuffers); + ZeroMemory(g_MainCommandBuffers, sizeof(g_MainCommandBuffers)); + } + if(g_hTemporaryCommandBuffer != VK_NULL_HANDLE) + { + vkFreeCommandBuffers(g_hDevice, g_hCommandPool, 1, &g_hTemporaryCommandBuffer); + g_hTemporaryCommandBuffer = VK_NULL_HANDLE; + } + + if(g_hCommandPool != VK_NULL_HANDLE) + { + vkDestroyCommandPool(g_hDevice, g_hCommandPool, g_Allocs); + g_hCommandPool = VK_NULL_HANDLE; + } + + if(g_hAllocator != VK_NULL_HANDLE) + { + vmaDestroyAllocator(g_hAllocator); + g_hAllocator = nullptr; + } + + if(g_hDevice != VK_NULL_HANDLE) + { + vkDestroyDevice(g_hDevice, g_Allocs); + g_hDevice = nullptr; + } + + if(g_hSurface != VK_NULL_HANDLE) + { + vkDestroySurfaceKHR(g_hVulkanInstance, g_hSurface, g_Allocs); + g_hSurface = VK_NULL_HANDLE; + } +} + +static void PrintAllocatorStats() +{ +#if VMA_STATS_STRING_ENABLED + char* statsString = nullptr; + vmaBuildStatsString(g_hAllocator, &statsString, true); + printf("%s\n", statsString); + vmaFreeStatsString(g_hAllocator, statsString); +#endif +} + +static void RecreateSwapChain() +{ + vkDeviceWaitIdle(g_hDevice); + DestroySwapchain(false); + CreateSwapchain(); +} + +static void DrawFrame() +{ + // Begin main command buffer + size_t cmdBufIndex = (g_NextCommandBufferIndex++) % COMMAND_BUFFER_COUNT; + VkCommandBuffer hCommandBuffer = g_MainCommandBuffers[cmdBufIndex]; + VkFence hCommandBufferExecutedFence = g_MainCommandBufferExecutedFences[cmdBufIndex]; + + ERR_GUARD_VULKAN( vkWaitForFences(g_hDevice, 1, &hCommandBufferExecutedFence, VK_TRUE, UINT64_MAX) ); + ERR_GUARD_VULKAN( vkResetFences(g_hDevice, 1, &hCommandBufferExecutedFence) ); + + VkCommandBufferBeginInfo commandBufferBeginInfo = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO }; + commandBufferBeginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; + ERR_GUARD_VULKAN( vkBeginCommandBuffer(hCommandBuffer, &commandBufferBeginInfo) ); + SetDebugUtilsObjectName(VK_OBJECT_TYPE_COMMAND_BUFFER, reinterpret_cast(hCommandBuffer), "hCommandBuffer"); + + // Acquire swapchain image + uint32_t imageIndex = 0; + VkResult res = vkAcquireNextImageKHR(g_hDevice, g_hSwapchain, UINT64_MAX, g_hImageAvailableSemaphores.at(g_SwapchainImageIndex), VK_NULL_HANDLE, &imageIndex); + if(res == VK_ERROR_OUT_OF_DATE_KHR) + { + RecreateSwapChain(); + return; + } + else if(res < 0) + { + ERR_GUARD_VULKAN(res); + } + + // Record geometry pass + + VkClearValue clearValues[2]; + ZeroMemory(clearValues, sizeof(clearValues)); + clearValues[0].color.float32[0] = 0.25f; + clearValues[0].color.float32[1] = 0.25f; + clearValues[0].color.float32[2] = 0.5f; + clearValues[0].color.float32[3] = 1.0f; + clearValues[1].depthStencil.depth = 1.0f; + + VkRenderPassBeginInfo renderPassBeginInfo = { VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO }; + renderPassBeginInfo.renderPass = g_hRenderPass; + renderPassBeginInfo.framebuffer = g_Framebuffers[imageIndex]; + renderPassBeginInfo.renderArea.offset.x = 0; + renderPassBeginInfo.renderArea.offset.y = 0; + renderPassBeginInfo.renderArea.extent = g_Extent; + renderPassBeginInfo.clearValueCount = (uint32_t)_countof(clearValues); + renderPassBeginInfo.pClearValues = clearValues; + vkCmdBeginRenderPass(hCommandBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); + + vkCmdBindPipeline( + hCommandBuffer, + VK_PIPELINE_BIND_POINT_GRAPHICS, + g_hPipeline); + + mat4 view = mat4::LookAt( + vec3(0.f, 0.f, 0.f), + vec3(0.f, -2.f, 4.f), + vec3(0.f, 1.f, 0.f)); + mat4 proj = mat4::Perspective( + 1.0471975511966f, // 60 degrees + (float)g_Extent.width / (float)g_Extent.height, + 0.1f, + 1000.f); + mat4 viewProj = view * proj; + + vkCmdBindDescriptorSets( + hCommandBuffer, + VK_PIPELINE_BIND_POINT_GRAPHICS, + g_hPipelineLayout, + 0, + 1, + &g_hDescriptorSet, + 0, + nullptr); + + float rotationAngle = (float)GetTickCount() * 0.001f * (float)PI * 0.2f; + mat4 model = mat4::RotationY(rotationAngle); + + UniformBufferObject ubo = {}; + ubo.ModelViewProj = model * viewProj; + vkCmdPushConstants(hCommandBuffer, g_hPipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(UniformBufferObject), &ubo); + + VkBuffer vertexBuffers[] = { g_hVertexBuffer }; + VkDeviceSize offsets[] = { 0 }; + vkCmdBindVertexBuffers(hCommandBuffer, 0, 1, vertexBuffers, offsets); + + vkCmdBindIndexBuffer(hCommandBuffer, g_hIndexBuffer, 0, VK_INDEX_TYPE_UINT16); + + vkCmdDrawIndexed(hCommandBuffer, g_IndexCount, 1, 0, 0, 0); + + vkCmdEndRenderPass(hCommandBuffer); + + vkEndCommandBuffer(hCommandBuffer); + + // Submit command buffer + + VkSemaphore submitWaitSemaphores[] = { g_hImageAvailableSemaphores.at(g_SwapchainImageIndex)}; + VkPipelineStageFlags submitWaitStages[] = { VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT }; + VkSemaphore submitSignalSemaphores[] = { g_hRenderFinishedSemaphores.at(g_SwapchainImageIndex)}; + VkSubmitInfo submitInfo = { VK_STRUCTURE_TYPE_SUBMIT_INFO }; + submitInfo.waitSemaphoreCount = 1; + submitInfo.pWaitSemaphores = submitWaitSemaphores; + submitInfo.pWaitDstStageMask = submitWaitStages; + submitInfo.commandBufferCount = 1; + submitInfo.pCommandBuffers = &hCommandBuffer; + submitInfo.signalSemaphoreCount = _countof(submitSignalSemaphores); + submitInfo.pSignalSemaphores = submitSignalSemaphores; + ERR_GUARD_VULKAN( vkQueueSubmit(g_hGraphicsQueue, 1, &submitInfo, hCommandBufferExecutedFence) ); + + VkSemaphore presentWaitSemaphores[] = { g_hRenderFinishedSemaphores.at(g_SwapchainImageIndex) }; + + VkSwapchainKHR swapchains[] = { g_hSwapchain }; + VkPresentInfoKHR presentInfo = { VK_STRUCTURE_TYPE_PRESENT_INFO_KHR }; + presentInfo.waitSemaphoreCount = _countof(presentWaitSemaphores); + presentInfo.pWaitSemaphores = presentWaitSemaphores; + presentInfo.swapchainCount = 1; + presentInfo.pSwapchains = swapchains; + presentInfo.pImageIndices = &imageIndex; + presentInfo.pResults = nullptr; + res = vkQueuePresentKHR(g_hPresentQueue, &presentInfo); + if(res == VK_ERROR_OUT_OF_DATE_KHR) + { + RecreateSwapChain(); + } + else + ERR_GUARD_VULKAN(res); + + g_SwapchainImageIndex++; + if (g_SwapchainImageIndex >= g_SwapchainImageCount) { + g_SwapchainImageIndex = 0; + } +} + +static void HandlePossibleSizeChange() +{ + RECT clientRect; + GetClientRect(g_hWnd, &clientRect); + LONG newSizeX = clientRect.right - clientRect.left; + LONG newSizeY = clientRect.bottom - clientRect.top; + if((newSizeX > 0) && + (newSizeY > 0) && + ((newSizeX != g_SizeX) || (newSizeY != g_SizeY))) + { + g_SizeX = newSizeX; + g_SizeY = newSizeY; + + RecreateSwapChain(); + } +} + +#define CATCH_PRINT_ERROR(extraCatchCode) \ + catch(const std::exception& ex) \ + { \ + fwprintf(stderr, L"ERROR: %hs\n", ex.what()); \ + extraCatchCode \ + } \ + catch(...) \ + { \ + fwprintf(stderr, L"UNKNOWN ERROR.\n"); \ + extraCatchCode \ + } + +static LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_DESTROY: + try + { + FinalizeApplication(); + } + CATCH_PRINT_ERROR(;) + PostQuitMessage(0); + return 0; + + // This prevents app from freezing when left Alt is pressed + // (which normally enters modal menu loop). + case WM_SYSKEYDOWN: + case WM_SYSKEYUP: + return 0; + + case WM_SIZE: + if((wParam == SIZE_MAXIMIZED) || (wParam == SIZE_RESTORED)) + { + try + { + HandlePossibleSizeChange(); + } + CATCH_PRINT_ERROR(DestroyWindow(hWnd);) + } + return 0; + + case WM_EXITSIZEMOVE: + try + { + HandlePossibleSizeChange(); + } + CATCH_PRINT_ERROR(DestroyWindow(hWnd);) + return 0; + + case WM_KEYDOWN: + switch(wParam) + { + case VK_ESCAPE: + PostMessage(hWnd, WM_CLOSE, 0, 0); + break; + case 'T': + try + { + Test(); + } + CATCH_PRINT_ERROR(;) + break; + case 'S': + if (g_SparseBindingEnabled) + { + try + { + TestSparseBinding(); + } + CATCH_PRINT_ERROR(;) + } + else + { + printf("Sparse binding not supported.\n"); + } + break; + } + return 0; + + default: + break; + } + + return DefWindowProc(hWnd, msg, wParam, lParam); +} + +static void PrintLogo() +{ + wprintf(L"%s\n", APP_TITLE_W); +} + +static void PrintHelp() +{ + wprintf( + L"Command line syntax:\n" + L"-h, --Help Print this information\n" + L"-l, --List Print list of GPUs\n" + L"-g S, --GPU S Select GPU with name containing S\n" + L"-i N, --GPUIndex N Select GPU index N\n" + L"-t, --Test Run tests and exit\n" + L"-s, --TestSparseBinding Run sparese binding tests and exit\n" + ); +} + +int MainWindow() +{ + WNDCLASSEX wndClassDesc = { sizeof(WNDCLASSEX) }; + wndClassDesc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS; + wndClassDesc.hbrBackground = NULL; + wndClassDesc.hCursor = LoadCursor(NULL, IDC_CROSS); + wndClassDesc.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wndClassDesc.hInstance = g_hAppInstance; + wndClassDesc.lpfnWndProc = WndProc; + wndClassDesc.lpszClassName = WINDOW_CLASS_NAME; + + const ATOM hWndClass = RegisterClassEx(&wndClassDesc); + assert(hWndClass); + + const DWORD style = WS_VISIBLE | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME; + const DWORD exStyle = 0; + + RECT rect = { 0, 0, g_SizeX, g_SizeY }; + AdjustWindowRectEx(&rect, style, FALSE, exStyle); + + g_hWnd = CreateWindowEx( + exStyle, WINDOW_CLASS_NAME, APP_TITLE_W, style, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + NULL, NULL, g_hAppInstance, NULL); + assert(g_hWnd); + + InitializeApplication(); + //PrintAllocatorStats(); + + // Run tests and close program + if(g_CommandLineParameters.m_Test) + Test(); + if(g_CommandLineParameters.m_TestSparseBinding) + { + if(g_SparseBindingEnabled) + TestSparseBinding(); + else + printf("Sparse binding not supported.\n"); + } + if(g_CommandLineParameters.m_Test || g_CommandLineParameters.m_TestSparseBinding) + PostMessage(g_hWnd, WM_CLOSE, 0, 0); + + MSG msg; + for(;;) + { + if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + if(msg.message == WM_QUIT) + break; + TranslateMessage(&msg); + DispatchMessage(&msg); + } + else + { + DrawFrame(); + } + } + + return (int)msg.wParam;; +} + +int Main2(int argc, wchar_t** argv) +{ + PrintLogo(); + + if(!g_CommandLineParameters.Parse(argc, argv)) + { + wprintf(L"ERROR: Invalid command line syntax.\n"); + PrintHelp(); + return (int)ExitCode::CommandLineError; + } + + if(g_CommandLineParameters.m_Help) + { + PrintHelp(); + return (int)ExitCode::Help; + } + + VulkanUsage vulkanUsage; + vulkanUsage.Init(); + + if(g_CommandLineParameters.m_List) + { + vulkanUsage.PrintPhysicalDeviceList(); + return (int)ExitCode::GPUList; + } + + g_hPhysicalDevice = vulkanUsage.SelectPhysicalDevice(g_CommandLineParameters.m_GPUSelection); + TEST(g_hPhysicalDevice); + + return MainWindow(); +} + +int wmain(int argc, wchar_t** argv) +{ + int result = 0; + try + { + result = Main2(argc, argv); + TEST(g_CpuAllocCount.load() == 0); + } + CATCH_PRINT_ERROR(return (int)ExitCode::RuntimeError;) + return result; +} + +#else // #ifdef _WIN32 + +#include "VmaUsage.h" + +int main() +{ +} + +#endif // #ifdef _WIN32 diff --git a/deps/VulkanMemoryAllocator/src/cmake/Config.cmake.in b/deps/VulkanMemoryAllocator/src/cmake/Config.cmake.in deleted file mode 100644 index a7d7543..0000000 --- a/deps/VulkanMemoryAllocator/src/cmake/Config.cmake.in +++ /dev/null @@ -1,10 +0,0 @@ -@PACKAGE_INIT@ - -include(CMakeFindDependencyMacro) - -find_package(Vulkan REQUIRED) - -include("${CMAKE_CURRENT_LIST_DIR}/VulkanMemoryAllocatorTargets.cmake") -check_required_components("@PROJECT_NAME@") - - diff --git a/deps/VulkanMemoryAllocator/src/cmake/install_target.cmake b/deps/VulkanMemoryAllocator/src/cmake/install_target.cmake deleted file mode 100644 index 6ddd455..0000000 --- a/deps/VulkanMemoryAllocator/src/cmake/install_target.cmake +++ /dev/null @@ -1,32 +0,0 @@ -include(GNUInstallDirs) -target_include_directories(VulkanMemoryAllocator PUBLIC - $ -) -install(TARGETS VulkanMemoryAllocator - EXPORT VulkanMemoryAllocatorTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) -# install(FILES "${PROJECT_SOURCE_DIR}/include/vk_mem_alloc.h" DESTINATION "include") -install(FILES "${PROJECT_SOURCE_DIR}/include/vk_mem_alloc.h" - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} -) -install(EXPORT VulkanMemoryAllocatorTargets - FILE VulkanMemoryAllocatorTargets.cmake - NAMESPACE VulkanMemoryAllocator:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VulkanMemoryAllocator -) -include(CMakePackageConfigHelpers) -configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in - "${CMAKE_CURRENT_BINARY_DIR}/VulkanMemoryAllocatorConfig.cmake" - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VulkanMemoryAllocator -) -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/VulkanMemoryAllocatorConfig.cmake" - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VulkanMemoryAllocator -) - - - diff --git a/deps/volk copy/.github/workflows/build.yml b/deps/volk copy/.github/workflows/build.yml new file mode 100644 index 0000000..45dbc78 --- /dev/null +++ b/deps/volk copy/.github/workflows/build.yml @@ -0,0 +1,66 @@ +name: build + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + os: [ubuntu, macos, windows] + name: ${{matrix.os}} + runs-on: ${{matrix.os}}-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: KhronosGroup/Vulkan-Headers + ref: main + path: Vulkan-Headers + fetch-depth: 0 + fetch-tags: true + - name: move sdk + shell: bash + run: | + mv Vulkan-Headers ~/Vulkan-Headers + - name: build main + shell: bash + run: | + export VULKAN_SDK=~/Vulkan-Headers + git -C ~/Vulkan-Headers checkout main + test/run_tests.sh + - name: build 1.1.101 + shell: bash + run: | + export VULKAN_SDK=~/Vulkan-Headers + git -C ~/Vulkan-Headers checkout sdk-1.1.101 + test/run_tests.sh + - name: build 1.2.131 + shell: bash + run: | + export VULKAN_SDK=~/Vulkan-Headers + git -C ~/Vulkan-Headers checkout sdk-1.2.131 + test/run_tests.sh + - name: build 1.2.182 + shell: bash + run: | + export VULKAN_SDK=~/Vulkan-Headers + git -C ~/Vulkan-Headers checkout sdk-1.2.182 + test/run_tests.sh + - name: build 1.3.204 + shell: bash + run: | + export VULKAN_SDK=~/Vulkan-Headers + git -C ~/Vulkan-Headers checkout sdk-1.3.204 + test/run_tests.sh + - name: build 1.3.239 + shell: bash + run: | + export VULKAN_SDK=~/Vulkan-Headers + git -C ~/Vulkan-Headers checkout sdk-1.3.239 + test/run_tests.sh + - name: build 1.3.268 + shell: bash + run: | + export VULKAN_SDK=~/Vulkan-Headers + git -C ~/Vulkan-Headers checkout vulkan-sdk-1.3.268 + test/run_tests.sh diff --git a/deps/volk copy/.github/workflows/update.yml b/deps/volk copy/.github/workflows/update.yml new file mode 100644 index 0000000..1db7d45 --- /dev/null +++ b/deps/volk copy/.github/workflows/update.yml @@ -0,0 +1,33 @@ +name: update + +on: + schedule: + - cron: '0 16 * * *' + workflow_dispatch: + +jobs: + update: + if: github.repository == 'zeux/volk' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + - name: update + run: | + python3 generate.py >version.txt + echo "VOLK_VERSION=`cat version.txt`" >> $GITHUB_ENV + rm version.txt + - name: create pr + uses: peter-evans/create-pull-request@v6 + with: + branch: update/${{env.VOLK_VERSION}} + delete-branch: true + commit-message: Update to 1.3.${{env.VOLK_VERSION}} + title: Update to 1.3.${{env.VOLK_VERSION}} + author: GitHub + - name: enable pr automerge + run: gh pr merge --merge --auto ${{env.PULL_REQUEST_NUMBER}} + env: + GH_TOKEN: ${{ github.token }} + continue-on-error: true diff --git a/deps/volk copy/.gitignore b/deps/volk copy/.gitignore new file mode 100644 index 0000000..0ff047c --- /dev/null +++ b/deps/volk copy/.gitignore @@ -0,0 +1,2 @@ +build/ +CMakeLists.txt.user diff --git a/deps/volk copy/CMakeLists.txt b/deps/volk copy/CMakeLists.txt new file mode 100644 index 0000000..667c4e6 --- /dev/null +++ b/deps/volk copy/CMakeLists.txt @@ -0,0 +1,137 @@ +cmake_minimum_required(VERSION 3.5) +cmake_policy(PUSH) +cmake_policy(SET CMP0048 NEW) # project(... VERSION ...) support + +project(volk VERSION +# VOLK_GENERATE_VERSION +293 +# VOLK_GENERATE_VERSION + LANGUAGES C +) + +# CMake 3.12 changes the default behaviour of option() to leave local variables +# unchanged if they exist (which we want), but we must work with older CMake versions. +if(NOT DEFINED VOLK_STATIC_DEFINES) + set(VOLK_STATIC_DEFINES "" CACHE STRING "Additional defines for building the volk static library, e.g. Vulkan platform defines") +endif() +if(NOT DEFINED VOLK_PULL_IN_VULKAN) + option(VOLK_PULL_IN_VULKAN "Vulkan as a transitive dependency" ON) +endif() +if(NOT DEFINED VOLK_INSTALL) + option(VOLK_INSTALL "Create installation targets" OFF) +endif() +if(NOT DEFINED VOLK_HEADERS_ONLY) + option(VOLK_HEADERS_ONLY "Add interface library only" OFF) +endif() +if(NOT DEFINED VULKAN_HEADERS_INSTALL_DIR) + set(VULKAN_HEADERS_INSTALL_DIR "" CACHE PATH "Where to get the Vulkan headers") +endif() + +# ----------------------------------------------------- +# Static library + +if(NOT VOLK_HEADERS_ONLY OR VOLK_INSTALL) + add_library(volk STATIC volk.h volk.c) + add_library(volk::volk ALIAS volk) + target_include_directories(volk PUBLIC + $ + $ + ) + if(VOLK_STATIC_DEFINES) + target_compile_definitions(volk PUBLIC ${VOLK_STATIC_DEFINES}) + endif() + if (NOT WIN32) + target_link_libraries(volk PUBLIC ${CMAKE_DL_LIBS}) + endif() +endif() + +# ----------------------------------------------------- +# Interface library + +add_library(volk_headers INTERFACE) +add_library(volk::volk_headers ALIAS volk_headers) +target_include_directories(volk_headers INTERFACE + $ + $ +) +if (NOT WIN32) + target_link_libraries(volk_headers INTERFACE ${CMAKE_DL_LIBS}) +endif() + +# ----------------------------------------------------- +# Vulkan transitive dependency + +if(VOLK_PULL_IN_VULKAN) + # If CMake has the FindVulkan module and it works, use it. + find_package(Vulkan QUIET) + + # Try an explicit CMake variable first, then any Vulkan paths + # discovered by FindVulkan.cmake, then the $VULKAN_SDK environment + # variable if nothing else works. + if(VULKAN_HEADERS_INSTALL_DIR) + message("volk: using VULKAN_HEADERS_INSTALL_DIR option") + set(VOLK_INCLUDES "${VULKAN_HEADERS_INSTALL_DIR}/include") + elseif(Vulkan_INCLUDE_DIRS) + message("volk: using Vulkan_INCLUDE_DIRS from FindVulkan module") + set(VOLK_INCLUDES "${Vulkan_INCLUDE_DIRS}") + elseif(DEFINED ENV{VULKAN_SDK}) + message("volk: using VULKAN_SDK environment variable") + set(VOLK_INCLUDES "$ENV{VULKAN_SDK}/include") + endif() + + if(VOLK_INCLUDES) + if(TARGET volk) + target_include_directories(volk PUBLIC "${VOLK_INCLUDES}") + endif() + target_include_directories(volk_headers INTERFACE "${VOLK_INCLUDES}") + endif() +endif() + +# ----------------------------------------------------- +# Installation + +if(VOLK_INSTALL) + + include(GNUInstallDirs) + set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/volk) + + # Install files + install(FILES volk.h volk.c DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + # Install library target and add it and any dependencies to export set. + install(TARGETS volk volk_headers + EXPORT volk-targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + + # Actually write exported config w/ imported targets + install(EXPORT volk-targets + FILE volkTargets.cmake + NAMESPACE volk:: + DESTINATION ${INSTALL_CONFIGDIR} + ) + + # Create a ConfigVersion.cmake file: + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/volkConfigVersion.cmake + COMPATIBILITY AnyNewerVersion + ) + + # Configure config file + configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/cmake/volkConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/volkConfig.cmake + INSTALL_DESTINATION ${INSTALL_CONFIGDIR} + ) + + # Install the fully generated config and configVersion files + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/volkConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/volkConfigVersion.cmake + DESTINATION ${INSTALL_CONFIGDIR} + ) + +endif() +cmake_policy(POP) diff --git a/deps/volk copy/LICENSE.md b/deps/volk copy/LICENSE.md new file mode 100644 index 0000000..5a717f2 --- /dev/null +++ b/deps/volk copy/LICENSE.md @@ -0,0 +1,19 @@ +Copyright (c) 2018-2024 Arseny Kapoulkine + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/volk copy/README.md b/deps/volk copy/README.md new file mode 100644 index 0000000..8d5ff0b --- /dev/null +++ b/deps/volk copy/README.md @@ -0,0 +1,99 @@ +# 🐺 volk [![Build Status](https://github.com/zeux/volk/workflows/build/badge.svg)](https://github.com/zeux/volk/actions) + +## Purpose + +volk is a meta-loader for Vulkan. It allows you to dynamically load entrypoints required to use Vulkan +without linking to vulkan-1.dll or statically linking Vulkan loader. Additionally, volk simplifies the use of Vulkan extensions by automatically loading all associated entrypoints. Finally, volk enables loading +Vulkan entrypoints directly from the driver which can increase performance by skipping loader dispatch overhead. + +volk is written in C89 and supports Windows, Linux, Android and macOS (via MoltenVK). + +## Building + +There are multiple ways to use volk in your project: + +1. You can add `volk.c` to your build system. Note that the usual preprocessor defines that enable Vulkan's platform-specific functions (VK_USE_PLATFORM_WIN32_KHR, VK_USE_PLATFORM_XLIB_KHR, VK_USE_PLATFORM_MACOS_MVK, etc) must be passed as desired to the compiler when building `volk.c`. +2. You can use provided CMake files, with the usage detailed below. +3. You can use volk in header-only fashion. Include `volk.h` wherever you want to use Vulkan functions. In exactly one source file, define `VOLK_IMPLEMENTATION` before including `volk.h`. Do not build `volk.c` at all in this case - however, `volk.c` must still be in the same directory as `volk.h`. This method of integrating volk makes it possible to set the platform defines mentioned above with arbitrary (preprocessor) logic in your code. + +## Basic usage + +To use volk, you have to include `volk.h` instead of `vulkan/vulkan.h`; this is necessary to use function definitions from volk. + +If some files in your application include `vulkan/vulkan.h` and don't include `volk.h`, this can result in symbol conflicts; consider defining `VK_NO_PROTOTYPES` when compiling code that uses Vulkan to make sure this doesn't happen. It's also important to make sure that `vulkan-1` is not linked into the application, as this results in symbol name conflicts as well. + +To initialize volk, call this function first: + +```c++ +VkResult volkInitialize(); +``` + +This will attempt to load Vulkan loader from the system; if this function returns `VK_SUCCESS` you can proceed to create Vulkan instance. +If this function fails, this means Vulkan loader isn't installed on your system. + +After creating the Vulkan instance using Vulkan API, call this function: + +```c++ +void volkLoadInstance(VkInstance instance); +``` + +This function will load all required Vulkan entrypoints, including all extensions; you can use Vulkan from here on as usual. + +## Optimizing device calls + +If you use volk as described in the previous section, all device-related function calls, such as `vkCmdDraw`, will go through Vulkan loader dispatch code. +This allows you to transparently support multiple VkDevice objects in the same application, but comes at a price of dispatch overhead which can be as high as 7% depending on the driver and application. + +To avoid this, you have two options: + +1. For applications that use just one VkDevice object, load device-related Vulkan entrypoints directly from the driver with this function: + +```c++ +void volkLoadDevice(VkDevice device); +``` + +2. For applications that use multiple VkDevice objects, load device-related Vulkan entrypoints into a table: + +```c++ +void volkLoadDeviceTable(struct VolkDeviceTable* table, VkDevice device); +``` + +The second option requires you to change the application code to store one `VolkDeviceTable` per `VkDevice` and call functions from this table instead. + +Device entrypoints are loaded using `vkGetDeviceProcAddr`; when no layers are present, this commonly results in most function pointers pointing directly at the driver functions, minimizing the call overhead. When layers are loaded, the entrypoints will point at the implementations in the first applicable layer, so this is compatible with any layers including validation layers. + +Since `volkLoadDevice` overwrites some function pointers with device-specific versions, you can choose to use `volkLoadInstanceOnly` instead of `volkLoadInstance`; when using table-based interface this can also help enforce the usage of the function tables as `volkLoadInstanceOnly` will leave device-specific functions as `NULL`. + +## CMake support + +If your project uses CMake, volk provides you with targets corresponding to the different use cases: + +1. Target `volk` is a static library. Any platform defines can be passed to the compiler by setting `VOLK_STATIC_DEFINES`. Example: +```cmake +if (WIN32) + set(VOLK_STATIC_DEFINES VK_USE_PLATFORM_WIN32_KHR) +elseif() + ... +endif() +add_subdirectory(volk) +target_link_library(my_application PRIVATE volk) +``` +2. Target `volk_headers` is an interface target for the header-only style. Example: +```cmake +add_subdirectory(volk) +target_link_library(my_application PRIVATE volk_headers) +``` +and in the code: +```c +/* ...any logic setting VK_USE_PLATFORM_WIN32_KHR and friends... */ +#define VOLK_IMPLEMENTATION +#include "volk.h" +``` + +The above example use `add_subdirectory` to include volk into CMake's build tree. This is a good choice if you copy the volk files into your project tree or as a git submodule. + +Volk also supports installation and config-file packages. Installation is disabled by default (so as to not pollute user projects with install rules), and can be enabled by passing `-DVOLK_INSTALL=ON` to CMake. Once installed, do something like `find_package(volk CONFIG REQUIRED)` in your project's CMakeLists.txt. The imported volk targets are called `volk::volk` and `volk::volk_headers`. + +## License + +This library is available to anybody free of charge, under the terms of MIT License (see LICENSE.md). diff --git a/deps/volk copy/cmake/volkConfig.cmake.in b/deps/volk copy/cmake/volkConfig.cmake.in new file mode 100644 index 0000000..6e45c37 --- /dev/null +++ b/deps/volk copy/cmake/volkConfig.cmake.in @@ -0,0 +1,21 @@ +get_filename_component(volk_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +if(NOT TARGET volk::volk) + include("${volk_CMAKE_DIR}/volkTargets.cmake") +endif() + +# Mirror the default behaviour of the respective option. +if(NOT DEFINED VOLK_PULL_IN_VULKAN) + set(VOLK_PULL_IN_VULKAN ON) +endif() + +if(VOLK_PULL_IN_VULKAN) + find_package(Vulkan QUIET) + if(TARGET Vulkan::Vulkan) + add_dependencies(volk::volk Vulkan::Vulkan) + add_dependencies(volk::volk_headers Vulkan::Vulkan) + elseif(DEFINED ENV{VULKAN_SDK}) + target_include_directories(volk::volk INTERFACE "$ENV{VULKAN_SDK}/include") + target_include_directories(volk::volk_headers INTERFACE "$ENV{VULKAN_SDK}/include") + endif() +endif() diff --git a/deps/volk copy/generate.py b/deps/volk copy/generate.py new file mode 100644 index 0000000..acff128 --- /dev/null +++ b/deps/volk copy/generate.py @@ -0,0 +1,194 @@ +#!/usr/bin/python3 +# This file is part of volk library; see volk.h for version/license details + +from collections import OrderedDict +import re +import sys +import urllib +import xml.etree.ElementTree as etree +import urllib.request + +cmdversions = { + "vkCmdSetDiscardRectangleEnableEXT": 2, + "vkCmdSetDiscardRectangleModeEXT": 2, + "vkCmdSetExclusiveScissorEnableNV": 2 +} + +def parse_xml(path): + file = urllib.request.urlopen(path) if path.startswith("http") else open(path, 'r') + with file: + tree = etree.parse(file) + return tree + +def patch_file(path, blocks): + result = [] + block = None + + with open(path, 'r') as file: + for line in file.readlines(): + if block: + if line == block: + result.append(line) + block = None + else: + result.append(line) + # C comment marker + if line.strip().startswith('/* VOLK_GENERATE_'): + block = line + result.append(blocks[line.strip()[17:-3]]) + # Shell/CMake comment marker + elif line.strip().startswith('# VOLK_GENERATE_'): + block = line + result.append(blocks[line.strip()[16:]]) + + with open(path, 'w', newline='\n') as file: + for line in result: + file.write(line) + +def is_descendant_type(types, name, base): + if name == base: + return True + type = types.get(name) + if not type: + return False + parents = type.get('parent') + if not parents: + return False + return any([is_descendant_type(types, parent, base) for parent in parents.split(',')]) + +def defined(key): + return 'defined(' + key + ')' + +def cdepends(key): + return re.sub(r'[a-zA-Z0-9_]+', lambda m: defined(m.group(0)), key).replace(',', ' || ').replace('+', ' && ') + +if __name__ == "__main__": + specpath = "https://raw.githubusercontent.com/KhronosGroup/Vulkan-Docs/main/xml/vk.xml" + + if len(sys.argv) > 1: + specpath = sys.argv[1] + + spec = parse_xml(specpath) + + block_keys = ('DEVICE_TABLE', 'PROTOTYPES_H', 'PROTOTYPES_C', 'LOAD_LOADER', 'LOAD_INSTANCE', 'LOAD_DEVICE', 'LOAD_DEVICE_TABLE') + + blocks = {} + + version = spec.find('types/type[name="VK_HEADER_VERSION"]') + blocks['VERSION'] = version.find('name').tail.strip() + '\n' + blocks['VERSION_DEFINE'] = '#define VOLK_HEADER_VERSION ' + version.find('name').tail.strip() + '\n' + + command_groups = OrderedDict() + instance_commands = set() + + for feature in spec.findall('feature'): + api = feature.get('api') + if 'vulkan' not in api.split(','): + continue + key = defined(feature.get('name')) + cmdrefs = feature.findall('require/command') + command_groups[key] = [cmdref.get('name') for cmdref in cmdrefs] + + for ext in sorted(spec.findall('extensions/extension'), key=lambda ext: ext.get('name')): + supported = ext.get('supported') + if 'vulkan' not in supported.split(','): + continue + name = ext.get('name') + type = ext.get('type') + for req in ext.findall('require'): + key = defined(name) + if req.get('feature'): # old-style XML depends specification + for i in req.get('feature').split(','): + key += ' && ' + defined(i) + if req.get('extension'): # old-style XML depends specification + for i in req.get('extension').split(','): + key += ' && ' + defined(i) + if req.get('depends'): # new-style XML depends specification + dep = cdepends(req.get('depends')) + key += ' && ' + ('(' + dep + ')' if '||' in dep else dep) + cmdrefs = req.findall('command') + for cmdref in cmdrefs: + ver = cmdversions.get(cmdref.get('name')) + if ver: + command_groups.setdefault(key + ' && ' + name.upper() + '_SPEC_VERSION >= ' + str(ver), []).append(cmdref.get('name')) + else: + command_groups.setdefault(key, []).append(cmdref.get('name')) + if type == 'instance': + for cmdref in cmdrefs: + instance_commands.add(cmdref.get('name')) + + commands_to_groups = OrderedDict() + + for (group, cmdnames) in command_groups.items(): + for name in cmdnames: + commands_to_groups.setdefault(name, []).append(group) + + for (group, cmdnames) in command_groups.items(): + command_groups[group] = [name for name in cmdnames if len(commands_to_groups[name]) == 1] + + for (name, groups) in commands_to_groups.items(): + if len(groups) == 1: + continue + key = ' || '.join(['(' + g + ')' for g in groups]) + command_groups.setdefault(key, []).append(name) + + commands = {} + + for cmd in spec.findall('commands/command'): + if not cmd.get('alias'): + name = cmd.findtext('proto/name') + commands[name] = cmd + + for cmd in spec.findall('commands/command'): + if cmd.get('alias'): + name = cmd.get('name') + commands[name] = commands[cmd.get('alias')] + + types = {} + + for type in spec.findall('types/type'): + name = type.findtext('name') + if name: + types[name] = type + + for key in block_keys: + blocks[key] = '' + + for (group, cmdnames) in command_groups.items(): + ifdef = '#if ' + group + '\n' + + for key in block_keys: + blocks[key] += ifdef + + for name in sorted(cmdnames): + cmd = commands[name] + type = cmd.findtext('param[1]/type') + + if name == 'vkGetInstanceProcAddr': + type = '' + if name == 'vkGetDeviceProcAddr': + type = 'VkInstance' + + if is_descendant_type(types, type, 'VkDevice') and name not in instance_commands: + blocks['LOAD_DEVICE'] += '\t' + name + ' = (PFN_' + name + ')load(context, "' + name + '");\n' + blocks['DEVICE_TABLE'] += '\tPFN_' + name + ' ' + name + ';\n' + blocks['LOAD_DEVICE_TABLE'] += '\ttable->' + name + ' = (PFN_' + name + ')load(context, "' + name + '");\n' + elif is_descendant_type(types, type, 'VkInstance'): + blocks['LOAD_INSTANCE'] += '\t' + name + ' = (PFN_' + name + ')load(context, "' + name + '");\n' + elif type != '': + blocks['LOAD_LOADER'] += '\t' + name + ' = (PFN_' + name + ')load(context, "' + name + '");\n' + + blocks['PROTOTYPES_H'] += 'extern PFN_' + name + ' ' + name + ';\n' + blocks['PROTOTYPES_C'] += 'PFN_' + name + ' ' + name + ';\n' + + for key in block_keys: + if blocks[key].endswith(ifdef): + blocks[key] = blocks[key][:-len(ifdef)] + else: + blocks[key] += '#endif /* ' + group + ' */\n' + + patch_file('volk.h', blocks) + patch_file('volk.c', blocks) + patch_file('CMakeLists.txt', blocks) + + print(version.find('name').tail.strip()) diff --git a/deps/volk copy/volk.c b/deps/volk copy/volk.c new file mode 100644 index 0000000..3cbf800 --- /dev/null +++ b/deps/volk copy/volk.c @@ -0,0 +1,3200 @@ +/* This file is part of volk library; see volk.h for version/license details */ +/* clang-format off */ +#include "volk.h" + +#ifdef _WIN32 + typedef const char* LPCSTR; + typedef struct HINSTANCE__* HINSTANCE; + typedef HINSTANCE HMODULE; + #if defined(_MINWINDEF_) + /* minwindef.h defines FARPROC, and attempting to redefine it may conflict with -Wstrict-prototypes */ + #elif defined(_WIN64) + typedef __int64 (__stdcall* FARPROC)(void); + #else + typedef int (__stdcall* FARPROC)(void); + #endif +#else +# include +#endif + +#ifdef __APPLE__ +# include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _WIN32 +__declspec(dllimport) HMODULE __stdcall LoadLibraryA(LPCSTR); +__declspec(dllimport) FARPROC __stdcall GetProcAddress(HMODULE, LPCSTR); +__declspec(dllimport) int __stdcall FreeLibrary(HMODULE); +#endif + +#if defined(__GNUC__) +# define VOLK_DISABLE_GCC_PEDANTIC_WARNINGS \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wpedantic\"") +# define VOLK_RESTORE_GCC_PEDANTIC_WARNINGS \ + _Pragma("GCC diagnostic pop") +#else +# define VOLK_DISABLE_GCC_PEDANTIC_WARNINGS +# define VOLK_RESTORE_GCC_PEDANTIC_WARNINGS +#endif + +static void* loadedModule = NULL; +static VkInstance loadedInstance = VK_NULL_HANDLE; +static VkDevice loadedDevice = VK_NULL_HANDLE; + +static void volkGenLoadLoader(void* context, PFN_vkVoidFunction (*load)(void*, const char*)); +static void volkGenLoadInstance(void* context, PFN_vkVoidFunction (*load)(void*, const char*)); +static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, const char*)); +static void volkGenLoadDeviceTable(struct VolkDeviceTable* table, void* context, PFN_vkVoidFunction (*load)(void*, const char*)); + +static PFN_vkVoidFunction vkGetInstanceProcAddrStub(void* context, const char* name) +{ + return vkGetInstanceProcAddr((VkInstance)context, name); +} + +static PFN_vkVoidFunction vkGetDeviceProcAddrStub(void* context, const char* name) +{ + return vkGetDeviceProcAddr((VkDevice)context, name); +} + +static PFN_vkVoidFunction nullProcAddrStub(void* context, const char* name) +{ + (void)context; + (void)name; + return NULL; +} + +VkResult volkInitialize(void) +{ +#if defined(_WIN32) + HMODULE module = LoadLibraryA("vulkan-1.dll"); + if (!module) + return VK_ERROR_INITIALIZATION_FAILED; + + // note: function pointer is cast through void function pointer to silence cast-function-type warning on gcc8 + vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)(void(*)(void))GetProcAddress(module, "vkGetInstanceProcAddr"); +#elif defined(__APPLE__) + void* module = dlopen("libvulkan.dylib", RTLD_NOW | RTLD_LOCAL); + if (!module) + module = dlopen("libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL); + if (!module) + module = dlopen("libMoltenVK.dylib", RTLD_NOW | RTLD_LOCAL); + // Add support for using Vulkan and MoltenVK in a Framework. App store rules for iOS + // strictly enforce no .dylib's. If they aren't found it just falls through + if (!module) + module = dlopen("vulkan.framework/vulkan", RTLD_NOW | RTLD_LOCAL); + if (!module) + module = dlopen("MoltenVK.framework/MoltenVK", RTLD_NOW | RTLD_LOCAL); + // modern versions of macOS don't search /usr/local/lib automatically contrary to what man dlopen says + // Vulkan SDK uses this as the system-wide installation location, so we're going to fallback to this if all else fails + if (!module && getenv("DYLD_FALLBACK_LIBRARY_PATH") == NULL) + module = dlopen("/usr/local/lib/libvulkan.dylib", RTLD_NOW | RTLD_LOCAL); + if (!module) + return VK_ERROR_INITIALIZATION_FAILED; + + vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)dlsym(module, "vkGetInstanceProcAddr"); +#else + void* module = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL); + if (!module) + module = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL); + if (!module) + return VK_ERROR_INITIALIZATION_FAILED; + VOLK_DISABLE_GCC_PEDANTIC_WARNINGS + vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)dlsym(module, "vkGetInstanceProcAddr"); + VOLK_RESTORE_GCC_PEDANTIC_WARNINGS +#endif + + loadedModule = module; + volkGenLoadLoader(NULL, vkGetInstanceProcAddrStub); + + return VK_SUCCESS; +} + +void volkInitializeCustom(PFN_vkGetInstanceProcAddr handler) +{ + vkGetInstanceProcAddr = handler; + + loadedModule = NULL; + volkGenLoadLoader(NULL, vkGetInstanceProcAddrStub); +} + +void volkFinalize(void) +{ + if (loadedModule) + { +#if defined(_WIN32) + FreeLibrary((HMODULE)loadedModule); +#else + dlclose(loadedModule); +#endif + } + + vkGetInstanceProcAddr = NULL; + volkGenLoadLoader(NULL, nullProcAddrStub); + volkGenLoadInstance(NULL, nullProcAddrStub); + volkGenLoadDevice(NULL, nullProcAddrStub); + + loadedModule = NULL; + loadedInstance = VK_NULL_HANDLE; + loadedDevice = VK_NULL_HANDLE; +} + +uint32_t volkGetInstanceVersion(void) +{ +#if defined(VK_VERSION_1_1) + uint32_t apiVersion = 0; + if (vkEnumerateInstanceVersion && vkEnumerateInstanceVersion(&apiVersion) == VK_SUCCESS) + return apiVersion; +#endif + + if (vkCreateInstance) + return VK_API_VERSION_1_0; + + return 0; +} + +void volkLoadInstance(VkInstance instance) +{ + loadedInstance = instance; + volkGenLoadInstance(instance, vkGetInstanceProcAddrStub); + volkGenLoadDevice(instance, vkGetInstanceProcAddrStub); +} + +void volkLoadInstanceOnly(VkInstance instance) +{ + loadedInstance = instance; + volkGenLoadInstance(instance, vkGetInstanceProcAddrStub); +} + +VkInstance volkGetLoadedInstance(void) +{ + return loadedInstance; +} + +void volkLoadDevice(VkDevice device) +{ + loadedDevice = device; + volkGenLoadDevice(device, vkGetDeviceProcAddrStub); +} + +VkDevice volkGetLoadedDevice(void) +{ + return loadedDevice; +} + +void volkLoadDeviceTable(struct VolkDeviceTable* table, VkDevice device) +{ + volkGenLoadDeviceTable(table, device, vkGetDeviceProcAddrStub); +} + +static void volkGenLoadLoader(void* context, PFN_vkVoidFunction (*load)(void*, const char*)) +{ + /* VOLK_GENERATE_LOAD_LOADER */ +#if defined(VK_VERSION_1_0) + vkCreateInstance = (PFN_vkCreateInstance)load(context, "vkCreateInstance"); + vkEnumerateInstanceExtensionProperties = (PFN_vkEnumerateInstanceExtensionProperties)load(context, "vkEnumerateInstanceExtensionProperties"); + vkEnumerateInstanceLayerProperties = (PFN_vkEnumerateInstanceLayerProperties)load(context, "vkEnumerateInstanceLayerProperties"); +#endif /* defined(VK_VERSION_1_0) */ +#if defined(VK_VERSION_1_1) + vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion)load(context, "vkEnumerateInstanceVersion"); +#endif /* defined(VK_VERSION_1_1) */ + /* VOLK_GENERATE_LOAD_LOADER */ +} + +static void volkGenLoadInstance(void* context, PFN_vkVoidFunction (*load)(void*, const char*)) +{ + /* VOLK_GENERATE_LOAD_INSTANCE */ +#if defined(VK_VERSION_1_0) + vkCreateDevice = (PFN_vkCreateDevice)load(context, "vkCreateDevice"); + vkDestroyInstance = (PFN_vkDestroyInstance)load(context, "vkDestroyInstance"); + vkEnumerateDeviceExtensionProperties = (PFN_vkEnumerateDeviceExtensionProperties)load(context, "vkEnumerateDeviceExtensionProperties"); + vkEnumerateDeviceLayerProperties = (PFN_vkEnumerateDeviceLayerProperties)load(context, "vkEnumerateDeviceLayerProperties"); + vkEnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices)load(context, "vkEnumeratePhysicalDevices"); + vkGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr)load(context, "vkGetDeviceProcAddr"); + vkGetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures)load(context, "vkGetPhysicalDeviceFeatures"); + vkGetPhysicalDeviceFormatProperties = (PFN_vkGetPhysicalDeviceFormatProperties)load(context, "vkGetPhysicalDeviceFormatProperties"); + vkGetPhysicalDeviceImageFormatProperties = (PFN_vkGetPhysicalDeviceImageFormatProperties)load(context, "vkGetPhysicalDeviceImageFormatProperties"); + vkGetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties)load(context, "vkGetPhysicalDeviceMemoryProperties"); + vkGetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties)load(context, "vkGetPhysicalDeviceProperties"); + vkGetPhysicalDeviceQueueFamilyProperties = (PFN_vkGetPhysicalDeviceQueueFamilyProperties)load(context, "vkGetPhysicalDeviceQueueFamilyProperties"); + vkGetPhysicalDeviceSparseImageFormatProperties = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties)load(context, "vkGetPhysicalDeviceSparseImageFormatProperties"); +#endif /* defined(VK_VERSION_1_0) */ +#if defined(VK_VERSION_1_1) + vkEnumeratePhysicalDeviceGroups = (PFN_vkEnumeratePhysicalDeviceGroups)load(context, "vkEnumeratePhysicalDeviceGroups"); + vkGetPhysicalDeviceExternalBufferProperties = (PFN_vkGetPhysicalDeviceExternalBufferProperties)load(context, "vkGetPhysicalDeviceExternalBufferProperties"); + vkGetPhysicalDeviceExternalFenceProperties = (PFN_vkGetPhysicalDeviceExternalFenceProperties)load(context, "vkGetPhysicalDeviceExternalFenceProperties"); + vkGetPhysicalDeviceExternalSemaphoreProperties = (PFN_vkGetPhysicalDeviceExternalSemaphoreProperties)load(context, "vkGetPhysicalDeviceExternalSemaphoreProperties"); + vkGetPhysicalDeviceFeatures2 = (PFN_vkGetPhysicalDeviceFeatures2)load(context, "vkGetPhysicalDeviceFeatures2"); + vkGetPhysicalDeviceFormatProperties2 = (PFN_vkGetPhysicalDeviceFormatProperties2)load(context, "vkGetPhysicalDeviceFormatProperties2"); + vkGetPhysicalDeviceImageFormatProperties2 = (PFN_vkGetPhysicalDeviceImageFormatProperties2)load(context, "vkGetPhysicalDeviceImageFormatProperties2"); + vkGetPhysicalDeviceMemoryProperties2 = (PFN_vkGetPhysicalDeviceMemoryProperties2)load(context, "vkGetPhysicalDeviceMemoryProperties2"); + vkGetPhysicalDeviceProperties2 = (PFN_vkGetPhysicalDeviceProperties2)load(context, "vkGetPhysicalDeviceProperties2"); + vkGetPhysicalDeviceQueueFamilyProperties2 = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2)load(context, "vkGetPhysicalDeviceQueueFamilyProperties2"); + vkGetPhysicalDeviceSparseImageFormatProperties2 = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties2)load(context, "vkGetPhysicalDeviceSparseImageFormatProperties2"); +#endif /* defined(VK_VERSION_1_1) */ +#if defined(VK_VERSION_1_3) + vkGetPhysicalDeviceToolProperties = (PFN_vkGetPhysicalDeviceToolProperties)load(context, "vkGetPhysicalDeviceToolProperties"); +#endif /* defined(VK_VERSION_1_3) */ +#if defined(VK_EXT_acquire_drm_display) + vkAcquireDrmDisplayEXT = (PFN_vkAcquireDrmDisplayEXT)load(context, "vkAcquireDrmDisplayEXT"); + vkGetDrmDisplayEXT = (PFN_vkGetDrmDisplayEXT)load(context, "vkGetDrmDisplayEXT"); +#endif /* defined(VK_EXT_acquire_drm_display) */ +#if defined(VK_EXT_acquire_xlib_display) + vkAcquireXlibDisplayEXT = (PFN_vkAcquireXlibDisplayEXT)load(context, "vkAcquireXlibDisplayEXT"); + vkGetRandROutputDisplayEXT = (PFN_vkGetRandROutputDisplayEXT)load(context, "vkGetRandROutputDisplayEXT"); +#endif /* defined(VK_EXT_acquire_xlib_display) */ +#if defined(VK_EXT_calibrated_timestamps) + vkGetPhysicalDeviceCalibrateableTimeDomainsEXT = (PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)load(context, "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT"); +#endif /* defined(VK_EXT_calibrated_timestamps) */ +#if defined(VK_EXT_debug_report) + vkCreateDebugReportCallbackEXT = (PFN_vkCreateDebugReportCallbackEXT)load(context, "vkCreateDebugReportCallbackEXT"); + vkDebugReportMessageEXT = (PFN_vkDebugReportMessageEXT)load(context, "vkDebugReportMessageEXT"); + vkDestroyDebugReportCallbackEXT = (PFN_vkDestroyDebugReportCallbackEXT)load(context, "vkDestroyDebugReportCallbackEXT"); +#endif /* defined(VK_EXT_debug_report) */ +#if defined(VK_EXT_debug_utils) + vkCmdBeginDebugUtilsLabelEXT = (PFN_vkCmdBeginDebugUtilsLabelEXT)load(context, "vkCmdBeginDebugUtilsLabelEXT"); + vkCmdEndDebugUtilsLabelEXT = (PFN_vkCmdEndDebugUtilsLabelEXT)load(context, "vkCmdEndDebugUtilsLabelEXT"); + vkCmdInsertDebugUtilsLabelEXT = (PFN_vkCmdInsertDebugUtilsLabelEXT)load(context, "vkCmdInsertDebugUtilsLabelEXT"); + vkCreateDebugUtilsMessengerEXT = (PFN_vkCreateDebugUtilsMessengerEXT)load(context, "vkCreateDebugUtilsMessengerEXT"); + vkDestroyDebugUtilsMessengerEXT = (PFN_vkDestroyDebugUtilsMessengerEXT)load(context, "vkDestroyDebugUtilsMessengerEXT"); + vkQueueBeginDebugUtilsLabelEXT = (PFN_vkQueueBeginDebugUtilsLabelEXT)load(context, "vkQueueBeginDebugUtilsLabelEXT"); + vkQueueEndDebugUtilsLabelEXT = (PFN_vkQueueEndDebugUtilsLabelEXT)load(context, "vkQueueEndDebugUtilsLabelEXT"); + vkQueueInsertDebugUtilsLabelEXT = (PFN_vkQueueInsertDebugUtilsLabelEXT)load(context, "vkQueueInsertDebugUtilsLabelEXT"); + vkSetDebugUtilsObjectNameEXT = (PFN_vkSetDebugUtilsObjectNameEXT)load(context, "vkSetDebugUtilsObjectNameEXT"); + vkSetDebugUtilsObjectTagEXT = (PFN_vkSetDebugUtilsObjectTagEXT)load(context, "vkSetDebugUtilsObjectTagEXT"); + vkSubmitDebugUtilsMessageEXT = (PFN_vkSubmitDebugUtilsMessageEXT)load(context, "vkSubmitDebugUtilsMessageEXT"); +#endif /* defined(VK_EXT_debug_utils) */ +#if defined(VK_EXT_direct_mode_display) + vkReleaseDisplayEXT = (PFN_vkReleaseDisplayEXT)load(context, "vkReleaseDisplayEXT"); +#endif /* defined(VK_EXT_direct_mode_display) */ +#if defined(VK_EXT_directfb_surface) + vkCreateDirectFBSurfaceEXT = (PFN_vkCreateDirectFBSurfaceEXT)load(context, "vkCreateDirectFBSurfaceEXT"); + vkGetPhysicalDeviceDirectFBPresentationSupportEXT = (PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT)load(context, "vkGetPhysicalDeviceDirectFBPresentationSupportEXT"); +#endif /* defined(VK_EXT_directfb_surface) */ +#if defined(VK_EXT_display_surface_counter) + vkGetPhysicalDeviceSurfaceCapabilities2EXT = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT)load(context, "vkGetPhysicalDeviceSurfaceCapabilities2EXT"); +#endif /* defined(VK_EXT_display_surface_counter) */ +#if defined(VK_EXT_full_screen_exclusive) + vkGetPhysicalDeviceSurfacePresentModes2EXT = (PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT)load(context, "vkGetPhysicalDeviceSurfacePresentModes2EXT"); +#endif /* defined(VK_EXT_full_screen_exclusive) */ +#if defined(VK_EXT_headless_surface) + vkCreateHeadlessSurfaceEXT = (PFN_vkCreateHeadlessSurfaceEXT)load(context, "vkCreateHeadlessSurfaceEXT"); +#endif /* defined(VK_EXT_headless_surface) */ +#if defined(VK_EXT_metal_surface) + vkCreateMetalSurfaceEXT = (PFN_vkCreateMetalSurfaceEXT)load(context, "vkCreateMetalSurfaceEXT"); +#endif /* defined(VK_EXT_metal_surface) */ +#if defined(VK_EXT_sample_locations) + vkGetPhysicalDeviceMultisamplePropertiesEXT = (PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT)load(context, "vkGetPhysicalDeviceMultisamplePropertiesEXT"); +#endif /* defined(VK_EXT_sample_locations) */ +#if defined(VK_EXT_tooling_info) + vkGetPhysicalDeviceToolPropertiesEXT = (PFN_vkGetPhysicalDeviceToolPropertiesEXT)load(context, "vkGetPhysicalDeviceToolPropertiesEXT"); +#endif /* defined(VK_EXT_tooling_info) */ +#if defined(VK_FUCHSIA_imagepipe_surface) + vkCreateImagePipeSurfaceFUCHSIA = (PFN_vkCreateImagePipeSurfaceFUCHSIA)load(context, "vkCreateImagePipeSurfaceFUCHSIA"); +#endif /* defined(VK_FUCHSIA_imagepipe_surface) */ +#if defined(VK_GGP_stream_descriptor_surface) + vkCreateStreamDescriptorSurfaceGGP = (PFN_vkCreateStreamDescriptorSurfaceGGP)load(context, "vkCreateStreamDescriptorSurfaceGGP"); +#endif /* defined(VK_GGP_stream_descriptor_surface) */ +#if defined(VK_KHR_android_surface) + vkCreateAndroidSurfaceKHR = (PFN_vkCreateAndroidSurfaceKHR)load(context, "vkCreateAndroidSurfaceKHR"); +#endif /* defined(VK_KHR_android_surface) */ +#if defined(VK_KHR_calibrated_timestamps) + vkGetPhysicalDeviceCalibrateableTimeDomainsKHR = (PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR)load(context, "vkGetPhysicalDeviceCalibrateableTimeDomainsKHR"); +#endif /* defined(VK_KHR_calibrated_timestamps) */ +#if defined(VK_KHR_cooperative_matrix) + vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR = (PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR)load(context, "vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR"); +#endif /* defined(VK_KHR_cooperative_matrix) */ +#if defined(VK_KHR_device_group_creation) + vkEnumeratePhysicalDeviceGroupsKHR = (PFN_vkEnumeratePhysicalDeviceGroupsKHR)load(context, "vkEnumeratePhysicalDeviceGroupsKHR"); +#endif /* defined(VK_KHR_device_group_creation) */ +#if defined(VK_KHR_display) + vkCreateDisplayModeKHR = (PFN_vkCreateDisplayModeKHR)load(context, "vkCreateDisplayModeKHR"); + vkCreateDisplayPlaneSurfaceKHR = (PFN_vkCreateDisplayPlaneSurfaceKHR)load(context, "vkCreateDisplayPlaneSurfaceKHR"); + vkGetDisplayModePropertiesKHR = (PFN_vkGetDisplayModePropertiesKHR)load(context, "vkGetDisplayModePropertiesKHR"); + vkGetDisplayPlaneCapabilitiesKHR = (PFN_vkGetDisplayPlaneCapabilitiesKHR)load(context, "vkGetDisplayPlaneCapabilitiesKHR"); + vkGetDisplayPlaneSupportedDisplaysKHR = (PFN_vkGetDisplayPlaneSupportedDisplaysKHR)load(context, "vkGetDisplayPlaneSupportedDisplaysKHR"); + vkGetPhysicalDeviceDisplayPlanePropertiesKHR = (PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR)load(context, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR"); + vkGetPhysicalDeviceDisplayPropertiesKHR = (PFN_vkGetPhysicalDeviceDisplayPropertiesKHR)load(context, "vkGetPhysicalDeviceDisplayPropertiesKHR"); +#endif /* defined(VK_KHR_display) */ +#if defined(VK_KHR_external_fence_capabilities) + vkGetPhysicalDeviceExternalFencePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR)load(context, "vkGetPhysicalDeviceExternalFencePropertiesKHR"); +#endif /* defined(VK_KHR_external_fence_capabilities) */ +#if defined(VK_KHR_external_memory_capabilities) + vkGetPhysicalDeviceExternalBufferPropertiesKHR = (PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR)load(context, "vkGetPhysicalDeviceExternalBufferPropertiesKHR"); +#endif /* defined(VK_KHR_external_memory_capabilities) */ +#if defined(VK_KHR_external_semaphore_capabilities) + vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = (PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR)load(context, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"); +#endif /* defined(VK_KHR_external_semaphore_capabilities) */ +#if defined(VK_KHR_fragment_shading_rate) + vkGetPhysicalDeviceFragmentShadingRatesKHR = (PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR)load(context, "vkGetPhysicalDeviceFragmentShadingRatesKHR"); +#endif /* defined(VK_KHR_fragment_shading_rate) */ +#if defined(VK_KHR_get_display_properties2) + vkGetDisplayModeProperties2KHR = (PFN_vkGetDisplayModeProperties2KHR)load(context, "vkGetDisplayModeProperties2KHR"); + vkGetDisplayPlaneCapabilities2KHR = (PFN_vkGetDisplayPlaneCapabilities2KHR)load(context, "vkGetDisplayPlaneCapabilities2KHR"); + vkGetPhysicalDeviceDisplayPlaneProperties2KHR = (PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR)load(context, "vkGetPhysicalDeviceDisplayPlaneProperties2KHR"); + vkGetPhysicalDeviceDisplayProperties2KHR = (PFN_vkGetPhysicalDeviceDisplayProperties2KHR)load(context, "vkGetPhysicalDeviceDisplayProperties2KHR"); +#endif /* defined(VK_KHR_get_display_properties2) */ +#if defined(VK_KHR_get_physical_device_properties2) + vkGetPhysicalDeviceFeatures2KHR = (PFN_vkGetPhysicalDeviceFeatures2KHR)load(context, "vkGetPhysicalDeviceFeatures2KHR"); + vkGetPhysicalDeviceFormatProperties2KHR = (PFN_vkGetPhysicalDeviceFormatProperties2KHR)load(context, "vkGetPhysicalDeviceFormatProperties2KHR"); + vkGetPhysicalDeviceImageFormatProperties2KHR = (PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)load(context, "vkGetPhysicalDeviceImageFormatProperties2KHR"); + vkGetPhysicalDeviceMemoryProperties2KHR = (PFN_vkGetPhysicalDeviceMemoryProperties2KHR)load(context, "vkGetPhysicalDeviceMemoryProperties2KHR"); + vkGetPhysicalDeviceProperties2KHR = (PFN_vkGetPhysicalDeviceProperties2KHR)load(context, "vkGetPhysicalDeviceProperties2KHR"); + vkGetPhysicalDeviceQueueFamilyProperties2KHR = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)load(context, "vkGetPhysicalDeviceQueueFamilyProperties2KHR"); + vkGetPhysicalDeviceSparseImageFormatProperties2KHR = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)load(context, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); +#endif /* defined(VK_KHR_get_physical_device_properties2) */ +#if defined(VK_KHR_get_surface_capabilities2) + vkGetPhysicalDeviceSurfaceCapabilities2KHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR)load(context, "vkGetPhysicalDeviceSurfaceCapabilities2KHR"); + vkGetPhysicalDeviceSurfaceFormats2KHR = (PFN_vkGetPhysicalDeviceSurfaceFormats2KHR)load(context, "vkGetPhysicalDeviceSurfaceFormats2KHR"); +#endif /* defined(VK_KHR_get_surface_capabilities2) */ +#if defined(VK_KHR_performance_query) + vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = (PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)load(context, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR"); + vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = (PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)load(context, "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR"); +#endif /* defined(VK_KHR_performance_query) */ +#if defined(VK_KHR_surface) + vkDestroySurfaceKHR = (PFN_vkDestroySurfaceKHR)load(context, "vkDestroySurfaceKHR"); + vkGetPhysicalDeviceSurfaceCapabilitiesKHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)load(context, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); + vkGetPhysicalDeviceSurfaceFormatsKHR = (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)load(context, "vkGetPhysicalDeviceSurfaceFormatsKHR"); + vkGetPhysicalDeviceSurfacePresentModesKHR = (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)load(context, "vkGetPhysicalDeviceSurfacePresentModesKHR"); + vkGetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR)load(context, "vkGetPhysicalDeviceSurfaceSupportKHR"); +#endif /* defined(VK_KHR_surface) */ +#if defined(VK_KHR_video_encode_queue) + vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR = (PFN_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR)load(context, "vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR"); +#endif /* defined(VK_KHR_video_encode_queue) */ +#if defined(VK_KHR_video_queue) + vkGetPhysicalDeviceVideoCapabilitiesKHR = (PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR)load(context, "vkGetPhysicalDeviceVideoCapabilitiesKHR"); + vkGetPhysicalDeviceVideoFormatPropertiesKHR = (PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR)load(context, "vkGetPhysicalDeviceVideoFormatPropertiesKHR"); +#endif /* defined(VK_KHR_video_queue) */ +#if defined(VK_KHR_wayland_surface) + vkCreateWaylandSurfaceKHR = (PFN_vkCreateWaylandSurfaceKHR)load(context, "vkCreateWaylandSurfaceKHR"); + vkGetPhysicalDeviceWaylandPresentationSupportKHR = (PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)load(context, "vkGetPhysicalDeviceWaylandPresentationSupportKHR"); +#endif /* defined(VK_KHR_wayland_surface) */ +#if defined(VK_KHR_win32_surface) + vkCreateWin32SurfaceKHR = (PFN_vkCreateWin32SurfaceKHR)load(context, "vkCreateWin32SurfaceKHR"); + vkGetPhysicalDeviceWin32PresentationSupportKHR = (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)load(context, "vkGetPhysicalDeviceWin32PresentationSupportKHR"); +#endif /* defined(VK_KHR_win32_surface) */ +#if defined(VK_KHR_xcb_surface) + vkCreateXcbSurfaceKHR = (PFN_vkCreateXcbSurfaceKHR)load(context, "vkCreateXcbSurfaceKHR"); + vkGetPhysicalDeviceXcbPresentationSupportKHR = (PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)load(context, "vkGetPhysicalDeviceXcbPresentationSupportKHR"); +#endif /* defined(VK_KHR_xcb_surface) */ +#if defined(VK_KHR_xlib_surface) + vkCreateXlibSurfaceKHR = (PFN_vkCreateXlibSurfaceKHR)load(context, "vkCreateXlibSurfaceKHR"); + vkGetPhysicalDeviceXlibPresentationSupportKHR = (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)load(context, "vkGetPhysicalDeviceXlibPresentationSupportKHR"); +#endif /* defined(VK_KHR_xlib_surface) */ +#if defined(VK_MVK_ios_surface) + vkCreateIOSSurfaceMVK = (PFN_vkCreateIOSSurfaceMVK)load(context, "vkCreateIOSSurfaceMVK"); +#endif /* defined(VK_MVK_ios_surface) */ +#if defined(VK_MVK_macos_surface) + vkCreateMacOSSurfaceMVK = (PFN_vkCreateMacOSSurfaceMVK)load(context, "vkCreateMacOSSurfaceMVK"); +#endif /* defined(VK_MVK_macos_surface) */ +#if defined(VK_NN_vi_surface) + vkCreateViSurfaceNN = (PFN_vkCreateViSurfaceNN)load(context, "vkCreateViSurfaceNN"); +#endif /* defined(VK_NN_vi_surface) */ +#if defined(VK_NV_acquire_winrt_display) + vkAcquireWinrtDisplayNV = (PFN_vkAcquireWinrtDisplayNV)load(context, "vkAcquireWinrtDisplayNV"); + vkGetWinrtDisplayNV = (PFN_vkGetWinrtDisplayNV)load(context, "vkGetWinrtDisplayNV"); +#endif /* defined(VK_NV_acquire_winrt_display) */ +#if defined(VK_NV_cooperative_matrix) + vkGetPhysicalDeviceCooperativeMatrixPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV)load(context, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV"); +#endif /* defined(VK_NV_cooperative_matrix) */ +#if defined(VK_NV_coverage_reduction_mode) + vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = (PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV)load(context, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV"); +#endif /* defined(VK_NV_coverage_reduction_mode) */ +#if defined(VK_NV_external_memory_capabilities) + vkGetPhysicalDeviceExternalImageFormatPropertiesNV = (PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV)load(context, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV"); +#endif /* defined(VK_NV_external_memory_capabilities) */ +#if defined(VK_NV_optical_flow) + vkGetPhysicalDeviceOpticalFlowImageFormatsNV = (PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV)load(context, "vkGetPhysicalDeviceOpticalFlowImageFormatsNV"); +#endif /* defined(VK_NV_optical_flow) */ +#if defined(VK_QNX_screen_surface) + vkCreateScreenSurfaceQNX = (PFN_vkCreateScreenSurfaceQNX)load(context, "vkCreateScreenSurfaceQNX"); + vkGetPhysicalDeviceScreenPresentationSupportQNX = (PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX)load(context, "vkGetPhysicalDeviceScreenPresentationSupportQNX"); +#endif /* defined(VK_QNX_screen_surface) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) + vkGetPhysicalDevicePresentRectanglesKHR = (PFN_vkGetPhysicalDevicePresentRectanglesKHR)load(context, "vkGetPhysicalDevicePresentRectanglesKHR"); +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ + /* VOLK_GENERATE_LOAD_INSTANCE */ +} + +static void volkGenLoadDevice(void* context, PFN_vkVoidFunction (*load)(void*, const char*)) +{ + /* VOLK_GENERATE_LOAD_DEVICE */ +#if defined(VK_VERSION_1_0) + vkAllocateCommandBuffers = (PFN_vkAllocateCommandBuffers)load(context, "vkAllocateCommandBuffers"); + vkAllocateDescriptorSets = (PFN_vkAllocateDescriptorSets)load(context, "vkAllocateDescriptorSets"); + vkAllocateMemory = (PFN_vkAllocateMemory)load(context, "vkAllocateMemory"); + vkBeginCommandBuffer = (PFN_vkBeginCommandBuffer)load(context, "vkBeginCommandBuffer"); + vkBindBufferMemory = (PFN_vkBindBufferMemory)load(context, "vkBindBufferMemory"); + vkBindImageMemory = (PFN_vkBindImageMemory)load(context, "vkBindImageMemory"); + vkCmdBeginQuery = (PFN_vkCmdBeginQuery)load(context, "vkCmdBeginQuery"); + vkCmdBeginRenderPass = (PFN_vkCmdBeginRenderPass)load(context, "vkCmdBeginRenderPass"); + vkCmdBindDescriptorSets = (PFN_vkCmdBindDescriptorSets)load(context, "vkCmdBindDescriptorSets"); + vkCmdBindIndexBuffer = (PFN_vkCmdBindIndexBuffer)load(context, "vkCmdBindIndexBuffer"); + vkCmdBindPipeline = (PFN_vkCmdBindPipeline)load(context, "vkCmdBindPipeline"); + vkCmdBindVertexBuffers = (PFN_vkCmdBindVertexBuffers)load(context, "vkCmdBindVertexBuffers"); + vkCmdBlitImage = (PFN_vkCmdBlitImage)load(context, "vkCmdBlitImage"); + vkCmdClearAttachments = (PFN_vkCmdClearAttachments)load(context, "vkCmdClearAttachments"); + vkCmdClearColorImage = (PFN_vkCmdClearColorImage)load(context, "vkCmdClearColorImage"); + vkCmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage)load(context, "vkCmdClearDepthStencilImage"); + vkCmdCopyBuffer = (PFN_vkCmdCopyBuffer)load(context, "vkCmdCopyBuffer"); + vkCmdCopyBufferToImage = (PFN_vkCmdCopyBufferToImage)load(context, "vkCmdCopyBufferToImage"); + vkCmdCopyImage = (PFN_vkCmdCopyImage)load(context, "vkCmdCopyImage"); + vkCmdCopyImageToBuffer = (PFN_vkCmdCopyImageToBuffer)load(context, "vkCmdCopyImageToBuffer"); + vkCmdCopyQueryPoolResults = (PFN_vkCmdCopyQueryPoolResults)load(context, "vkCmdCopyQueryPoolResults"); + vkCmdDispatch = (PFN_vkCmdDispatch)load(context, "vkCmdDispatch"); + vkCmdDispatchIndirect = (PFN_vkCmdDispatchIndirect)load(context, "vkCmdDispatchIndirect"); + vkCmdDraw = (PFN_vkCmdDraw)load(context, "vkCmdDraw"); + vkCmdDrawIndexed = (PFN_vkCmdDrawIndexed)load(context, "vkCmdDrawIndexed"); + vkCmdDrawIndexedIndirect = (PFN_vkCmdDrawIndexedIndirect)load(context, "vkCmdDrawIndexedIndirect"); + vkCmdDrawIndirect = (PFN_vkCmdDrawIndirect)load(context, "vkCmdDrawIndirect"); + vkCmdEndQuery = (PFN_vkCmdEndQuery)load(context, "vkCmdEndQuery"); + vkCmdEndRenderPass = (PFN_vkCmdEndRenderPass)load(context, "vkCmdEndRenderPass"); + vkCmdExecuteCommands = (PFN_vkCmdExecuteCommands)load(context, "vkCmdExecuteCommands"); + vkCmdFillBuffer = (PFN_vkCmdFillBuffer)load(context, "vkCmdFillBuffer"); + vkCmdNextSubpass = (PFN_vkCmdNextSubpass)load(context, "vkCmdNextSubpass"); + vkCmdPipelineBarrier = (PFN_vkCmdPipelineBarrier)load(context, "vkCmdPipelineBarrier"); + vkCmdPushConstants = (PFN_vkCmdPushConstants)load(context, "vkCmdPushConstants"); + vkCmdResetEvent = (PFN_vkCmdResetEvent)load(context, "vkCmdResetEvent"); + vkCmdResetQueryPool = (PFN_vkCmdResetQueryPool)load(context, "vkCmdResetQueryPool"); + vkCmdResolveImage = (PFN_vkCmdResolveImage)load(context, "vkCmdResolveImage"); + vkCmdSetBlendConstants = (PFN_vkCmdSetBlendConstants)load(context, "vkCmdSetBlendConstants"); + vkCmdSetDepthBias = (PFN_vkCmdSetDepthBias)load(context, "vkCmdSetDepthBias"); + vkCmdSetDepthBounds = (PFN_vkCmdSetDepthBounds)load(context, "vkCmdSetDepthBounds"); + vkCmdSetEvent = (PFN_vkCmdSetEvent)load(context, "vkCmdSetEvent"); + vkCmdSetLineWidth = (PFN_vkCmdSetLineWidth)load(context, "vkCmdSetLineWidth"); + vkCmdSetScissor = (PFN_vkCmdSetScissor)load(context, "vkCmdSetScissor"); + vkCmdSetStencilCompareMask = (PFN_vkCmdSetStencilCompareMask)load(context, "vkCmdSetStencilCompareMask"); + vkCmdSetStencilReference = (PFN_vkCmdSetStencilReference)load(context, "vkCmdSetStencilReference"); + vkCmdSetStencilWriteMask = (PFN_vkCmdSetStencilWriteMask)load(context, "vkCmdSetStencilWriteMask"); + vkCmdSetViewport = (PFN_vkCmdSetViewport)load(context, "vkCmdSetViewport"); + vkCmdUpdateBuffer = (PFN_vkCmdUpdateBuffer)load(context, "vkCmdUpdateBuffer"); + vkCmdWaitEvents = (PFN_vkCmdWaitEvents)load(context, "vkCmdWaitEvents"); + vkCmdWriteTimestamp = (PFN_vkCmdWriteTimestamp)load(context, "vkCmdWriteTimestamp"); + vkCreateBuffer = (PFN_vkCreateBuffer)load(context, "vkCreateBuffer"); + vkCreateBufferView = (PFN_vkCreateBufferView)load(context, "vkCreateBufferView"); + vkCreateCommandPool = (PFN_vkCreateCommandPool)load(context, "vkCreateCommandPool"); + vkCreateComputePipelines = (PFN_vkCreateComputePipelines)load(context, "vkCreateComputePipelines"); + vkCreateDescriptorPool = (PFN_vkCreateDescriptorPool)load(context, "vkCreateDescriptorPool"); + vkCreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout)load(context, "vkCreateDescriptorSetLayout"); + vkCreateEvent = (PFN_vkCreateEvent)load(context, "vkCreateEvent"); + vkCreateFence = (PFN_vkCreateFence)load(context, "vkCreateFence"); + vkCreateFramebuffer = (PFN_vkCreateFramebuffer)load(context, "vkCreateFramebuffer"); + vkCreateGraphicsPipelines = (PFN_vkCreateGraphicsPipelines)load(context, "vkCreateGraphicsPipelines"); + vkCreateImage = (PFN_vkCreateImage)load(context, "vkCreateImage"); + vkCreateImageView = (PFN_vkCreateImageView)load(context, "vkCreateImageView"); + vkCreatePipelineCache = (PFN_vkCreatePipelineCache)load(context, "vkCreatePipelineCache"); + vkCreatePipelineLayout = (PFN_vkCreatePipelineLayout)load(context, "vkCreatePipelineLayout"); + vkCreateQueryPool = (PFN_vkCreateQueryPool)load(context, "vkCreateQueryPool"); + vkCreateRenderPass = (PFN_vkCreateRenderPass)load(context, "vkCreateRenderPass"); + vkCreateSampler = (PFN_vkCreateSampler)load(context, "vkCreateSampler"); + vkCreateSemaphore = (PFN_vkCreateSemaphore)load(context, "vkCreateSemaphore"); + vkCreateShaderModule = (PFN_vkCreateShaderModule)load(context, "vkCreateShaderModule"); + vkDestroyBuffer = (PFN_vkDestroyBuffer)load(context, "vkDestroyBuffer"); + vkDestroyBufferView = (PFN_vkDestroyBufferView)load(context, "vkDestroyBufferView"); + vkDestroyCommandPool = (PFN_vkDestroyCommandPool)load(context, "vkDestroyCommandPool"); + vkDestroyDescriptorPool = (PFN_vkDestroyDescriptorPool)load(context, "vkDestroyDescriptorPool"); + vkDestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout)load(context, "vkDestroyDescriptorSetLayout"); + vkDestroyDevice = (PFN_vkDestroyDevice)load(context, "vkDestroyDevice"); + vkDestroyEvent = (PFN_vkDestroyEvent)load(context, "vkDestroyEvent"); + vkDestroyFence = (PFN_vkDestroyFence)load(context, "vkDestroyFence"); + vkDestroyFramebuffer = (PFN_vkDestroyFramebuffer)load(context, "vkDestroyFramebuffer"); + vkDestroyImage = (PFN_vkDestroyImage)load(context, "vkDestroyImage"); + vkDestroyImageView = (PFN_vkDestroyImageView)load(context, "vkDestroyImageView"); + vkDestroyPipeline = (PFN_vkDestroyPipeline)load(context, "vkDestroyPipeline"); + vkDestroyPipelineCache = (PFN_vkDestroyPipelineCache)load(context, "vkDestroyPipelineCache"); + vkDestroyPipelineLayout = (PFN_vkDestroyPipelineLayout)load(context, "vkDestroyPipelineLayout"); + vkDestroyQueryPool = (PFN_vkDestroyQueryPool)load(context, "vkDestroyQueryPool"); + vkDestroyRenderPass = (PFN_vkDestroyRenderPass)load(context, "vkDestroyRenderPass"); + vkDestroySampler = (PFN_vkDestroySampler)load(context, "vkDestroySampler"); + vkDestroySemaphore = (PFN_vkDestroySemaphore)load(context, "vkDestroySemaphore"); + vkDestroyShaderModule = (PFN_vkDestroyShaderModule)load(context, "vkDestroyShaderModule"); + vkDeviceWaitIdle = (PFN_vkDeviceWaitIdle)load(context, "vkDeviceWaitIdle"); + vkEndCommandBuffer = (PFN_vkEndCommandBuffer)load(context, "vkEndCommandBuffer"); + vkFlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges)load(context, "vkFlushMappedMemoryRanges"); + vkFreeCommandBuffers = (PFN_vkFreeCommandBuffers)load(context, "vkFreeCommandBuffers"); + vkFreeDescriptorSets = (PFN_vkFreeDescriptorSets)load(context, "vkFreeDescriptorSets"); + vkFreeMemory = (PFN_vkFreeMemory)load(context, "vkFreeMemory"); + vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)load(context, "vkGetBufferMemoryRequirements"); + vkGetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment)load(context, "vkGetDeviceMemoryCommitment"); + vkGetDeviceQueue = (PFN_vkGetDeviceQueue)load(context, "vkGetDeviceQueue"); + vkGetEventStatus = (PFN_vkGetEventStatus)load(context, "vkGetEventStatus"); + vkGetFenceStatus = (PFN_vkGetFenceStatus)load(context, "vkGetFenceStatus"); + vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)load(context, "vkGetImageMemoryRequirements"); + vkGetImageSparseMemoryRequirements = (PFN_vkGetImageSparseMemoryRequirements)load(context, "vkGetImageSparseMemoryRequirements"); + vkGetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout)load(context, "vkGetImageSubresourceLayout"); + vkGetPipelineCacheData = (PFN_vkGetPipelineCacheData)load(context, "vkGetPipelineCacheData"); + vkGetQueryPoolResults = (PFN_vkGetQueryPoolResults)load(context, "vkGetQueryPoolResults"); + vkGetRenderAreaGranularity = (PFN_vkGetRenderAreaGranularity)load(context, "vkGetRenderAreaGranularity"); + vkInvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges)load(context, "vkInvalidateMappedMemoryRanges"); + vkMapMemory = (PFN_vkMapMemory)load(context, "vkMapMemory"); + vkMergePipelineCaches = (PFN_vkMergePipelineCaches)load(context, "vkMergePipelineCaches"); + vkQueueBindSparse = (PFN_vkQueueBindSparse)load(context, "vkQueueBindSparse"); + vkQueueSubmit = (PFN_vkQueueSubmit)load(context, "vkQueueSubmit"); + vkQueueWaitIdle = (PFN_vkQueueWaitIdle)load(context, "vkQueueWaitIdle"); + vkResetCommandBuffer = (PFN_vkResetCommandBuffer)load(context, "vkResetCommandBuffer"); + vkResetCommandPool = (PFN_vkResetCommandPool)load(context, "vkResetCommandPool"); + vkResetDescriptorPool = (PFN_vkResetDescriptorPool)load(context, "vkResetDescriptorPool"); + vkResetEvent = (PFN_vkResetEvent)load(context, "vkResetEvent"); + vkResetFences = (PFN_vkResetFences)load(context, "vkResetFences"); + vkSetEvent = (PFN_vkSetEvent)load(context, "vkSetEvent"); + vkUnmapMemory = (PFN_vkUnmapMemory)load(context, "vkUnmapMemory"); + vkUpdateDescriptorSets = (PFN_vkUpdateDescriptorSets)load(context, "vkUpdateDescriptorSets"); + vkWaitForFences = (PFN_vkWaitForFences)load(context, "vkWaitForFences"); +#endif /* defined(VK_VERSION_1_0) */ +#if defined(VK_VERSION_1_1) + vkBindBufferMemory2 = (PFN_vkBindBufferMemory2)load(context, "vkBindBufferMemory2"); + vkBindImageMemory2 = (PFN_vkBindImageMemory2)load(context, "vkBindImageMemory2"); + vkCmdDispatchBase = (PFN_vkCmdDispatchBase)load(context, "vkCmdDispatchBase"); + vkCmdSetDeviceMask = (PFN_vkCmdSetDeviceMask)load(context, "vkCmdSetDeviceMask"); + vkCreateDescriptorUpdateTemplate = (PFN_vkCreateDescriptorUpdateTemplate)load(context, "vkCreateDescriptorUpdateTemplate"); + vkCreateSamplerYcbcrConversion = (PFN_vkCreateSamplerYcbcrConversion)load(context, "vkCreateSamplerYcbcrConversion"); + vkDestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate)load(context, "vkDestroyDescriptorUpdateTemplate"); + vkDestroySamplerYcbcrConversion = (PFN_vkDestroySamplerYcbcrConversion)load(context, "vkDestroySamplerYcbcrConversion"); + vkGetBufferMemoryRequirements2 = (PFN_vkGetBufferMemoryRequirements2)load(context, "vkGetBufferMemoryRequirements2"); + vkGetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport)load(context, "vkGetDescriptorSetLayoutSupport"); + vkGetDeviceGroupPeerMemoryFeatures = (PFN_vkGetDeviceGroupPeerMemoryFeatures)load(context, "vkGetDeviceGroupPeerMemoryFeatures"); + vkGetDeviceQueue2 = (PFN_vkGetDeviceQueue2)load(context, "vkGetDeviceQueue2"); + vkGetImageMemoryRequirements2 = (PFN_vkGetImageMemoryRequirements2)load(context, "vkGetImageMemoryRequirements2"); + vkGetImageSparseMemoryRequirements2 = (PFN_vkGetImageSparseMemoryRequirements2)load(context, "vkGetImageSparseMemoryRequirements2"); + vkTrimCommandPool = (PFN_vkTrimCommandPool)load(context, "vkTrimCommandPool"); + vkUpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate)load(context, "vkUpdateDescriptorSetWithTemplate"); +#endif /* defined(VK_VERSION_1_1) */ +#if defined(VK_VERSION_1_2) + vkCmdBeginRenderPass2 = (PFN_vkCmdBeginRenderPass2)load(context, "vkCmdBeginRenderPass2"); + vkCmdDrawIndexedIndirectCount = (PFN_vkCmdDrawIndexedIndirectCount)load(context, "vkCmdDrawIndexedIndirectCount"); + vkCmdDrawIndirectCount = (PFN_vkCmdDrawIndirectCount)load(context, "vkCmdDrawIndirectCount"); + vkCmdEndRenderPass2 = (PFN_vkCmdEndRenderPass2)load(context, "vkCmdEndRenderPass2"); + vkCmdNextSubpass2 = (PFN_vkCmdNextSubpass2)load(context, "vkCmdNextSubpass2"); + vkCreateRenderPass2 = (PFN_vkCreateRenderPass2)load(context, "vkCreateRenderPass2"); + vkGetBufferDeviceAddress = (PFN_vkGetBufferDeviceAddress)load(context, "vkGetBufferDeviceAddress"); + vkGetBufferOpaqueCaptureAddress = (PFN_vkGetBufferOpaqueCaptureAddress)load(context, "vkGetBufferOpaqueCaptureAddress"); + vkGetDeviceMemoryOpaqueCaptureAddress = (PFN_vkGetDeviceMemoryOpaqueCaptureAddress)load(context, "vkGetDeviceMemoryOpaqueCaptureAddress"); + vkGetSemaphoreCounterValue = (PFN_vkGetSemaphoreCounterValue)load(context, "vkGetSemaphoreCounterValue"); + vkResetQueryPool = (PFN_vkResetQueryPool)load(context, "vkResetQueryPool"); + vkSignalSemaphore = (PFN_vkSignalSemaphore)load(context, "vkSignalSemaphore"); + vkWaitSemaphores = (PFN_vkWaitSemaphores)load(context, "vkWaitSemaphores"); +#endif /* defined(VK_VERSION_1_2) */ +#if defined(VK_VERSION_1_3) + vkCmdBeginRendering = (PFN_vkCmdBeginRendering)load(context, "vkCmdBeginRendering"); + vkCmdBindVertexBuffers2 = (PFN_vkCmdBindVertexBuffers2)load(context, "vkCmdBindVertexBuffers2"); + vkCmdBlitImage2 = (PFN_vkCmdBlitImage2)load(context, "vkCmdBlitImage2"); + vkCmdCopyBuffer2 = (PFN_vkCmdCopyBuffer2)load(context, "vkCmdCopyBuffer2"); + vkCmdCopyBufferToImage2 = (PFN_vkCmdCopyBufferToImage2)load(context, "vkCmdCopyBufferToImage2"); + vkCmdCopyImage2 = (PFN_vkCmdCopyImage2)load(context, "vkCmdCopyImage2"); + vkCmdCopyImageToBuffer2 = (PFN_vkCmdCopyImageToBuffer2)load(context, "vkCmdCopyImageToBuffer2"); + vkCmdEndRendering = (PFN_vkCmdEndRendering)load(context, "vkCmdEndRendering"); + vkCmdPipelineBarrier2 = (PFN_vkCmdPipelineBarrier2)load(context, "vkCmdPipelineBarrier2"); + vkCmdResetEvent2 = (PFN_vkCmdResetEvent2)load(context, "vkCmdResetEvent2"); + vkCmdResolveImage2 = (PFN_vkCmdResolveImage2)load(context, "vkCmdResolveImage2"); + vkCmdSetCullMode = (PFN_vkCmdSetCullMode)load(context, "vkCmdSetCullMode"); + vkCmdSetDepthBiasEnable = (PFN_vkCmdSetDepthBiasEnable)load(context, "vkCmdSetDepthBiasEnable"); + vkCmdSetDepthBoundsTestEnable = (PFN_vkCmdSetDepthBoundsTestEnable)load(context, "vkCmdSetDepthBoundsTestEnable"); + vkCmdSetDepthCompareOp = (PFN_vkCmdSetDepthCompareOp)load(context, "vkCmdSetDepthCompareOp"); + vkCmdSetDepthTestEnable = (PFN_vkCmdSetDepthTestEnable)load(context, "vkCmdSetDepthTestEnable"); + vkCmdSetDepthWriteEnable = (PFN_vkCmdSetDepthWriteEnable)load(context, "vkCmdSetDepthWriteEnable"); + vkCmdSetEvent2 = (PFN_vkCmdSetEvent2)load(context, "vkCmdSetEvent2"); + vkCmdSetFrontFace = (PFN_vkCmdSetFrontFace)load(context, "vkCmdSetFrontFace"); + vkCmdSetPrimitiveRestartEnable = (PFN_vkCmdSetPrimitiveRestartEnable)load(context, "vkCmdSetPrimitiveRestartEnable"); + vkCmdSetPrimitiveTopology = (PFN_vkCmdSetPrimitiveTopology)load(context, "vkCmdSetPrimitiveTopology"); + vkCmdSetRasterizerDiscardEnable = (PFN_vkCmdSetRasterizerDiscardEnable)load(context, "vkCmdSetRasterizerDiscardEnable"); + vkCmdSetScissorWithCount = (PFN_vkCmdSetScissorWithCount)load(context, "vkCmdSetScissorWithCount"); + vkCmdSetStencilOp = (PFN_vkCmdSetStencilOp)load(context, "vkCmdSetStencilOp"); + vkCmdSetStencilTestEnable = (PFN_vkCmdSetStencilTestEnable)load(context, "vkCmdSetStencilTestEnable"); + vkCmdSetViewportWithCount = (PFN_vkCmdSetViewportWithCount)load(context, "vkCmdSetViewportWithCount"); + vkCmdWaitEvents2 = (PFN_vkCmdWaitEvents2)load(context, "vkCmdWaitEvents2"); + vkCmdWriteTimestamp2 = (PFN_vkCmdWriteTimestamp2)load(context, "vkCmdWriteTimestamp2"); + vkCreatePrivateDataSlot = (PFN_vkCreatePrivateDataSlot)load(context, "vkCreatePrivateDataSlot"); + vkDestroyPrivateDataSlot = (PFN_vkDestroyPrivateDataSlot)load(context, "vkDestroyPrivateDataSlot"); + vkGetDeviceBufferMemoryRequirements = (PFN_vkGetDeviceBufferMemoryRequirements)load(context, "vkGetDeviceBufferMemoryRequirements"); + vkGetDeviceImageMemoryRequirements = (PFN_vkGetDeviceImageMemoryRequirements)load(context, "vkGetDeviceImageMemoryRequirements"); + vkGetDeviceImageSparseMemoryRequirements = (PFN_vkGetDeviceImageSparseMemoryRequirements)load(context, "vkGetDeviceImageSparseMemoryRequirements"); + vkGetPrivateData = (PFN_vkGetPrivateData)load(context, "vkGetPrivateData"); + vkQueueSubmit2 = (PFN_vkQueueSubmit2)load(context, "vkQueueSubmit2"); + vkSetPrivateData = (PFN_vkSetPrivateData)load(context, "vkSetPrivateData"); +#endif /* defined(VK_VERSION_1_3) */ +#if defined(VK_AMDX_shader_enqueue) + vkCmdDispatchGraphAMDX = (PFN_vkCmdDispatchGraphAMDX)load(context, "vkCmdDispatchGraphAMDX"); + vkCmdDispatchGraphIndirectAMDX = (PFN_vkCmdDispatchGraphIndirectAMDX)load(context, "vkCmdDispatchGraphIndirectAMDX"); + vkCmdDispatchGraphIndirectCountAMDX = (PFN_vkCmdDispatchGraphIndirectCountAMDX)load(context, "vkCmdDispatchGraphIndirectCountAMDX"); + vkCmdInitializeGraphScratchMemoryAMDX = (PFN_vkCmdInitializeGraphScratchMemoryAMDX)load(context, "vkCmdInitializeGraphScratchMemoryAMDX"); + vkCreateExecutionGraphPipelinesAMDX = (PFN_vkCreateExecutionGraphPipelinesAMDX)load(context, "vkCreateExecutionGraphPipelinesAMDX"); + vkGetExecutionGraphPipelineNodeIndexAMDX = (PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)load(context, "vkGetExecutionGraphPipelineNodeIndexAMDX"); + vkGetExecutionGraphPipelineScratchSizeAMDX = (PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)load(context, "vkGetExecutionGraphPipelineScratchSizeAMDX"); +#endif /* defined(VK_AMDX_shader_enqueue) */ +#if defined(VK_AMD_anti_lag) + vkAntiLagUpdateAMD = (PFN_vkAntiLagUpdateAMD)load(context, "vkAntiLagUpdateAMD"); +#endif /* defined(VK_AMD_anti_lag) */ +#if defined(VK_AMD_buffer_marker) + vkCmdWriteBufferMarkerAMD = (PFN_vkCmdWriteBufferMarkerAMD)load(context, "vkCmdWriteBufferMarkerAMD"); +#endif /* defined(VK_AMD_buffer_marker) */ +#if defined(VK_AMD_display_native_hdr) + vkSetLocalDimmingAMD = (PFN_vkSetLocalDimmingAMD)load(context, "vkSetLocalDimmingAMD"); +#endif /* defined(VK_AMD_display_native_hdr) */ +#if defined(VK_AMD_draw_indirect_count) + vkCmdDrawIndexedIndirectCountAMD = (PFN_vkCmdDrawIndexedIndirectCountAMD)load(context, "vkCmdDrawIndexedIndirectCountAMD"); + vkCmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD)load(context, "vkCmdDrawIndirectCountAMD"); +#endif /* defined(VK_AMD_draw_indirect_count) */ +#if defined(VK_AMD_shader_info) + vkGetShaderInfoAMD = (PFN_vkGetShaderInfoAMD)load(context, "vkGetShaderInfoAMD"); +#endif /* defined(VK_AMD_shader_info) */ +#if defined(VK_ANDROID_external_memory_android_hardware_buffer) + vkGetAndroidHardwareBufferPropertiesANDROID = (PFN_vkGetAndroidHardwareBufferPropertiesANDROID)load(context, "vkGetAndroidHardwareBufferPropertiesANDROID"); + vkGetMemoryAndroidHardwareBufferANDROID = (PFN_vkGetMemoryAndroidHardwareBufferANDROID)load(context, "vkGetMemoryAndroidHardwareBufferANDROID"); +#endif /* defined(VK_ANDROID_external_memory_android_hardware_buffer) */ +#if defined(VK_EXT_attachment_feedback_loop_dynamic_state) + vkCmdSetAttachmentFeedbackLoopEnableEXT = (PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT)load(context, "vkCmdSetAttachmentFeedbackLoopEnableEXT"); +#endif /* defined(VK_EXT_attachment_feedback_loop_dynamic_state) */ +#if defined(VK_EXT_buffer_device_address) + vkGetBufferDeviceAddressEXT = (PFN_vkGetBufferDeviceAddressEXT)load(context, "vkGetBufferDeviceAddressEXT"); +#endif /* defined(VK_EXT_buffer_device_address) */ +#if defined(VK_EXT_calibrated_timestamps) + vkGetCalibratedTimestampsEXT = (PFN_vkGetCalibratedTimestampsEXT)load(context, "vkGetCalibratedTimestampsEXT"); +#endif /* defined(VK_EXT_calibrated_timestamps) */ +#if defined(VK_EXT_color_write_enable) + vkCmdSetColorWriteEnableEXT = (PFN_vkCmdSetColorWriteEnableEXT)load(context, "vkCmdSetColorWriteEnableEXT"); +#endif /* defined(VK_EXT_color_write_enable) */ +#if defined(VK_EXT_conditional_rendering) + vkCmdBeginConditionalRenderingEXT = (PFN_vkCmdBeginConditionalRenderingEXT)load(context, "vkCmdBeginConditionalRenderingEXT"); + vkCmdEndConditionalRenderingEXT = (PFN_vkCmdEndConditionalRenderingEXT)load(context, "vkCmdEndConditionalRenderingEXT"); +#endif /* defined(VK_EXT_conditional_rendering) */ +#if defined(VK_EXT_debug_marker) + vkCmdDebugMarkerBeginEXT = (PFN_vkCmdDebugMarkerBeginEXT)load(context, "vkCmdDebugMarkerBeginEXT"); + vkCmdDebugMarkerEndEXT = (PFN_vkCmdDebugMarkerEndEXT)load(context, "vkCmdDebugMarkerEndEXT"); + vkCmdDebugMarkerInsertEXT = (PFN_vkCmdDebugMarkerInsertEXT)load(context, "vkCmdDebugMarkerInsertEXT"); + vkDebugMarkerSetObjectNameEXT = (PFN_vkDebugMarkerSetObjectNameEXT)load(context, "vkDebugMarkerSetObjectNameEXT"); + vkDebugMarkerSetObjectTagEXT = (PFN_vkDebugMarkerSetObjectTagEXT)load(context, "vkDebugMarkerSetObjectTagEXT"); +#endif /* defined(VK_EXT_debug_marker) */ +#if defined(VK_EXT_depth_bias_control) + vkCmdSetDepthBias2EXT = (PFN_vkCmdSetDepthBias2EXT)load(context, "vkCmdSetDepthBias2EXT"); +#endif /* defined(VK_EXT_depth_bias_control) */ +#if defined(VK_EXT_descriptor_buffer) + vkCmdBindDescriptorBufferEmbeddedSamplersEXT = (PFN_vkCmdBindDescriptorBufferEmbeddedSamplersEXT)load(context, "vkCmdBindDescriptorBufferEmbeddedSamplersEXT"); + vkCmdBindDescriptorBuffersEXT = (PFN_vkCmdBindDescriptorBuffersEXT)load(context, "vkCmdBindDescriptorBuffersEXT"); + vkCmdSetDescriptorBufferOffsetsEXT = (PFN_vkCmdSetDescriptorBufferOffsetsEXT)load(context, "vkCmdSetDescriptorBufferOffsetsEXT"); + vkGetBufferOpaqueCaptureDescriptorDataEXT = (PFN_vkGetBufferOpaqueCaptureDescriptorDataEXT)load(context, "vkGetBufferOpaqueCaptureDescriptorDataEXT"); + vkGetDescriptorEXT = (PFN_vkGetDescriptorEXT)load(context, "vkGetDescriptorEXT"); + vkGetDescriptorSetLayoutBindingOffsetEXT = (PFN_vkGetDescriptorSetLayoutBindingOffsetEXT)load(context, "vkGetDescriptorSetLayoutBindingOffsetEXT"); + vkGetDescriptorSetLayoutSizeEXT = (PFN_vkGetDescriptorSetLayoutSizeEXT)load(context, "vkGetDescriptorSetLayoutSizeEXT"); + vkGetImageOpaqueCaptureDescriptorDataEXT = (PFN_vkGetImageOpaqueCaptureDescriptorDataEXT)load(context, "vkGetImageOpaqueCaptureDescriptorDataEXT"); + vkGetImageViewOpaqueCaptureDescriptorDataEXT = (PFN_vkGetImageViewOpaqueCaptureDescriptorDataEXT)load(context, "vkGetImageViewOpaqueCaptureDescriptorDataEXT"); + vkGetSamplerOpaqueCaptureDescriptorDataEXT = (PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT)load(context, "vkGetSamplerOpaqueCaptureDescriptorDataEXT"); +#endif /* defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) + vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT = (PFN_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT)load(context, "vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT"); +#endif /* defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) */ +#if defined(VK_EXT_device_fault) + vkGetDeviceFaultInfoEXT = (PFN_vkGetDeviceFaultInfoEXT)load(context, "vkGetDeviceFaultInfoEXT"); +#endif /* defined(VK_EXT_device_fault) */ +#if defined(VK_EXT_discard_rectangles) + vkCmdSetDiscardRectangleEXT = (PFN_vkCmdSetDiscardRectangleEXT)load(context, "vkCmdSetDiscardRectangleEXT"); +#endif /* defined(VK_EXT_discard_rectangles) */ +#if defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 + vkCmdSetDiscardRectangleEnableEXT = (PFN_vkCmdSetDiscardRectangleEnableEXT)load(context, "vkCmdSetDiscardRectangleEnableEXT"); + vkCmdSetDiscardRectangleModeEXT = (PFN_vkCmdSetDiscardRectangleModeEXT)load(context, "vkCmdSetDiscardRectangleModeEXT"); +#endif /* defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 */ +#if defined(VK_EXT_display_control) + vkDisplayPowerControlEXT = (PFN_vkDisplayPowerControlEXT)load(context, "vkDisplayPowerControlEXT"); + vkGetSwapchainCounterEXT = (PFN_vkGetSwapchainCounterEXT)load(context, "vkGetSwapchainCounterEXT"); + vkRegisterDeviceEventEXT = (PFN_vkRegisterDeviceEventEXT)load(context, "vkRegisterDeviceEventEXT"); + vkRegisterDisplayEventEXT = (PFN_vkRegisterDisplayEventEXT)load(context, "vkRegisterDisplayEventEXT"); +#endif /* defined(VK_EXT_display_control) */ +#if defined(VK_EXT_external_memory_host) + vkGetMemoryHostPointerPropertiesEXT = (PFN_vkGetMemoryHostPointerPropertiesEXT)load(context, "vkGetMemoryHostPointerPropertiesEXT"); +#endif /* defined(VK_EXT_external_memory_host) */ +#if defined(VK_EXT_full_screen_exclusive) + vkAcquireFullScreenExclusiveModeEXT = (PFN_vkAcquireFullScreenExclusiveModeEXT)load(context, "vkAcquireFullScreenExclusiveModeEXT"); + vkReleaseFullScreenExclusiveModeEXT = (PFN_vkReleaseFullScreenExclusiveModeEXT)load(context, "vkReleaseFullScreenExclusiveModeEXT"); +#endif /* defined(VK_EXT_full_screen_exclusive) */ +#if defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) + vkGetDeviceGroupSurfacePresentModes2EXT = (PFN_vkGetDeviceGroupSurfacePresentModes2EXT)load(context, "vkGetDeviceGroupSurfacePresentModes2EXT"); +#endif /* defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) */ +#if defined(VK_EXT_hdr_metadata) + vkSetHdrMetadataEXT = (PFN_vkSetHdrMetadataEXT)load(context, "vkSetHdrMetadataEXT"); +#endif /* defined(VK_EXT_hdr_metadata) */ +#if defined(VK_EXT_host_image_copy) + vkCopyImageToImageEXT = (PFN_vkCopyImageToImageEXT)load(context, "vkCopyImageToImageEXT"); + vkCopyImageToMemoryEXT = (PFN_vkCopyImageToMemoryEXT)load(context, "vkCopyImageToMemoryEXT"); + vkCopyMemoryToImageEXT = (PFN_vkCopyMemoryToImageEXT)load(context, "vkCopyMemoryToImageEXT"); + vkTransitionImageLayoutEXT = (PFN_vkTransitionImageLayoutEXT)load(context, "vkTransitionImageLayoutEXT"); +#endif /* defined(VK_EXT_host_image_copy) */ +#if defined(VK_EXT_host_query_reset) + vkResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT)load(context, "vkResetQueryPoolEXT"); +#endif /* defined(VK_EXT_host_query_reset) */ +#if defined(VK_EXT_image_drm_format_modifier) + vkGetImageDrmFormatModifierPropertiesEXT = (PFN_vkGetImageDrmFormatModifierPropertiesEXT)load(context, "vkGetImageDrmFormatModifierPropertiesEXT"); +#endif /* defined(VK_EXT_image_drm_format_modifier) */ +#if defined(VK_EXT_line_rasterization) + vkCmdSetLineStippleEXT = (PFN_vkCmdSetLineStippleEXT)load(context, "vkCmdSetLineStippleEXT"); +#endif /* defined(VK_EXT_line_rasterization) */ +#if defined(VK_EXT_mesh_shader) + vkCmdDrawMeshTasksEXT = (PFN_vkCmdDrawMeshTasksEXT)load(context, "vkCmdDrawMeshTasksEXT"); + vkCmdDrawMeshTasksIndirectCountEXT = (PFN_vkCmdDrawMeshTasksIndirectCountEXT)load(context, "vkCmdDrawMeshTasksIndirectCountEXT"); + vkCmdDrawMeshTasksIndirectEXT = (PFN_vkCmdDrawMeshTasksIndirectEXT)load(context, "vkCmdDrawMeshTasksIndirectEXT"); +#endif /* defined(VK_EXT_mesh_shader) */ +#if defined(VK_EXT_metal_objects) + vkExportMetalObjectsEXT = (PFN_vkExportMetalObjectsEXT)load(context, "vkExportMetalObjectsEXT"); +#endif /* defined(VK_EXT_metal_objects) */ +#if defined(VK_EXT_multi_draw) + vkCmdDrawMultiEXT = (PFN_vkCmdDrawMultiEXT)load(context, "vkCmdDrawMultiEXT"); + vkCmdDrawMultiIndexedEXT = (PFN_vkCmdDrawMultiIndexedEXT)load(context, "vkCmdDrawMultiIndexedEXT"); +#endif /* defined(VK_EXT_multi_draw) */ +#if defined(VK_EXT_opacity_micromap) + vkBuildMicromapsEXT = (PFN_vkBuildMicromapsEXT)load(context, "vkBuildMicromapsEXT"); + vkCmdBuildMicromapsEXT = (PFN_vkCmdBuildMicromapsEXT)load(context, "vkCmdBuildMicromapsEXT"); + vkCmdCopyMemoryToMicromapEXT = (PFN_vkCmdCopyMemoryToMicromapEXT)load(context, "vkCmdCopyMemoryToMicromapEXT"); + vkCmdCopyMicromapEXT = (PFN_vkCmdCopyMicromapEXT)load(context, "vkCmdCopyMicromapEXT"); + vkCmdCopyMicromapToMemoryEXT = (PFN_vkCmdCopyMicromapToMemoryEXT)load(context, "vkCmdCopyMicromapToMemoryEXT"); + vkCmdWriteMicromapsPropertiesEXT = (PFN_vkCmdWriteMicromapsPropertiesEXT)load(context, "vkCmdWriteMicromapsPropertiesEXT"); + vkCopyMemoryToMicromapEXT = (PFN_vkCopyMemoryToMicromapEXT)load(context, "vkCopyMemoryToMicromapEXT"); + vkCopyMicromapEXT = (PFN_vkCopyMicromapEXT)load(context, "vkCopyMicromapEXT"); + vkCopyMicromapToMemoryEXT = (PFN_vkCopyMicromapToMemoryEXT)load(context, "vkCopyMicromapToMemoryEXT"); + vkCreateMicromapEXT = (PFN_vkCreateMicromapEXT)load(context, "vkCreateMicromapEXT"); + vkDestroyMicromapEXT = (PFN_vkDestroyMicromapEXT)load(context, "vkDestroyMicromapEXT"); + vkGetDeviceMicromapCompatibilityEXT = (PFN_vkGetDeviceMicromapCompatibilityEXT)load(context, "vkGetDeviceMicromapCompatibilityEXT"); + vkGetMicromapBuildSizesEXT = (PFN_vkGetMicromapBuildSizesEXT)load(context, "vkGetMicromapBuildSizesEXT"); + vkWriteMicromapsPropertiesEXT = (PFN_vkWriteMicromapsPropertiesEXT)load(context, "vkWriteMicromapsPropertiesEXT"); +#endif /* defined(VK_EXT_opacity_micromap) */ +#if defined(VK_EXT_pageable_device_local_memory) + vkSetDeviceMemoryPriorityEXT = (PFN_vkSetDeviceMemoryPriorityEXT)load(context, "vkSetDeviceMemoryPriorityEXT"); +#endif /* defined(VK_EXT_pageable_device_local_memory) */ +#if defined(VK_EXT_pipeline_properties) + vkGetPipelinePropertiesEXT = (PFN_vkGetPipelinePropertiesEXT)load(context, "vkGetPipelinePropertiesEXT"); +#endif /* defined(VK_EXT_pipeline_properties) */ +#if defined(VK_EXT_private_data) + vkCreatePrivateDataSlotEXT = (PFN_vkCreatePrivateDataSlotEXT)load(context, "vkCreatePrivateDataSlotEXT"); + vkDestroyPrivateDataSlotEXT = (PFN_vkDestroyPrivateDataSlotEXT)load(context, "vkDestroyPrivateDataSlotEXT"); + vkGetPrivateDataEXT = (PFN_vkGetPrivateDataEXT)load(context, "vkGetPrivateDataEXT"); + vkSetPrivateDataEXT = (PFN_vkSetPrivateDataEXT)load(context, "vkSetPrivateDataEXT"); +#endif /* defined(VK_EXT_private_data) */ +#if defined(VK_EXT_sample_locations) + vkCmdSetSampleLocationsEXT = (PFN_vkCmdSetSampleLocationsEXT)load(context, "vkCmdSetSampleLocationsEXT"); +#endif /* defined(VK_EXT_sample_locations) */ +#if defined(VK_EXT_shader_module_identifier) + vkGetShaderModuleCreateInfoIdentifierEXT = (PFN_vkGetShaderModuleCreateInfoIdentifierEXT)load(context, "vkGetShaderModuleCreateInfoIdentifierEXT"); + vkGetShaderModuleIdentifierEXT = (PFN_vkGetShaderModuleIdentifierEXT)load(context, "vkGetShaderModuleIdentifierEXT"); +#endif /* defined(VK_EXT_shader_module_identifier) */ +#if defined(VK_EXT_shader_object) + vkCmdBindShadersEXT = (PFN_vkCmdBindShadersEXT)load(context, "vkCmdBindShadersEXT"); + vkCreateShadersEXT = (PFN_vkCreateShadersEXT)load(context, "vkCreateShadersEXT"); + vkDestroyShaderEXT = (PFN_vkDestroyShaderEXT)load(context, "vkDestroyShaderEXT"); + vkGetShaderBinaryDataEXT = (PFN_vkGetShaderBinaryDataEXT)load(context, "vkGetShaderBinaryDataEXT"); +#endif /* defined(VK_EXT_shader_object) */ +#if defined(VK_EXT_swapchain_maintenance1) + vkReleaseSwapchainImagesEXT = (PFN_vkReleaseSwapchainImagesEXT)load(context, "vkReleaseSwapchainImagesEXT"); +#endif /* defined(VK_EXT_swapchain_maintenance1) */ +#if defined(VK_EXT_transform_feedback) + vkCmdBeginQueryIndexedEXT = (PFN_vkCmdBeginQueryIndexedEXT)load(context, "vkCmdBeginQueryIndexedEXT"); + vkCmdBeginTransformFeedbackEXT = (PFN_vkCmdBeginTransformFeedbackEXT)load(context, "vkCmdBeginTransformFeedbackEXT"); + vkCmdBindTransformFeedbackBuffersEXT = (PFN_vkCmdBindTransformFeedbackBuffersEXT)load(context, "vkCmdBindTransformFeedbackBuffersEXT"); + vkCmdDrawIndirectByteCountEXT = (PFN_vkCmdDrawIndirectByteCountEXT)load(context, "vkCmdDrawIndirectByteCountEXT"); + vkCmdEndQueryIndexedEXT = (PFN_vkCmdEndQueryIndexedEXT)load(context, "vkCmdEndQueryIndexedEXT"); + vkCmdEndTransformFeedbackEXT = (PFN_vkCmdEndTransformFeedbackEXT)load(context, "vkCmdEndTransformFeedbackEXT"); +#endif /* defined(VK_EXT_transform_feedback) */ +#if defined(VK_EXT_validation_cache) + vkCreateValidationCacheEXT = (PFN_vkCreateValidationCacheEXT)load(context, "vkCreateValidationCacheEXT"); + vkDestroyValidationCacheEXT = (PFN_vkDestroyValidationCacheEXT)load(context, "vkDestroyValidationCacheEXT"); + vkGetValidationCacheDataEXT = (PFN_vkGetValidationCacheDataEXT)load(context, "vkGetValidationCacheDataEXT"); + vkMergeValidationCachesEXT = (PFN_vkMergeValidationCachesEXT)load(context, "vkMergeValidationCachesEXT"); +#endif /* defined(VK_EXT_validation_cache) */ +#if defined(VK_FUCHSIA_buffer_collection) + vkCreateBufferCollectionFUCHSIA = (PFN_vkCreateBufferCollectionFUCHSIA)load(context, "vkCreateBufferCollectionFUCHSIA"); + vkDestroyBufferCollectionFUCHSIA = (PFN_vkDestroyBufferCollectionFUCHSIA)load(context, "vkDestroyBufferCollectionFUCHSIA"); + vkGetBufferCollectionPropertiesFUCHSIA = (PFN_vkGetBufferCollectionPropertiesFUCHSIA)load(context, "vkGetBufferCollectionPropertiesFUCHSIA"); + vkSetBufferCollectionBufferConstraintsFUCHSIA = (PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA)load(context, "vkSetBufferCollectionBufferConstraintsFUCHSIA"); + vkSetBufferCollectionImageConstraintsFUCHSIA = (PFN_vkSetBufferCollectionImageConstraintsFUCHSIA)load(context, "vkSetBufferCollectionImageConstraintsFUCHSIA"); +#endif /* defined(VK_FUCHSIA_buffer_collection) */ +#if defined(VK_FUCHSIA_external_memory) + vkGetMemoryZirconHandleFUCHSIA = (PFN_vkGetMemoryZirconHandleFUCHSIA)load(context, "vkGetMemoryZirconHandleFUCHSIA"); + vkGetMemoryZirconHandlePropertiesFUCHSIA = (PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)load(context, "vkGetMemoryZirconHandlePropertiesFUCHSIA"); +#endif /* defined(VK_FUCHSIA_external_memory) */ +#if defined(VK_FUCHSIA_external_semaphore) + vkGetSemaphoreZirconHandleFUCHSIA = (PFN_vkGetSemaphoreZirconHandleFUCHSIA)load(context, "vkGetSemaphoreZirconHandleFUCHSIA"); + vkImportSemaphoreZirconHandleFUCHSIA = (PFN_vkImportSemaphoreZirconHandleFUCHSIA)load(context, "vkImportSemaphoreZirconHandleFUCHSIA"); +#endif /* defined(VK_FUCHSIA_external_semaphore) */ +#if defined(VK_GOOGLE_display_timing) + vkGetPastPresentationTimingGOOGLE = (PFN_vkGetPastPresentationTimingGOOGLE)load(context, "vkGetPastPresentationTimingGOOGLE"); + vkGetRefreshCycleDurationGOOGLE = (PFN_vkGetRefreshCycleDurationGOOGLE)load(context, "vkGetRefreshCycleDurationGOOGLE"); +#endif /* defined(VK_GOOGLE_display_timing) */ +#if defined(VK_HUAWEI_cluster_culling_shader) + vkCmdDrawClusterHUAWEI = (PFN_vkCmdDrawClusterHUAWEI)load(context, "vkCmdDrawClusterHUAWEI"); + vkCmdDrawClusterIndirectHUAWEI = (PFN_vkCmdDrawClusterIndirectHUAWEI)load(context, "vkCmdDrawClusterIndirectHUAWEI"); +#endif /* defined(VK_HUAWEI_cluster_culling_shader) */ +#if defined(VK_HUAWEI_invocation_mask) + vkCmdBindInvocationMaskHUAWEI = (PFN_vkCmdBindInvocationMaskHUAWEI)load(context, "vkCmdBindInvocationMaskHUAWEI"); +#endif /* defined(VK_HUAWEI_invocation_mask) */ +#if defined(VK_HUAWEI_subpass_shading) + vkCmdSubpassShadingHUAWEI = (PFN_vkCmdSubpassShadingHUAWEI)load(context, "vkCmdSubpassShadingHUAWEI"); + vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI = (PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI)load(context, "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI"); +#endif /* defined(VK_HUAWEI_subpass_shading) */ +#if defined(VK_INTEL_performance_query) + vkAcquirePerformanceConfigurationINTEL = (PFN_vkAcquirePerformanceConfigurationINTEL)load(context, "vkAcquirePerformanceConfigurationINTEL"); + vkCmdSetPerformanceMarkerINTEL = (PFN_vkCmdSetPerformanceMarkerINTEL)load(context, "vkCmdSetPerformanceMarkerINTEL"); + vkCmdSetPerformanceOverrideINTEL = (PFN_vkCmdSetPerformanceOverrideINTEL)load(context, "vkCmdSetPerformanceOverrideINTEL"); + vkCmdSetPerformanceStreamMarkerINTEL = (PFN_vkCmdSetPerformanceStreamMarkerINTEL)load(context, "vkCmdSetPerformanceStreamMarkerINTEL"); + vkGetPerformanceParameterINTEL = (PFN_vkGetPerformanceParameterINTEL)load(context, "vkGetPerformanceParameterINTEL"); + vkInitializePerformanceApiINTEL = (PFN_vkInitializePerformanceApiINTEL)load(context, "vkInitializePerformanceApiINTEL"); + vkQueueSetPerformanceConfigurationINTEL = (PFN_vkQueueSetPerformanceConfigurationINTEL)load(context, "vkQueueSetPerformanceConfigurationINTEL"); + vkReleasePerformanceConfigurationINTEL = (PFN_vkReleasePerformanceConfigurationINTEL)load(context, "vkReleasePerformanceConfigurationINTEL"); + vkUninitializePerformanceApiINTEL = (PFN_vkUninitializePerformanceApiINTEL)load(context, "vkUninitializePerformanceApiINTEL"); +#endif /* defined(VK_INTEL_performance_query) */ +#if defined(VK_KHR_acceleration_structure) + vkBuildAccelerationStructuresKHR = (PFN_vkBuildAccelerationStructuresKHR)load(context, "vkBuildAccelerationStructuresKHR"); + vkCmdBuildAccelerationStructuresIndirectKHR = (PFN_vkCmdBuildAccelerationStructuresIndirectKHR)load(context, "vkCmdBuildAccelerationStructuresIndirectKHR"); + vkCmdBuildAccelerationStructuresKHR = (PFN_vkCmdBuildAccelerationStructuresKHR)load(context, "vkCmdBuildAccelerationStructuresKHR"); + vkCmdCopyAccelerationStructureKHR = (PFN_vkCmdCopyAccelerationStructureKHR)load(context, "vkCmdCopyAccelerationStructureKHR"); + vkCmdCopyAccelerationStructureToMemoryKHR = (PFN_vkCmdCopyAccelerationStructureToMemoryKHR)load(context, "vkCmdCopyAccelerationStructureToMemoryKHR"); + vkCmdCopyMemoryToAccelerationStructureKHR = (PFN_vkCmdCopyMemoryToAccelerationStructureKHR)load(context, "vkCmdCopyMemoryToAccelerationStructureKHR"); + vkCmdWriteAccelerationStructuresPropertiesKHR = (PFN_vkCmdWriteAccelerationStructuresPropertiesKHR)load(context, "vkCmdWriteAccelerationStructuresPropertiesKHR"); + vkCopyAccelerationStructureKHR = (PFN_vkCopyAccelerationStructureKHR)load(context, "vkCopyAccelerationStructureKHR"); + vkCopyAccelerationStructureToMemoryKHR = (PFN_vkCopyAccelerationStructureToMemoryKHR)load(context, "vkCopyAccelerationStructureToMemoryKHR"); + vkCopyMemoryToAccelerationStructureKHR = (PFN_vkCopyMemoryToAccelerationStructureKHR)load(context, "vkCopyMemoryToAccelerationStructureKHR"); + vkCreateAccelerationStructureKHR = (PFN_vkCreateAccelerationStructureKHR)load(context, "vkCreateAccelerationStructureKHR"); + vkDestroyAccelerationStructureKHR = (PFN_vkDestroyAccelerationStructureKHR)load(context, "vkDestroyAccelerationStructureKHR"); + vkGetAccelerationStructureBuildSizesKHR = (PFN_vkGetAccelerationStructureBuildSizesKHR)load(context, "vkGetAccelerationStructureBuildSizesKHR"); + vkGetAccelerationStructureDeviceAddressKHR = (PFN_vkGetAccelerationStructureDeviceAddressKHR)load(context, "vkGetAccelerationStructureDeviceAddressKHR"); + vkGetDeviceAccelerationStructureCompatibilityKHR = (PFN_vkGetDeviceAccelerationStructureCompatibilityKHR)load(context, "vkGetDeviceAccelerationStructureCompatibilityKHR"); + vkWriteAccelerationStructuresPropertiesKHR = (PFN_vkWriteAccelerationStructuresPropertiesKHR)load(context, "vkWriteAccelerationStructuresPropertiesKHR"); +#endif /* defined(VK_KHR_acceleration_structure) */ +#if defined(VK_KHR_bind_memory2) + vkBindBufferMemory2KHR = (PFN_vkBindBufferMemory2KHR)load(context, "vkBindBufferMemory2KHR"); + vkBindImageMemory2KHR = (PFN_vkBindImageMemory2KHR)load(context, "vkBindImageMemory2KHR"); +#endif /* defined(VK_KHR_bind_memory2) */ +#if defined(VK_KHR_buffer_device_address) + vkGetBufferDeviceAddressKHR = (PFN_vkGetBufferDeviceAddressKHR)load(context, "vkGetBufferDeviceAddressKHR"); + vkGetBufferOpaqueCaptureAddressKHR = (PFN_vkGetBufferOpaqueCaptureAddressKHR)load(context, "vkGetBufferOpaqueCaptureAddressKHR"); + vkGetDeviceMemoryOpaqueCaptureAddressKHR = (PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR)load(context, "vkGetDeviceMemoryOpaqueCaptureAddressKHR"); +#endif /* defined(VK_KHR_buffer_device_address) */ +#if defined(VK_KHR_calibrated_timestamps) + vkGetCalibratedTimestampsKHR = (PFN_vkGetCalibratedTimestampsKHR)load(context, "vkGetCalibratedTimestampsKHR"); +#endif /* defined(VK_KHR_calibrated_timestamps) */ +#if defined(VK_KHR_copy_commands2) + vkCmdBlitImage2KHR = (PFN_vkCmdBlitImage2KHR)load(context, "vkCmdBlitImage2KHR"); + vkCmdCopyBuffer2KHR = (PFN_vkCmdCopyBuffer2KHR)load(context, "vkCmdCopyBuffer2KHR"); + vkCmdCopyBufferToImage2KHR = (PFN_vkCmdCopyBufferToImage2KHR)load(context, "vkCmdCopyBufferToImage2KHR"); + vkCmdCopyImage2KHR = (PFN_vkCmdCopyImage2KHR)load(context, "vkCmdCopyImage2KHR"); + vkCmdCopyImageToBuffer2KHR = (PFN_vkCmdCopyImageToBuffer2KHR)load(context, "vkCmdCopyImageToBuffer2KHR"); + vkCmdResolveImage2KHR = (PFN_vkCmdResolveImage2KHR)load(context, "vkCmdResolveImage2KHR"); +#endif /* defined(VK_KHR_copy_commands2) */ +#if defined(VK_KHR_create_renderpass2) + vkCmdBeginRenderPass2KHR = (PFN_vkCmdBeginRenderPass2KHR)load(context, "vkCmdBeginRenderPass2KHR"); + vkCmdEndRenderPass2KHR = (PFN_vkCmdEndRenderPass2KHR)load(context, "vkCmdEndRenderPass2KHR"); + vkCmdNextSubpass2KHR = (PFN_vkCmdNextSubpass2KHR)load(context, "vkCmdNextSubpass2KHR"); + vkCreateRenderPass2KHR = (PFN_vkCreateRenderPass2KHR)load(context, "vkCreateRenderPass2KHR"); +#endif /* defined(VK_KHR_create_renderpass2) */ +#if defined(VK_KHR_deferred_host_operations) + vkCreateDeferredOperationKHR = (PFN_vkCreateDeferredOperationKHR)load(context, "vkCreateDeferredOperationKHR"); + vkDeferredOperationJoinKHR = (PFN_vkDeferredOperationJoinKHR)load(context, "vkDeferredOperationJoinKHR"); + vkDestroyDeferredOperationKHR = (PFN_vkDestroyDeferredOperationKHR)load(context, "vkDestroyDeferredOperationKHR"); + vkGetDeferredOperationMaxConcurrencyKHR = (PFN_vkGetDeferredOperationMaxConcurrencyKHR)load(context, "vkGetDeferredOperationMaxConcurrencyKHR"); + vkGetDeferredOperationResultKHR = (PFN_vkGetDeferredOperationResultKHR)load(context, "vkGetDeferredOperationResultKHR"); +#endif /* defined(VK_KHR_deferred_host_operations) */ +#if defined(VK_KHR_descriptor_update_template) + vkCreateDescriptorUpdateTemplateKHR = (PFN_vkCreateDescriptorUpdateTemplateKHR)load(context, "vkCreateDescriptorUpdateTemplateKHR"); + vkDestroyDescriptorUpdateTemplateKHR = (PFN_vkDestroyDescriptorUpdateTemplateKHR)load(context, "vkDestroyDescriptorUpdateTemplateKHR"); + vkUpdateDescriptorSetWithTemplateKHR = (PFN_vkUpdateDescriptorSetWithTemplateKHR)load(context, "vkUpdateDescriptorSetWithTemplateKHR"); +#endif /* defined(VK_KHR_descriptor_update_template) */ +#if defined(VK_KHR_device_group) + vkCmdDispatchBaseKHR = (PFN_vkCmdDispatchBaseKHR)load(context, "vkCmdDispatchBaseKHR"); + vkCmdSetDeviceMaskKHR = (PFN_vkCmdSetDeviceMaskKHR)load(context, "vkCmdSetDeviceMaskKHR"); + vkGetDeviceGroupPeerMemoryFeaturesKHR = (PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR)load(context, "vkGetDeviceGroupPeerMemoryFeaturesKHR"); +#endif /* defined(VK_KHR_device_group) */ +#if defined(VK_KHR_display_swapchain) + vkCreateSharedSwapchainsKHR = (PFN_vkCreateSharedSwapchainsKHR)load(context, "vkCreateSharedSwapchainsKHR"); +#endif /* defined(VK_KHR_display_swapchain) */ +#if defined(VK_KHR_draw_indirect_count) + vkCmdDrawIndexedIndirectCountKHR = (PFN_vkCmdDrawIndexedIndirectCountKHR)load(context, "vkCmdDrawIndexedIndirectCountKHR"); + vkCmdDrawIndirectCountKHR = (PFN_vkCmdDrawIndirectCountKHR)load(context, "vkCmdDrawIndirectCountKHR"); +#endif /* defined(VK_KHR_draw_indirect_count) */ +#if defined(VK_KHR_dynamic_rendering) + vkCmdBeginRenderingKHR = (PFN_vkCmdBeginRenderingKHR)load(context, "vkCmdBeginRenderingKHR"); + vkCmdEndRenderingKHR = (PFN_vkCmdEndRenderingKHR)load(context, "vkCmdEndRenderingKHR"); +#endif /* defined(VK_KHR_dynamic_rendering) */ +#if defined(VK_KHR_dynamic_rendering_local_read) + vkCmdSetRenderingAttachmentLocationsKHR = (PFN_vkCmdSetRenderingAttachmentLocationsKHR)load(context, "vkCmdSetRenderingAttachmentLocationsKHR"); + vkCmdSetRenderingInputAttachmentIndicesKHR = (PFN_vkCmdSetRenderingInputAttachmentIndicesKHR)load(context, "vkCmdSetRenderingInputAttachmentIndicesKHR"); +#endif /* defined(VK_KHR_dynamic_rendering_local_read) */ +#if defined(VK_KHR_external_fence_fd) + vkGetFenceFdKHR = (PFN_vkGetFenceFdKHR)load(context, "vkGetFenceFdKHR"); + vkImportFenceFdKHR = (PFN_vkImportFenceFdKHR)load(context, "vkImportFenceFdKHR"); +#endif /* defined(VK_KHR_external_fence_fd) */ +#if defined(VK_KHR_external_fence_win32) + vkGetFenceWin32HandleKHR = (PFN_vkGetFenceWin32HandleKHR)load(context, "vkGetFenceWin32HandleKHR"); + vkImportFenceWin32HandleKHR = (PFN_vkImportFenceWin32HandleKHR)load(context, "vkImportFenceWin32HandleKHR"); +#endif /* defined(VK_KHR_external_fence_win32) */ +#if defined(VK_KHR_external_memory_fd) + vkGetMemoryFdKHR = (PFN_vkGetMemoryFdKHR)load(context, "vkGetMemoryFdKHR"); + vkGetMemoryFdPropertiesKHR = (PFN_vkGetMemoryFdPropertiesKHR)load(context, "vkGetMemoryFdPropertiesKHR"); +#endif /* defined(VK_KHR_external_memory_fd) */ +#if defined(VK_KHR_external_memory_win32) + vkGetMemoryWin32HandleKHR = (PFN_vkGetMemoryWin32HandleKHR)load(context, "vkGetMemoryWin32HandleKHR"); + vkGetMemoryWin32HandlePropertiesKHR = (PFN_vkGetMemoryWin32HandlePropertiesKHR)load(context, "vkGetMemoryWin32HandlePropertiesKHR"); +#endif /* defined(VK_KHR_external_memory_win32) */ +#if defined(VK_KHR_external_semaphore_fd) + vkGetSemaphoreFdKHR = (PFN_vkGetSemaphoreFdKHR)load(context, "vkGetSemaphoreFdKHR"); + vkImportSemaphoreFdKHR = (PFN_vkImportSemaphoreFdKHR)load(context, "vkImportSemaphoreFdKHR"); +#endif /* defined(VK_KHR_external_semaphore_fd) */ +#if defined(VK_KHR_external_semaphore_win32) + vkGetSemaphoreWin32HandleKHR = (PFN_vkGetSemaphoreWin32HandleKHR)load(context, "vkGetSemaphoreWin32HandleKHR"); + vkImportSemaphoreWin32HandleKHR = (PFN_vkImportSemaphoreWin32HandleKHR)load(context, "vkImportSemaphoreWin32HandleKHR"); +#endif /* defined(VK_KHR_external_semaphore_win32) */ +#if defined(VK_KHR_fragment_shading_rate) + vkCmdSetFragmentShadingRateKHR = (PFN_vkCmdSetFragmentShadingRateKHR)load(context, "vkCmdSetFragmentShadingRateKHR"); +#endif /* defined(VK_KHR_fragment_shading_rate) */ +#if defined(VK_KHR_get_memory_requirements2) + vkGetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR)load(context, "vkGetBufferMemoryRequirements2KHR"); + vkGetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR)load(context, "vkGetImageMemoryRequirements2KHR"); + vkGetImageSparseMemoryRequirements2KHR = (PFN_vkGetImageSparseMemoryRequirements2KHR)load(context, "vkGetImageSparseMemoryRequirements2KHR"); +#endif /* defined(VK_KHR_get_memory_requirements2) */ +#if defined(VK_KHR_line_rasterization) + vkCmdSetLineStippleKHR = (PFN_vkCmdSetLineStippleKHR)load(context, "vkCmdSetLineStippleKHR"); +#endif /* defined(VK_KHR_line_rasterization) */ +#if defined(VK_KHR_maintenance1) + vkTrimCommandPoolKHR = (PFN_vkTrimCommandPoolKHR)load(context, "vkTrimCommandPoolKHR"); +#endif /* defined(VK_KHR_maintenance1) */ +#if defined(VK_KHR_maintenance3) + vkGetDescriptorSetLayoutSupportKHR = (PFN_vkGetDescriptorSetLayoutSupportKHR)load(context, "vkGetDescriptorSetLayoutSupportKHR"); +#endif /* defined(VK_KHR_maintenance3) */ +#if defined(VK_KHR_maintenance4) + vkGetDeviceBufferMemoryRequirementsKHR = (PFN_vkGetDeviceBufferMemoryRequirementsKHR)load(context, "vkGetDeviceBufferMemoryRequirementsKHR"); + vkGetDeviceImageMemoryRequirementsKHR = (PFN_vkGetDeviceImageMemoryRequirementsKHR)load(context, "vkGetDeviceImageMemoryRequirementsKHR"); + vkGetDeviceImageSparseMemoryRequirementsKHR = (PFN_vkGetDeviceImageSparseMemoryRequirementsKHR)load(context, "vkGetDeviceImageSparseMemoryRequirementsKHR"); +#endif /* defined(VK_KHR_maintenance4) */ +#if defined(VK_KHR_maintenance5) + vkCmdBindIndexBuffer2KHR = (PFN_vkCmdBindIndexBuffer2KHR)load(context, "vkCmdBindIndexBuffer2KHR"); + vkGetDeviceImageSubresourceLayoutKHR = (PFN_vkGetDeviceImageSubresourceLayoutKHR)load(context, "vkGetDeviceImageSubresourceLayoutKHR"); + vkGetImageSubresourceLayout2KHR = (PFN_vkGetImageSubresourceLayout2KHR)load(context, "vkGetImageSubresourceLayout2KHR"); + vkGetRenderingAreaGranularityKHR = (PFN_vkGetRenderingAreaGranularityKHR)load(context, "vkGetRenderingAreaGranularityKHR"); +#endif /* defined(VK_KHR_maintenance5) */ +#if defined(VK_KHR_maintenance6) + vkCmdBindDescriptorSets2KHR = (PFN_vkCmdBindDescriptorSets2KHR)load(context, "vkCmdBindDescriptorSets2KHR"); + vkCmdPushConstants2KHR = (PFN_vkCmdPushConstants2KHR)load(context, "vkCmdPushConstants2KHR"); +#endif /* defined(VK_KHR_maintenance6) */ +#if defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) + vkCmdPushDescriptorSet2KHR = (PFN_vkCmdPushDescriptorSet2KHR)load(context, "vkCmdPushDescriptorSet2KHR"); + vkCmdPushDescriptorSetWithTemplate2KHR = (PFN_vkCmdPushDescriptorSetWithTemplate2KHR)load(context, "vkCmdPushDescriptorSetWithTemplate2KHR"); +#endif /* defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) + vkCmdBindDescriptorBufferEmbeddedSamplers2EXT = (PFN_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT)load(context, "vkCmdBindDescriptorBufferEmbeddedSamplers2EXT"); + vkCmdSetDescriptorBufferOffsets2EXT = (PFN_vkCmdSetDescriptorBufferOffsets2EXT)load(context, "vkCmdSetDescriptorBufferOffsets2EXT"); +#endif /* defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_KHR_map_memory2) + vkMapMemory2KHR = (PFN_vkMapMemory2KHR)load(context, "vkMapMemory2KHR"); + vkUnmapMemory2KHR = (PFN_vkUnmapMemory2KHR)load(context, "vkUnmapMemory2KHR"); +#endif /* defined(VK_KHR_map_memory2) */ +#if defined(VK_KHR_performance_query) + vkAcquireProfilingLockKHR = (PFN_vkAcquireProfilingLockKHR)load(context, "vkAcquireProfilingLockKHR"); + vkReleaseProfilingLockKHR = (PFN_vkReleaseProfilingLockKHR)load(context, "vkReleaseProfilingLockKHR"); +#endif /* defined(VK_KHR_performance_query) */ +#if defined(VK_KHR_pipeline_executable_properties) + vkGetPipelineExecutableInternalRepresentationsKHR = (PFN_vkGetPipelineExecutableInternalRepresentationsKHR)load(context, "vkGetPipelineExecutableInternalRepresentationsKHR"); + vkGetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)load(context, "vkGetPipelineExecutablePropertiesKHR"); + vkGetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR)load(context, "vkGetPipelineExecutableStatisticsKHR"); +#endif /* defined(VK_KHR_pipeline_executable_properties) */ +#if defined(VK_KHR_present_wait) + vkWaitForPresentKHR = (PFN_vkWaitForPresentKHR)load(context, "vkWaitForPresentKHR"); +#endif /* defined(VK_KHR_present_wait) */ +#if defined(VK_KHR_push_descriptor) + vkCmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR)load(context, "vkCmdPushDescriptorSetKHR"); +#endif /* defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) + vkCmdTraceRaysIndirect2KHR = (PFN_vkCmdTraceRaysIndirect2KHR)load(context, "vkCmdTraceRaysIndirect2KHR"); +#endif /* defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_ray_tracing_pipeline) + vkCmdSetRayTracingPipelineStackSizeKHR = (PFN_vkCmdSetRayTracingPipelineStackSizeKHR)load(context, "vkCmdSetRayTracingPipelineStackSizeKHR"); + vkCmdTraceRaysIndirectKHR = (PFN_vkCmdTraceRaysIndirectKHR)load(context, "vkCmdTraceRaysIndirectKHR"); + vkCmdTraceRaysKHR = (PFN_vkCmdTraceRaysKHR)load(context, "vkCmdTraceRaysKHR"); + vkCreateRayTracingPipelinesKHR = (PFN_vkCreateRayTracingPipelinesKHR)load(context, "vkCreateRayTracingPipelinesKHR"); + vkGetRayTracingCaptureReplayShaderGroupHandlesKHR = (PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR)load(context, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR"); + vkGetRayTracingShaderGroupHandlesKHR = (PFN_vkGetRayTracingShaderGroupHandlesKHR)load(context, "vkGetRayTracingShaderGroupHandlesKHR"); + vkGetRayTracingShaderGroupStackSizeKHR = (PFN_vkGetRayTracingShaderGroupStackSizeKHR)load(context, "vkGetRayTracingShaderGroupStackSizeKHR"); +#endif /* defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_sampler_ycbcr_conversion) + vkCreateSamplerYcbcrConversionKHR = (PFN_vkCreateSamplerYcbcrConversionKHR)load(context, "vkCreateSamplerYcbcrConversionKHR"); + vkDestroySamplerYcbcrConversionKHR = (PFN_vkDestroySamplerYcbcrConversionKHR)load(context, "vkDestroySamplerYcbcrConversionKHR"); +#endif /* defined(VK_KHR_sampler_ycbcr_conversion) */ +#if defined(VK_KHR_shared_presentable_image) + vkGetSwapchainStatusKHR = (PFN_vkGetSwapchainStatusKHR)load(context, "vkGetSwapchainStatusKHR"); +#endif /* defined(VK_KHR_shared_presentable_image) */ +#if defined(VK_KHR_swapchain) + vkAcquireNextImageKHR = (PFN_vkAcquireNextImageKHR)load(context, "vkAcquireNextImageKHR"); + vkCreateSwapchainKHR = (PFN_vkCreateSwapchainKHR)load(context, "vkCreateSwapchainKHR"); + vkDestroySwapchainKHR = (PFN_vkDestroySwapchainKHR)load(context, "vkDestroySwapchainKHR"); + vkGetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR)load(context, "vkGetSwapchainImagesKHR"); + vkQueuePresentKHR = (PFN_vkQueuePresentKHR)load(context, "vkQueuePresentKHR"); +#endif /* defined(VK_KHR_swapchain) */ +#if defined(VK_KHR_synchronization2) + vkCmdPipelineBarrier2KHR = (PFN_vkCmdPipelineBarrier2KHR)load(context, "vkCmdPipelineBarrier2KHR"); + vkCmdResetEvent2KHR = (PFN_vkCmdResetEvent2KHR)load(context, "vkCmdResetEvent2KHR"); + vkCmdSetEvent2KHR = (PFN_vkCmdSetEvent2KHR)load(context, "vkCmdSetEvent2KHR"); + vkCmdWaitEvents2KHR = (PFN_vkCmdWaitEvents2KHR)load(context, "vkCmdWaitEvents2KHR"); + vkCmdWriteTimestamp2KHR = (PFN_vkCmdWriteTimestamp2KHR)load(context, "vkCmdWriteTimestamp2KHR"); + vkQueueSubmit2KHR = (PFN_vkQueueSubmit2KHR)load(context, "vkQueueSubmit2KHR"); +#endif /* defined(VK_KHR_synchronization2) */ +#if defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) + vkCmdWriteBufferMarker2AMD = (PFN_vkCmdWriteBufferMarker2AMD)load(context, "vkCmdWriteBufferMarker2AMD"); +#endif /* defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) */ +#if defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) + vkGetQueueCheckpointData2NV = (PFN_vkGetQueueCheckpointData2NV)load(context, "vkGetQueueCheckpointData2NV"); +#endif /* defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_KHR_timeline_semaphore) + vkGetSemaphoreCounterValueKHR = (PFN_vkGetSemaphoreCounterValueKHR)load(context, "vkGetSemaphoreCounterValueKHR"); + vkSignalSemaphoreKHR = (PFN_vkSignalSemaphoreKHR)load(context, "vkSignalSemaphoreKHR"); + vkWaitSemaphoresKHR = (PFN_vkWaitSemaphoresKHR)load(context, "vkWaitSemaphoresKHR"); +#endif /* defined(VK_KHR_timeline_semaphore) */ +#if defined(VK_KHR_video_decode_queue) + vkCmdDecodeVideoKHR = (PFN_vkCmdDecodeVideoKHR)load(context, "vkCmdDecodeVideoKHR"); +#endif /* defined(VK_KHR_video_decode_queue) */ +#if defined(VK_KHR_video_encode_queue) + vkCmdEncodeVideoKHR = (PFN_vkCmdEncodeVideoKHR)load(context, "vkCmdEncodeVideoKHR"); + vkGetEncodedVideoSessionParametersKHR = (PFN_vkGetEncodedVideoSessionParametersKHR)load(context, "vkGetEncodedVideoSessionParametersKHR"); +#endif /* defined(VK_KHR_video_encode_queue) */ +#if defined(VK_KHR_video_queue) + vkBindVideoSessionMemoryKHR = (PFN_vkBindVideoSessionMemoryKHR)load(context, "vkBindVideoSessionMemoryKHR"); + vkCmdBeginVideoCodingKHR = (PFN_vkCmdBeginVideoCodingKHR)load(context, "vkCmdBeginVideoCodingKHR"); + vkCmdControlVideoCodingKHR = (PFN_vkCmdControlVideoCodingKHR)load(context, "vkCmdControlVideoCodingKHR"); + vkCmdEndVideoCodingKHR = (PFN_vkCmdEndVideoCodingKHR)load(context, "vkCmdEndVideoCodingKHR"); + vkCreateVideoSessionKHR = (PFN_vkCreateVideoSessionKHR)load(context, "vkCreateVideoSessionKHR"); + vkCreateVideoSessionParametersKHR = (PFN_vkCreateVideoSessionParametersKHR)load(context, "vkCreateVideoSessionParametersKHR"); + vkDestroyVideoSessionKHR = (PFN_vkDestroyVideoSessionKHR)load(context, "vkDestroyVideoSessionKHR"); + vkDestroyVideoSessionParametersKHR = (PFN_vkDestroyVideoSessionParametersKHR)load(context, "vkDestroyVideoSessionParametersKHR"); + vkGetVideoSessionMemoryRequirementsKHR = (PFN_vkGetVideoSessionMemoryRequirementsKHR)load(context, "vkGetVideoSessionMemoryRequirementsKHR"); + vkUpdateVideoSessionParametersKHR = (PFN_vkUpdateVideoSessionParametersKHR)load(context, "vkUpdateVideoSessionParametersKHR"); +#endif /* defined(VK_KHR_video_queue) */ +#if defined(VK_NVX_binary_import) + vkCmdCuLaunchKernelNVX = (PFN_vkCmdCuLaunchKernelNVX)load(context, "vkCmdCuLaunchKernelNVX"); + vkCreateCuFunctionNVX = (PFN_vkCreateCuFunctionNVX)load(context, "vkCreateCuFunctionNVX"); + vkCreateCuModuleNVX = (PFN_vkCreateCuModuleNVX)load(context, "vkCreateCuModuleNVX"); + vkDestroyCuFunctionNVX = (PFN_vkDestroyCuFunctionNVX)load(context, "vkDestroyCuFunctionNVX"); + vkDestroyCuModuleNVX = (PFN_vkDestroyCuModuleNVX)load(context, "vkDestroyCuModuleNVX"); +#endif /* defined(VK_NVX_binary_import) */ +#if defined(VK_NVX_image_view_handle) + vkGetImageViewAddressNVX = (PFN_vkGetImageViewAddressNVX)load(context, "vkGetImageViewAddressNVX"); + vkGetImageViewHandleNVX = (PFN_vkGetImageViewHandleNVX)load(context, "vkGetImageViewHandleNVX"); +#endif /* defined(VK_NVX_image_view_handle) */ +#if defined(VK_NV_clip_space_w_scaling) + vkCmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV)load(context, "vkCmdSetViewportWScalingNV"); +#endif /* defined(VK_NV_clip_space_w_scaling) */ +#if defined(VK_NV_copy_memory_indirect) + vkCmdCopyMemoryIndirectNV = (PFN_vkCmdCopyMemoryIndirectNV)load(context, "vkCmdCopyMemoryIndirectNV"); + vkCmdCopyMemoryToImageIndirectNV = (PFN_vkCmdCopyMemoryToImageIndirectNV)load(context, "vkCmdCopyMemoryToImageIndirectNV"); +#endif /* defined(VK_NV_copy_memory_indirect) */ +#if defined(VK_NV_cuda_kernel_launch) + vkCmdCudaLaunchKernelNV = (PFN_vkCmdCudaLaunchKernelNV)load(context, "vkCmdCudaLaunchKernelNV"); + vkCreateCudaFunctionNV = (PFN_vkCreateCudaFunctionNV)load(context, "vkCreateCudaFunctionNV"); + vkCreateCudaModuleNV = (PFN_vkCreateCudaModuleNV)load(context, "vkCreateCudaModuleNV"); + vkDestroyCudaFunctionNV = (PFN_vkDestroyCudaFunctionNV)load(context, "vkDestroyCudaFunctionNV"); + vkDestroyCudaModuleNV = (PFN_vkDestroyCudaModuleNV)load(context, "vkDestroyCudaModuleNV"); + vkGetCudaModuleCacheNV = (PFN_vkGetCudaModuleCacheNV)load(context, "vkGetCudaModuleCacheNV"); +#endif /* defined(VK_NV_cuda_kernel_launch) */ +#if defined(VK_NV_device_diagnostic_checkpoints) + vkCmdSetCheckpointNV = (PFN_vkCmdSetCheckpointNV)load(context, "vkCmdSetCheckpointNV"); + vkGetQueueCheckpointDataNV = (PFN_vkGetQueueCheckpointDataNV)load(context, "vkGetQueueCheckpointDataNV"); +#endif /* defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_NV_device_generated_commands) + vkCmdBindPipelineShaderGroupNV = (PFN_vkCmdBindPipelineShaderGroupNV)load(context, "vkCmdBindPipelineShaderGroupNV"); + vkCmdExecuteGeneratedCommandsNV = (PFN_vkCmdExecuteGeneratedCommandsNV)load(context, "vkCmdExecuteGeneratedCommandsNV"); + vkCmdPreprocessGeneratedCommandsNV = (PFN_vkCmdPreprocessGeneratedCommandsNV)load(context, "vkCmdPreprocessGeneratedCommandsNV"); + vkCreateIndirectCommandsLayoutNV = (PFN_vkCreateIndirectCommandsLayoutNV)load(context, "vkCreateIndirectCommandsLayoutNV"); + vkDestroyIndirectCommandsLayoutNV = (PFN_vkDestroyIndirectCommandsLayoutNV)load(context, "vkDestroyIndirectCommandsLayoutNV"); + vkGetGeneratedCommandsMemoryRequirementsNV = (PFN_vkGetGeneratedCommandsMemoryRequirementsNV)load(context, "vkGetGeneratedCommandsMemoryRequirementsNV"); +#endif /* defined(VK_NV_device_generated_commands) */ +#if defined(VK_NV_device_generated_commands_compute) + vkCmdUpdatePipelineIndirectBufferNV = (PFN_vkCmdUpdatePipelineIndirectBufferNV)load(context, "vkCmdUpdatePipelineIndirectBufferNV"); + vkGetPipelineIndirectDeviceAddressNV = (PFN_vkGetPipelineIndirectDeviceAddressNV)load(context, "vkGetPipelineIndirectDeviceAddressNV"); + vkGetPipelineIndirectMemoryRequirementsNV = (PFN_vkGetPipelineIndirectMemoryRequirementsNV)load(context, "vkGetPipelineIndirectMemoryRequirementsNV"); +#endif /* defined(VK_NV_device_generated_commands_compute) */ +#if defined(VK_NV_external_memory_rdma) + vkGetMemoryRemoteAddressNV = (PFN_vkGetMemoryRemoteAddressNV)load(context, "vkGetMemoryRemoteAddressNV"); +#endif /* defined(VK_NV_external_memory_rdma) */ +#if defined(VK_NV_external_memory_win32) + vkGetMemoryWin32HandleNV = (PFN_vkGetMemoryWin32HandleNV)load(context, "vkGetMemoryWin32HandleNV"); +#endif /* defined(VK_NV_external_memory_win32) */ +#if defined(VK_NV_fragment_shading_rate_enums) + vkCmdSetFragmentShadingRateEnumNV = (PFN_vkCmdSetFragmentShadingRateEnumNV)load(context, "vkCmdSetFragmentShadingRateEnumNV"); +#endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) + vkGetLatencyTimingsNV = (PFN_vkGetLatencyTimingsNV)load(context, "vkGetLatencyTimingsNV"); + vkLatencySleepNV = (PFN_vkLatencySleepNV)load(context, "vkLatencySleepNV"); + vkQueueNotifyOutOfBandNV = (PFN_vkQueueNotifyOutOfBandNV)load(context, "vkQueueNotifyOutOfBandNV"); + vkSetLatencyMarkerNV = (PFN_vkSetLatencyMarkerNV)load(context, "vkSetLatencyMarkerNV"); + vkSetLatencySleepModeNV = (PFN_vkSetLatencySleepModeNV)load(context, "vkSetLatencySleepModeNV"); +#endif /* defined(VK_NV_low_latency2) */ +#if defined(VK_NV_memory_decompression) + vkCmdDecompressMemoryIndirectCountNV = (PFN_vkCmdDecompressMemoryIndirectCountNV)load(context, "vkCmdDecompressMemoryIndirectCountNV"); + vkCmdDecompressMemoryNV = (PFN_vkCmdDecompressMemoryNV)load(context, "vkCmdDecompressMemoryNV"); +#endif /* defined(VK_NV_memory_decompression) */ +#if defined(VK_NV_mesh_shader) + vkCmdDrawMeshTasksIndirectCountNV = (PFN_vkCmdDrawMeshTasksIndirectCountNV)load(context, "vkCmdDrawMeshTasksIndirectCountNV"); + vkCmdDrawMeshTasksIndirectNV = (PFN_vkCmdDrawMeshTasksIndirectNV)load(context, "vkCmdDrawMeshTasksIndirectNV"); + vkCmdDrawMeshTasksNV = (PFN_vkCmdDrawMeshTasksNV)load(context, "vkCmdDrawMeshTasksNV"); +#endif /* defined(VK_NV_mesh_shader) */ +#if defined(VK_NV_optical_flow) + vkBindOpticalFlowSessionImageNV = (PFN_vkBindOpticalFlowSessionImageNV)load(context, "vkBindOpticalFlowSessionImageNV"); + vkCmdOpticalFlowExecuteNV = (PFN_vkCmdOpticalFlowExecuteNV)load(context, "vkCmdOpticalFlowExecuteNV"); + vkCreateOpticalFlowSessionNV = (PFN_vkCreateOpticalFlowSessionNV)load(context, "vkCreateOpticalFlowSessionNV"); + vkDestroyOpticalFlowSessionNV = (PFN_vkDestroyOpticalFlowSessionNV)load(context, "vkDestroyOpticalFlowSessionNV"); +#endif /* defined(VK_NV_optical_flow) */ +#if defined(VK_NV_ray_tracing) + vkBindAccelerationStructureMemoryNV = (PFN_vkBindAccelerationStructureMemoryNV)load(context, "vkBindAccelerationStructureMemoryNV"); + vkCmdBuildAccelerationStructureNV = (PFN_vkCmdBuildAccelerationStructureNV)load(context, "vkCmdBuildAccelerationStructureNV"); + vkCmdCopyAccelerationStructureNV = (PFN_vkCmdCopyAccelerationStructureNV)load(context, "vkCmdCopyAccelerationStructureNV"); + vkCmdTraceRaysNV = (PFN_vkCmdTraceRaysNV)load(context, "vkCmdTraceRaysNV"); + vkCmdWriteAccelerationStructuresPropertiesNV = (PFN_vkCmdWriteAccelerationStructuresPropertiesNV)load(context, "vkCmdWriteAccelerationStructuresPropertiesNV"); + vkCompileDeferredNV = (PFN_vkCompileDeferredNV)load(context, "vkCompileDeferredNV"); + vkCreateAccelerationStructureNV = (PFN_vkCreateAccelerationStructureNV)load(context, "vkCreateAccelerationStructureNV"); + vkCreateRayTracingPipelinesNV = (PFN_vkCreateRayTracingPipelinesNV)load(context, "vkCreateRayTracingPipelinesNV"); + vkDestroyAccelerationStructureNV = (PFN_vkDestroyAccelerationStructureNV)load(context, "vkDestroyAccelerationStructureNV"); + vkGetAccelerationStructureHandleNV = (PFN_vkGetAccelerationStructureHandleNV)load(context, "vkGetAccelerationStructureHandleNV"); + vkGetAccelerationStructureMemoryRequirementsNV = (PFN_vkGetAccelerationStructureMemoryRequirementsNV)load(context, "vkGetAccelerationStructureMemoryRequirementsNV"); + vkGetRayTracingShaderGroupHandlesNV = (PFN_vkGetRayTracingShaderGroupHandlesNV)load(context, "vkGetRayTracingShaderGroupHandlesNV"); +#endif /* defined(VK_NV_ray_tracing) */ +#if defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 + vkCmdSetExclusiveScissorEnableNV = (PFN_vkCmdSetExclusiveScissorEnableNV)load(context, "vkCmdSetExclusiveScissorEnableNV"); +#endif /* defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 */ +#if defined(VK_NV_scissor_exclusive) + vkCmdSetExclusiveScissorNV = (PFN_vkCmdSetExclusiveScissorNV)load(context, "vkCmdSetExclusiveScissorNV"); +#endif /* defined(VK_NV_scissor_exclusive) */ +#if defined(VK_NV_shading_rate_image) + vkCmdBindShadingRateImageNV = (PFN_vkCmdBindShadingRateImageNV)load(context, "vkCmdBindShadingRateImageNV"); + vkCmdSetCoarseSampleOrderNV = (PFN_vkCmdSetCoarseSampleOrderNV)load(context, "vkCmdSetCoarseSampleOrderNV"); + vkCmdSetViewportShadingRatePaletteNV = (PFN_vkCmdSetViewportShadingRatePaletteNV)load(context, "vkCmdSetViewportShadingRatePaletteNV"); +#endif /* defined(VK_NV_shading_rate_image) */ +#if defined(VK_QCOM_tile_properties) + vkGetDynamicRenderingTilePropertiesQCOM = (PFN_vkGetDynamicRenderingTilePropertiesQCOM)load(context, "vkGetDynamicRenderingTilePropertiesQCOM"); + vkGetFramebufferTilePropertiesQCOM = (PFN_vkGetFramebufferTilePropertiesQCOM)load(context, "vkGetFramebufferTilePropertiesQCOM"); +#endif /* defined(VK_QCOM_tile_properties) */ +#if defined(VK_QNX_external_memory_screen_buffer) + vkGetScreenBufferPropertiesQNX = (PFN_vkGetScreenBufferPropertiesQNX)load(context, "vkGetScreenBufferPropertiesQNX"); +#endif /* defined(VK_QNX_external_memory_screen_buffer) */ +#if defined(VK_VALVE_descriptor_set_host_mapping) + vkGetDescriptorSetHostMappingVALVE = (PFN_vkGetDescriptorSetHostMappingVALVE)load(context, "vkGetDescriptorSetHostMappingVALVE"); + vkGetDescriptorSetLayoutHostMappingInfoVALVE = (PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE)load(context, "vkGetDescriptorSetLayoutHostMappingInfoVALVE"); +#endif /* defined(VK_VALVE_descriptor_set_host_mapping) */ +#if (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) + vkCmdBindVertexBuffers2EXT = (PFN_vkCmdBindVertexBuffers2EXT)load(context, "vkCmdBindVertexBuffers2EXT"); + vkCmdSetCullModeEXT = (PFN_vkCmdSetCullModeEXT)load(context, "vkCmdSetCullModeEXT"); + vkCmdSetDepthBoundsTestEnableEXT = (PFN_vkCmdSetDepthBoundsTestEnableEXT)load(context, "vkCmdSetDepthBoundsTestEnableEXT"); + vkCmdSetDepthCompareOpEXT = (PFN_vkCmdSetDepthCompareOpEXT)load(context, "vkCmdSetDepthCompareOpEXT"); + vkCmdSetDepthTestEnableEXT = (PFN_vkCmdSetDepthTestEnableEXT)load(context, "vkCmdSetDepthTestEnableEXT"); + vkCmdSetDepthWriteEnableEXT = (PFN_vkCmdSetDepthWriteEnableEXT)load(context, "vkCmdSetDepthWriteEnableEXT"); + vkCmdSetFrontFaceEXT = (PFN_vkCmdSetFrontFaceEXT)load(context, "vkCmdSetFrontFaceEXT"); + vkCmdSetPrimitiveTopologyEXT = (PFN_vkCmdSetPrimitiveTopologyEXT)load(context, "vkCmdSetPrimitiveTopologyEXT"); + vkCmdSetScissorWithCountEXT = (PFN_vkCmdSetScissorWithCountEXT)load(context, "vkCmdSetScissorWithCountEXT"); + vkCmdSetStencilOpEXT = (PFN_vkCmdSetStencilOpEXT)load(context, "vkCmdSetStencilOpEXT"); + vkCmdSetStencilTestEnableEXT = (PFN_vkCmdSetStencilTestEnableEXT)load(context, "vkCmdSetStencilTestEnableEXT"); + vkCmdSetViewportWithCountEXT = (PFN_vkCmdSetViewportWithCountEXT)load(context, "vkCmdSetViewportWithCountEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) + vkCmdSetDepthBiasEnableEXT = (PFN_vkCmdSetDepthBiasEnableEXT)load(context, "vkCmdSetDepthBiasEnableEXT"); + vkCmdSetLogicOpEXT = (PFN_vkCmdSetLogicOpEXT)load(context, "vkCmdSetLogicOpEXT"); + vkCmdSetPatchControlPointsEXT = (PFN_vkCmdSetPatchControlPointsEXT)load(context, "vkCmdSetPatchControlPointsEXT"); + vkCmdSetPrimitiveRestartEnableEXT = (PFN_vkCmdSetPrimitiveRestartEnableEXT)load(context, "vkCmdSetPrimitiveRestartEnableEXT"); + vkCmdSetRasterizerDiscardEnableEXT = (PFN_vkCmdSetRasterizerDiscardEnableEXT)load(context, "vkCmdSetRasterizerDiscardEnableEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) + vkCmdSetAlphaToCoverageEnableEXT = (PFN_vkCmdSetAlphaToCoverageEnableEXT)load(context, "vkCmdSetAlphaToCoverageEnableEXT"); + vkCmdSetAlphaToOneEnableEXT = (PFN_vkCmdSetAlphaToOneEnableEXT)load(context, "vkCmdSetAlphaToOneEnableEXT"); + vkCmdSetColorBlendEnableEXT = (PFN_vkCmdSetColorBlendEnableEXT)load(context, "vkCmdSetColorBlendEnableEXT"); + vkCmdSetColorBlendEquationEXT = (PFN_vkCmdSetColorBlendEquationEXT)load(context, "vkCmdSetColorBlendEquationEXT"); + vkCmdSetColorWriteMaskEXT = (PFN_vkCmdSetColorWriteMaskEXT)load(context, "vkCmdSetColorWriteMaskEXT"); + vkCmdSetDepthClampEnableEXT = (PFN_vkCmdSetDepthClampEnableEXT)load(context, "vkCmdSetDepthClampEnableEXT"); + vkCmdSetLogicOpEnableEXT = (PFN_vkCmdSetLogicOpEnableEXT)load(context, "vkCmdSetLogicOpEnableEXT"); + vkCmdSetPolygonModeEXT = (PFN_vkCmdSetPolygonModeEXT)load(context, "vkCmdSetPolygonModeEXT"); + vkCmdSetRasterizationSamplesEXT = (PFN_vkCmdSetRasterizationSamplesEXT)load(context, "vkCmdSetRasterizationSamplesEXT"); + vkCmdSetSampleMaskEXT = (PFN_vkCmdSetSampleMaskEXT)load(context, "vkCmdSetSampleMaskEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) + vkCmdSetTessellationDomainOriginEXT = (PFN_vkCmdSetTessellationDomainOriginEXT)load(context, "vkCmdSetTessellationDomainOriginEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) + vkCmdSetRasterizationStreamEXT = (PFN_vkCmdSetRasterizationStreamEXT)load(context, "vkCmdSetRasterizationStreamEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) + vkCmdSetConservativeRasterizationModeEXT = (PFN_vkCmdSetConservativeRasterizationModeEXT)load(context, "vkCmdSetConservativeRasterizationModeEXT"); + vkCmdSetExtraPrimitiveOverestimationSizeEXT = (PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT)load(context, "vkCmdSetExtraPrimitiveOverestimationSizeEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) + vkCmdSetDepthClipEnableEXT = (PFN_vkCmdSetDepthClipEnableEXT)load(context, "vkCmdSetDepthClipEnableEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) + vkCmdSetSampleLocationsEnableEXT = (PFN_vkCmdSetSampleLocationsEnableEXT)load(context, "vkCmdSetSampleLocationsEnableEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) + vkCmdSetColorBlendAdvancedEXT = (PFN_vkCmdSetColorBlendAdvancedEXT)load(context, "vkCmdSetColorBlendAdvancedEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) + vkCmdSetProvokingVertexModeEXT = (PFN_vkCmdSetProvokingVertexModeEXT)load(context, "vkCmdSetProvokingVertexModeEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) + vkCmdSetLineRasterizationModeEXT = (PFN_vkCmdSetLineRasterizationModeEXT)load(context, "vkCmdSetLineRasterizationModeEXT"); + vkCmdSetLineStippleEnableEXT = (PFN_vkCmdSetLineStippleEnableEXT)load(context, "vkCmdSetLineStippleEnableEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) + vkCmdSetDepthClipNegativeOneToOneEXT = (PFN_vkCmdSetDepthClipNegativeOneToOneEXT)load(context, "vkCmdSetDepthClipNegativeOneToOneEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) + vkCmdSetViewportWScalingEnableNV = (PFN_vkCmdSetViewportWScalingEnableNV)load(context, "vkCmdSetViewportWScalingEnableNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) + vkCmdSetViewportSwizzleNV = (PFN_vkCmdSetViewportSwizzleNV)load(context, "vkCmdSetViewportSwizzleNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) + vkCmdSetCoverageToColorEnableNV = (PFN_vkCmdSetCoverageToColorEnableNV)load(context, "vkCmdSetCoverageToColorEnableNV"); + vkCmdSetCoverageToColorLocationNV = (PFN_vkCmdSetCoverageToColorLocationNV)load(context, "vkCmdSetCoverageToColorLocationNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) + vkCmdSetCoverageModulationModeNV = (PFN_vkCmdSetCoverageModulationModeNV)load(context, "vkCmdSetCoverageModulationModeNV"); + vkCmdSetCoverageModulationTableEnableNV = (PFN_vkCmdSetCoverageModulationTableEnableNV)load(context, "vkCmdSetCoverageModulationTableEnableNV"); + vkCmdSetCoverageModulationTableNV = (PFN_vkCmdSetCoverageModulationTableNV)load(context, "vkCmdSetCoverageModulationTableNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) + vkCmdSetShadingRateImageEnableNV = (PFN_vkCmdSetShadingRateImageEnableNV)load(context, "vkCmdSetShadingRateImageEnableNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) + vkCmdSetRepresentativeFragmentTestEnableNV = (PFN_vkCmdSetRepresentativeFragmentTestEnableNV)load(context, "vkCmdSetRepresentativeFragmentTestEnableNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) + vkCmdSetCoverageReductionModeNV = (PFN_vkCmdSetCoverageReductionModeNV)load(context, "vkCmdSetCoverageReductionModeNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) */ +#if (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) + vkGetImageSubresourceLayout2EXT = (PFN_vkGetImageSubresourceLayout2EXT)load(context, "vkGetImageSubresourceLayout2EXT"); +#endif /* (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) */ +#if (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) + vkCmdSetVertexInputEXT = (PFN_vkCmdSetVertexInputEXT)load(context, "vkCmdSetVertexInputEXT"); +#endif /* (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) */ +#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) + vkCmdPushDescriptorSetWithTemplateKHR = (PFN_vkCmdPushDescriptorSetWithTemplateKHR)load(context, "vkCmdPushDescriptorSetWithTemplateKHR"); +#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) + vkGetDeviceGroupPresentCapabilitiesKHR = (PFN_vkGetDeviceGroupPresentCapabilitiesKHR)load(context, "vkGetDeviceGroupPresentCapabilitiesKHR"); + vkGetDeviceGroupSurfacePresentModesKHR = (PFN_vkGetDeviceGroupSurfacePresentModesKHR)load(context, "vkGetDeviceGroupSurfacePresentModesKHR"); +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) + vkAcquireNextImage2KHR = (PFN_vkAcquireNextImage2KHR)load(context, "vkAcquireNextImage2KHR"); +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ + /* VOLK_GENERATE_LOAD_DEVICE */ +} + +static void volkGenLoadDeviceTable(struct VolkDeviceTable* table, void* context, PFN_vkVoidFunction (*load)(void*, const char*)) +{ + /* VOLK_GENERATE_LOAD_DEVICE_TABLE */ +#if defined(VK_VERSION_1_0) + table->vkAllocateCommandBuffers = (PFN_vkAllocateCommandBuffers)load(context, "vkAllocateCommandBuffers"); + table->vkAllocateDescriptorSets = (PFN_vkAllocateDescriptorSets)load(context, "vkAllocateDescriptorSets"); + table->vkAllocateMemory = (PFN_vkAllocateMemory)load(context, "vkAllocateMemory"); + table->vkBeginCommandBuffer = (PFN_vkBeginCommandBuffer)load(context, "vkBeginCommandBuffer"); + table->vkBindBufferMemory = (PFN_vkBindBufferMemory)load(context, "vkBindBufferMemory"); + table->vkBindImageMemory = (PFN_vkBindImageMemory)load(context, "vkBindImageMemory"); + table->vkCmdBeginQuery = (PFN_vkCmdBeginQuery)load(context, "vkCmdBeginQuery"); + table->vkCmdBeginRenderPass = (PFN_vkCmdBeginRenderPass)load(context, "vkCmdBeginRenderPass"); + table->vkCmdBindDescriptorSets = (PFN_vkCmdBindDescriptorSets)load(context, "vkCmdBindDescriptorSets"); + table->vkCmdBindIndexBuffer = (PFN_vkCmdBindIndexBuffer)load(context, "vkCmdBindIndexBuffer"); + table->vkCmdBindPipeline = (PFN_vkCmdBindPipeline)load(context, "vkCmdBindPipeline"); + table->vkCmdBindVertexBuffers = (PFN_vkCmdBindVertexBuffers)load(context, "vkCmdBindVertexBuffers"); + table->vkCmdBlitImage = (PFN_vkCmdBlitImage)load(context, "vkCmdBlitImage"); + table->vkCmdClearAttachments = (PFN_vkCmdClearAttachments)load(context, "vkCmdClearAttachments"); + table->vkCmdClearColorImage = (PFN_vkCmdClearColorImage)load(context, "vkCmdClearColorImage"); + table->vkCmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage)load(context, "vkCmdClearDepthStencilImage"); + table->vkCmdCopyBuffer = (PFN_vkCmdCopyBuffer)load(context, "vkCmdCopyBuffer"); + table->vkCmdCopyBufferToImage = (PFN_vkCmdCopyBufferToImage)load(context, "vkCmdCopyBufferToImage"); + table->vkCmdCopyImage = (PFN_vkCmdCopyImage)load(context, "vkCmdCopyImage"); + table->vkCmdCopyImageToBuffer = (PFN_vkCmdCopyImageToBuffer)load(context, "vkCmdCopyImageToBuffer"); + table->vkCmdCopyQueryPoolResults = (PFN_vkCmdCopyQueryPoolResults)load(context, "vkCmdCopyQueryPoolResults"); + table->vkCmdDispatch = (PFN_vkCmdDispatch)load(context, "vkCmdDispatch"); + table->vkCmdDispatchIndirect = (PFN_vkCmdDispatchIndirect)load(context, "vkCmdDispatchIndirect"); + table->vkCmdDraw = (PFN_vkCmdDraw)load(context, "vkCmdDraw"); + table->vkCmdDrawIndexed = (PFN_vkCmdDrawIndexed)load(context, "vkCmdDrawIndexed"); + table->vkCmdDrawIndexedIndirect = (PFN_vkCmdDrawIndexedIndirect)load(context, "vkCmdDrawIndexedIndirect"); + table->vkCmdDrawIndirect = (PFN_vkCmdDrawIndirect)load(context, "vkCmdDrawIndirect"); + table->vkCmdEndQuery = (PFN_vkCmdEndQuery)load(context, "vkCmdEndQuery"); + table->vkCmdEndRenderPass = (PFN_vkCmdEndRenderPass)load(context, "vkCmdEndRenderPass"); + table->vkCmdExecuteCommands = (PFN_vkCmdExecuteCommands)load(context, "vkCmdExecuteCommands"); + table->vkCmdFillBuffer = (PFN_vkCmdFillBuffer)load(context, "vkCmdFillBuffer"); + table->vkCmdNextSubpass = (PFN_vkCmdNextSubpass)load(context, "vkCmdNextSubpass"); + table->vkCmdPipelineBarrier = (PFN_vkCmdPipelineBarrier)load(context, "vkCmdPipelineBarrier"); + table->vkCmdPushConstants = (PFN_vkCmdPushConstants)load(context, "vkCmdPushConstants"); + table->vkCmdResetEvent = (PFN_vkCmdResetEvent)load(context, "vkCmdResetEvent"); + table->vkCmdResetQueryPool = (PFN_vkCmdResetQueryPool)load(context, "vkCmdResetQueryPool"); + table->vkCmdResolveImage = (PFN_vkCmdResolveImage)load(context, "vkCmdResolveImage"); + table->vkCmdSetBlendConstants = (PFN_vkCmdSetBlendConstants)load(context, "vkCmdSetBlendConstants"); + table->vkCmdSetDepthBias = (PFN_vkCmdSetDepthBias)load(context, "vkCmdSetDepthBias"); + table->vkCmdSetDepthBounds = (PFN_vkCmdSetDepthBounds)load(context, "vkCmdSetDepthBounds"); + table->vkCmdSetEvent = (PFN_vkCmdSetEvent)load(context, "vkCmdSetEvent"); + table->vkCmdSetLineWidth = (PFN_vkCmdSetLineWidth)load(context, "vkCmdSetLineWidth"); + table->vkCmdSetScissor = (PFN_vkCmdSetScissor)load(context, "vkCmdSetScissor"); + table->vkCmdSetStencilCompareMask = (PFN_vkCmdSetStencilCompareMask)load(context, "vkCmdSetStencilCompareMask"); + table->vkCmdSetStencilReference = (PFN_vkCmdSetStencilReference)load(context, "vkCmdSetStencilReference"); + table->vkCmdSetStencilWriteMask = (PFN_vkCmdSetStencilWriteMask)load(context, "vkCmdSetStencilWriteMask"); + table->vkCmdSetViewport = (PFN_vkCmdSetViewport)load(context, "vkCmdSetViewport"); + table->vkCmdUpdateBuffer = (PFN_vkCmdUpdateBuffer)load(context, "vkCmdUpdateBuffer"); + table->vkCmdWaitEvents = (PFN_vkCmdWaitEvents)load(context, "vkCmdWaitEvents"); + table->vkCmdWriteTimestamp = (PFN_vkCmdWriteTimestamp)load(context, "vkCmdWriteTimestamp"); + table->vkCreateBuffer = (PFN_vkCreateBuffer)load(context, "vkCreateBuffer"); + table->vkCreateBufferView = (PFN_vkCreateBufferView)load(context, "vkCreateBufferView"); + table->vkCreateCommandPool = (PFN_vkCreateCommandPool)load(context, "vkCreateCommandPool"); + table->vkCreateComputePipelines = (PFN_vkCreateComputePipelines)load(context, "vkCreateComputePipelines"); + table->vkCreateDescriptorPool = (PFN_vkCreateDescriptorPool)load(context, "vkCreateDescriptorPool"); + table->vkCreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout)load(context, "vkCreateDescriptorSetLayout"); + table->vkCreateEvent = (PFN_vkCreateEvent)load(context, "vkCreateEvent"); + table->vkCreateFence = (PFN_vkCreateFence)load(context, "vkCreateFence"); + table->vkCreateFramebuffer = (PFN_vkCreateFramebuffer)load(context, "vkCreateFramebuffer"); + table->vkCreateGraphicsPipelines = (PFN_vkCreateGraphicsPipelines)load(context, "vkCreateGraphicsPipelines"); + table->vkCreateImage = (PFN_vkCreateImage)load(context, "vkCreateImage"); + table->vkCreateImageView = (PFN_vkCreateImageView)load(context, "vkCreateImageView"); + table->vkCreatePipelineCache = (PFN_vkCreatePipelineCache)load(context, "vkCreatePipelineCache"); + table->vkCreatePipelineLayout = (PFN_vkCreatePipelineLayout)load(context, "vkCreatePipelineLayout"); + table->vkCreateQueryPool = (PFN_vkCreateQueryPool)load(context, "vkCreateQueryPool"); + table->vkCreateRenderPass = (PFN_vkCreateRenderPass)load(context, "vkCreateRenderPass"); + table->vkCreateSampler = (PFN_vkCreateSampler)load(context, "vkCreateSampler"); + table->vkCreateSemaphore = (PFN_vkCreateSemaphore)load(context, "vkCreateSemaphore"); + table->vkCreateShaderModule = (PFN_vkCreateShaderModule)load(context, "vkCreateShaderModule"); + table->vkDestroyBuffer = (PFN_vkDestroyBuffer)load(context, "vkDestroyBuffer"); + table->vkDestroyBufferView = (PFN_vkDestroyBufferView)load(context, "vkDestroyBufferView"); + table->vkDestroyCommandPool = (PFN_vkDestroyCommandPool)load(context, "vkDestroyCommandPool"); + table->vkDestroyDescriptorPool = (PFN_vkDestroyDescriptorPool)load(context, "vkDestroyDescriptorPool"); + table->vkDestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout)load(context, "vkDestroyDescriptorSetLayout"); + table->vkDestroyDevice = (PFN_vkDestroyDevice)load(context, "vkDestroyDevice"); + table->vkDestroyEvent = (PFN_vkDestroyEvent)load(context, "vkDestroyEvent"); + table->vkDestroyFence = (PFN_vkDestroyFence)load(context, "vkDestroyFence"); + table->vkDestroyFramebuffer = (PFN_vkDestroyFramebuffer)load(context, "vkDestroyFramebuffer"); + table->vkDestroyImage = (PFN_vkDestroyImage)load(context, "vkDestroyImage"); + table->vkDestroyImageView = (PFN_vkDestroyImageView)load(context, "vkDestroyImageView"); + table->vkDestroyPipeline = (PFN_vkDestroyPipeline)load(context, "vkDestroyPipeline"); + table->vkDestroyPipelineCache = (PFN_vkDestroyPipelineCache)load(context, "vkDestroyPipelineCache"); + table->vkDestroyPipelineLayout = (PFN_vkDestroyPipelineLayout)load(context, "vkDestroyPipelineLayout"); + table->vkDestroyQueryPool = (PFN_vkDestroyQueryPool)load(context, "vkDestroyQueryPool"); + table->vkDestroyRenderPass = (PFN_vkDestroyRenderPass)load(context, "vkDestroyRenderPass"); + table->vkDestroySampler = (PFN_vkDestroySampler)load(context, "vkDestroySampler"); + table->vkDestroySemaphore = (PFN_vkDestroySemaphore)load(context, "vkDestroySemaphore"); + table->vkDestroyShaderModule = (PFN_vkDestroyShaderModule)load(context, "vkDestroyShaderModule"); + table->vkDeviceWaitIdle = (PFN_vkDeviceWaitIdle)load(context, "vkDeviceWaitIdle"); + table->vkEndCommandBuffer = (PFN_vkEndCommandBuffer)load(context, "vkEndCommandBuffer"); + table->vkFlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges)load(context, "vkFlushMappedMemoryRanges"); + table->vkFreeCommandBuffers = (PFN_vkFreeCommandBuffers)load(context, "vkFreeCommandBuffers"); + table->vkFreeDescriptorSets = (PFN_vkFreeDescriptorSets)load(context, "vkFreeDescriptorSets"); + table->vkFreeMemory = (PFN_vkFreeMemory)load(context, "vkFreeMemory"); + table->vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements)load(context, "vkGetBufferMemoryRequirements"); + table->vkGetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment)load(context, "vkGetDeviceMemoryCommitment"); + table->vkGetDeviceQueue = (PFN_vkGetDeviceQueue)load(context, "vkGetDeviceQueue"); + table->vkGetEventStatus = (PFN_vkGetEventStatus)load(context, "vkGetEventStatus"); + table->vkGetFenceStatus = (PFN_vkGetFenceStatus)load(context, "vkGetFenceStatus"); + table->vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements)load(context, "vkGetImageMemoryRequirements"); + table->vkGetImageSparseMemoryRequirements = (PFN_vkGetImageSparseMemoryRequirements)load(context, "vkGetImageSparseMemoryRequirements"); + table->vkGetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout)load(context, "vkGetImageSubresourceLayout"); + table->vkGetPipelineCacheData = (PFN_vkGetPipelineCacheData)load(context, "vkGetPipelineCacheData"); + table->vkGetQueryPoolResults = (PFN_vkGetQueryPoolResults)load(context, "vkGetQueryPoolResults"); + table->vkGetRenderAreaGranularity = (PFN_vkGetRenderAreaGranularity)load(context, "vkGetRenderAreaGranularity"); + table->vkInvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges)load(context, "vkInvalidateMappedMemoryRanges"); + table->vkMapMemory = (PFN_vkMapMemory)load(context, "vkMapMemory"); + table->vkMergePipelineCaches = (PFN_vkMergePipelineCaches)load(context, "vkMergePipelineCaches"); + table->vkQueueBindSparse = (PFN_vkQueueBindSparse)load(context, "vkQueueBindSparse"); + table->vkQueueSubmit = (PFN_vkQueueSubmit)load(context, "vkQueueSubmit"); + table->vkQueueWaitIdle = (PFN_vkQueueWaitIdle)load(context, "vkQueueWaitIdle"); + table->vkResetCommandBuffer = (PFN_vkResetCommandBuffer)load(context, "vkResetCommandBuffer"); + table->vkResetCommandPool = (PFN_vkResetCommandPool)load(context, "vkResetCommandPool"); + table->vkResetDescriptorPool = (PFN_vkResetDescriptorPool)load(context, "vkResetDescriptorPool"); + table->vkResetEvent = (PFN_vkResetEvent)load(context, "vkResetEvent"); + table->vkResetFences = (PFN_vkResetFences)load(context, "vkResetFences"); + table->vkSetEvent = (PFN_vkSetEvent)load(context, "vkSetEvent"); + table->vkUnmapMemory = (PFN_vkUnmapMemory)load(context, "vkUnmapMemory"); + table->vkUpdateDescriptorSets = (PFN_vkUpdateDescriptorSets)load(context, "vkUpdateDescriptorSets"); + table->vkWaitForFences = (PFN_vkWaitForFences)load(context, "vkWaitForFences"); +#endif /* defined(VK_VERSION_1_0) */ +#if defined(VK_VERSION_1_1) + table->vkBindBufferMemory2 = (PFN_vkBindBufferMemory2)load(context, "vkBindBufferMemory2"); + table->vkBindImageMemory2 = (PFN_vkBindImageMemory2)load(context, "vkBindImageMemory2"); + table->vkCmdDispatchBase = (PFN_vkCmdDispatchBase)load(context, "vkCmdDispatchBase"); + table->vkCmdSetDeviceMask = (PFN_vkCmdSetDeviceMask)load(context, "vkCmdSetDeviceMask"); + table->vkCreateDescriptorUpdateTemplate = (PFN_vkCreateDescriptorUpdateTemplate)load(context, "vkCreateDescriptorUpdateTemplate"); + table->vkCreateSamplerYcbcrConversion = (PFN_vkCreateSamplerYcbcrConversion)load(context, "vkCreateSamplerYcbcrConversion"); + table->vkDestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate)load(context, "vkDestroyDescriptorUpdateTemplate"); + table->vkDestroySamplerYcbcrConversion = (PFN_vkDestroySamplerYcbcrConversion)load(context, "vkDestroySamplerYcbcrConversion"); + table->vkGetBufferMemoryRequirements2 = (PFN_vkGetBufferMemoryRequirements2)load(context, "vkGetBufferMemoryRequirements2"); + table->vkGetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport)load(context, "vkGetDescriptorSetLayoutSupport"); + table->vkGetDeviceGroupPeerMemoryFeatures = (PFN_vkGetDeviceGroupPeerMemoryFeatures)load(context, "vkGetDeviceGroupPeerMemoryFeatures"); + table->vkGetDeviceQueue2 = (PFN_vkGetDeviceQueue2)load(context, "vkGetDeviceQueue2"); + table->vkGetImageMemoryRequirements2 = (PFN_vkGetImageMemoryRequirements2)load(context, "vkGetImageMemoryRequirements2"); + table->vkGetImageSparseMemoryRequirements2 = (PFN_vkGetImageSparseMemoryRequirements2)load(context, "vkGetImageSparseMemoryRequirements2"); + table->vkTrimCommandPool = (PFN_vkTrimCommandPool)load(context, "vkTrimCommandPool"); + table->vkUpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate)load(context, "vkUpdateDescriptorSetWithTemplate"); +#endif /* defined(VK_VERSION_1_1) */ +#if defined(VK_VERSION_1_2) + table->vkCmdBeginRenderPass2 = (PFN_vkCmdBeginRenderPass2)load(context, "vkCmdBeginRenderPass2"); + table->vkCmdDrawIndexedIndirectCount = (PFN_vkCmdDrawIndexedIndirectCount)load(context, "vkCmdDrawIndexedIndirectCount"); + table->vkCmdDrawIndirectCount = (PFN_vkCmdDrawIndirectCount)load(context, "vkCmdDrawIndirectCount"); + table->vkCmdEndRenderPass2 = (PFN_vkCmdEndRenderPass2)load(context, "vkCmdEndRenderPass2"); + table->vkCmdNextSubpass2 = (PFN_vkCmdNextSubpass2)load(context, "vkCmdNextSubpass2"); + table->vkCreateRenderPass2 = (PFN_vkCreateRenderPass2)load(context, "vkCreateRenderPass2"); + table->vkGetBufferDeviceAddress = (PFN_vkGetBufferDeviceAddress)load(context, "vkGetBufferDeviceAddress"); + table->vkGetBufferOpaqueCaptureAddress = (PFN_vkGetBufferOpaqueCaptureAddress)load(context, "vkGetBufferOpaqueCaptureAddress"); + table->vkGetDeviceMemoryOpaqueCaptureAddress = (PFN_vkGetDeviceMemoryOpaqueCaptureAddress)load(context, "vkGetDeviceMemoryOpaqueCaptureAddress"); + table->vkGetSemaphoreCounterValue = (PFN_vkGetSemaphoreCounterValue)load(context, "vkGetSemaphoreCounterValue"); + table->vkResetQueryPool = (PFN_vkResetQueryPool)load(context, "vkResetQueryPool"); + table->vkSignalSemaphore = (PFN_vkSignalSemaphore)load(context, "vkSignalSemaphore"); + table->vkWaitSemaphores = (PFN_vkWaitSemaphores)load(context, "vkWaitSemaphores"); +#endif /* defined(VK_VERSION_1_2) */ +#if defined(VK_VERSION_1_3) + table->vkCmdBeginRendering = (PFN_vkCmdBeginRendering)load(context, "vkCmdBeginRendering"); + table->vkCmdBindVertexBuffers2 = (PFN_vkCmdBindVertexBuffers2)load(context, "vkCmdBindVertexBuffers2"); + table->vkCmdBlitImage2 = (PFN_vkCmdBlitImage2)load(context, "vkCmdBlitImage2"); + table->vkCmdCopyBuffer2 = (PFN_vkCmdCopyBuffer2)load(context, "vkCmdCopyBuffer2"); + table->vkCmdCopyBufferToImage2 = (PFN_vkCmdCopyBufferToImage2)load(context, "vkCmdCopyBufferToImage2"); + table->vkCmdCopyImage2 = (PFN_vkCmdCopyImage2)load(context, "vkCmdCopyImage2"); + table->vkCmdCopyImageToBuffer2 = (PFN_vkCmdCopyImageToBuffer2)load(context, "vkCmdCopyImageToBuffer2"); + table->vkCmdEndRendering = (PFN_vkCmdEndRendering)load(context, "vkCmdEndRendering"); + table->vkCmdPipelineBarrier2 = (PFN_vkCmdPipelineBarrier2)load(context, "vkCmdPipelineBarrier2"); + table->vkCmdResetEvent2 = (PFN_vkCmdResetEvent2)load(context, "vkCmdResetEvent2"); + table->vkCmdResolveImage2 = (PFN_vkCmdResolveImage2)load(context, "vkCmdResolveImage2"); + table->vkCmdSetCullMode = (PFN_vkCmdSetCullMode)load(context, "vkCmdSetCullMode"); + table->vkCmdSetDepthBiasEnable = (PFN_vkCmdSetDepthBiasEnable)load(context, "vkCmdSetDepthBiasEnable"); + table->vkCmdSetDepthBoundsTestEnable = (PFN_vkCmdSetDepthBoundsTestEnable)load(context, "vkCmdSetDepthBoundsTestEnable"); + table->vkCmdSetDepthCompareOp = (PFN_vkCmdSetDepthCompareOp)load(context, "vkCmdSetDepthCompareOp"); + table->vkCmdSetDepthTestEnable = (PFN_vkCmdSetDepthTestEnable)load(context, "vkCmdSetDepthTestEnable"); + table->vkCmdSetDepthWriteEnable = (PFN_vkCmdSetDepthWriteEnable)load(context, "vkCmdSetDepthWriteEnable"); + table->vkCmdSetEvent2 = (PFN_vkCmdSetEvent2)load(context, "vkCmdSetEvent2"); + table->vkCmdSetFrontFace = (PFN_vkCmdSetFrontFace)load(context, "vkCmdSetFrontFace"); + table->vkCmdSetPrimitiveRestartEnable = (PFN_vkCmdSetPrimitiveRestartEnable)load(context, "vkCmdSetPrimitiveRestartEnable"); + table->vkCmdSetPrimitiveTopology = (PFN_vkCmdSetPrimitiveTopology)load(context, "vkCmdSetPrimitiveTopology"); + table->vkCmdSetRasterizerDiscardEnable = (PFN_vkCmdSetRasterizerDiscardEnable)load(context, "vkCmdSetRasterizerDiscardEnable"); + table->vkCmdSetScissorWithCount = (PFN_vkCmdSetScissorWithCount)load(context, "vkCmdSetScissorWithCount"); + table->vkCmdSetStencilOp = (PFN_vkCmdSetStencilOp)load(context, "vkCmdSetStencilOp"); + table->vkCmdSetStencilTestEnable = (PFN_vkCmdSetStencilTestEnable)load(context, "vkCmdSetStencilTestEnable"); + table->vkCmdSetViewportWithCount = (PFN_vkCmdSetViewportWithCount)load(context, "vkCmdSetViewportWithCount"); + table->vkCmdWaitEvents2 = (PFN_vkCmdWaitEvents2)load(context, "vkCmdWaitEvents2"); + table->vkCmdWriteTimestamp2 = (PFN_vkCmdWriteTimestamp2)load(context, "vkCmdWriteTimestamp2"); + table->vkCreatePrivateDataSlot = (PFN_vkCreatePrivateDataSlot)load(context, "vkCreatePrivateDataSlot"); + table->vkDestroyPrivateDataSlot = (PFN_vkDestroyPrivateDataSlot)load(context, "vkDestroyPrivateDataSlot"); + table->vkGetDeviceBufferMemoryRequirements = (PFN_vkGetDeviceBufferMemoryRequirements)load(context, "vkGetDeviceBufferMemoryRequirements"); + table->vkGetDeviceImageMemoryRequirements = (PFN_vkGetDeviceImageMemoryRequirements)load(context, "vkGetDeviceImageMemoryRequirements"); + table->vkGetDeviceImageSparseMemoryRequirements = (PFN_vkGetDeviceImageSparseMemoryRequirements)load(context, "vkGetDeviceImageSparseMemoryRequirements"); + table->vkGetPrivateData = (PFN_vkGetPrivateData)load(context, "vkGetPrivateData"); + table->vkQueueSubmit2 = (PFN_vkQueueSubmit2)load(context, "vkQueueSubmit2"); + table->vkSetPrivateData = (PFN_vkSetPrivateData)load(context, "vkSetPrivateData"); +#endif /* defined(VK_VERSION_1_3) */ +#if defined(VK_AMDX_shader_enqueue) + table->vkCmdDispatchGraphAMDX = (PFN_vkCmdDispatchGraphAMDX)load(context, "vkCmdDispatchGraphAMDX"); + table->vkCmdDispatchGraphIndirectAMDX = (PFN_vkCmdDispatchGraphIndirectAMDX)load(context, "vkCmdDispatchGraphIndirectAMDX"); + table->vkCmdDispatchGraphIndirectCountAMDX = (PFN_vkCmdDispatchGraphIndirectCountAMDX)load(context, "vkCmdDispatchGraphIndirectCountAMDX"); + table->vkCmdInitializeGraphScratchMemoryAMDX = (PFN_vkCmdInitializeGraphScratchMemoryAMDX)load(context, "vkCmdInitializeGraphScratchMemoryAMDX"); + table->vkCreateExecutionGraphPipelinesAMDX = (PFN_vkCreateExecutionGraphPipelinesAMDX)load(context, "vkCreateExecutionGraphPipelinesAMDX"); + table->vkGetExecutionGraphPipelineNodeIndexAMDX = (PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)load(context, "vkGetExecutionGraphPipelineNodeIndexAMDX"); + table->vkGetExecutionGraphPipelineScratchSizeAMDX = (PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)load(context, "vkGetExecutionGraphPipelineScratchSizeAMDX"); +#endif /* defined(VK_AMDX_shader_enqueue) */ +#if defined(VK_AMD_anti_lag) + table->vkAntiLagUpdateAMD = (PFN_vkAntiLagUpdateAMD)load(context, "vkAntiLagUpdateAMD"); +#endif /* defined(VK_AMD_anti_lag) */ +#if defined(VK_AMD_buffer_marker) + table->vkCmdWriteBufferMarkerAMD = (PFN_vkCmdWriteBufferMarkerAMD)load(context, "vkCmdWriteBufferMarkerAMD"); +#endif /* defined(VK_AMD_buffer_marker) */ +#if defined(VK_AMD_display_native_hdr) + table->vkSetLocalDimmingAMD = (PFN_vkSetLocalDimmingAMD)load(context, "vkSetLocalDimmingAMD"); +#endif /* defined(VK_AMD_display_native_hdr) */ +#if defined(VK_AMD_draw_indirect_count) + table->vkCmdDrawIndexedIndirectCountAMD = (PFN_vkCmdDrawIndexedIndirectCountAMD)load(context, "vkCmdDrawIndexedIndirectCountAMD"); + table->vkCmdDrawIndirectCountAMD = (PFN_vkCmdDrawIndirectCountAMD)load(context, "vkCmdDrawIndirectCountAMD"); +#endif /* defined(VK_AMD_draw_indirect_count) */ +#if defined(VK_AMD_shader_info) + table->vkGetShaderInfoAMD = (PFN_vkGetShaderInfoAMD)load(context, "vkGetShaderInfoAMD"); +#endif /* defined(VK_AMD_shader_info) */ +#if defined(VK_ANDROID_external_memory_android_hardware_buffer) + table->vkGetAndroidHardwareBufferPropertiesANDROID = (PFN_vkGetAndroidHardwareBufferPropertiesANDROID)load(context, "vkGetAndroidHardwareBufferPropertiesANDROID"); + table->vkGetMemoryAndroidHardwareBufferANDROID = (PFN_vkGetMemoryAndroidHardwareBufferANDROID)load(context, "vkGetMemoryAndroidHardwareBufferANDROID"); +#endif /* defined(VK_ANDROID_external_memory_android_hardware_buffer) */ +#if defined(VK_EXT_attachment_feedback_loop_dynamic_state) + table->vkCmdSetAttachmentFeedbackLoopEnableEXT = (PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT)load(context, "vkCmdSetAttachmentFeedbackLoopEnableEXT"); +#endif /* defined(VK_EXT_attachment_feedback_loop_dynamic_state) */ +#if defined(VK_EXT_buffer_device_address) + table->vkGetBufferDeviceAddressEXT = (PFN_vkGetBufferDeviceAddressEXT)load(context, "vkGetBufferDeviceAddressEXT"); +#endif /* defined(VK_EXT_buffer_device_address) */ +#if defined(VK_EXT_calibrated_timestamps) + table->vkGetCalibratedTimestampsEXT = (PFN_vkGetCalibratedTimestampsEXT)load(context, "vkGetCalibratedTimestampsEXT"); +#endif /* defined(VK_EXT_calibrated_timestamps) */ +#if defined(VK_EXT_color_write_enable) + table->vkCmdSetColorWriteEnableEXT = (PFN_vkCmdSetColorWriteEnableEXT)load(context, "vkCmdSetColorWriteEnableEXT"); +#endif /* defined(VK_EXT_color_write_enable) */ +#if defined(VK_EXT_conditional_rendering) + table->vkCmdBeginConditionalRenderingEXT = (PFN_vkCmdBeginConditionalRenderingEXT)load(context, "vkCmdBeginConditionalRenderingEXT"); + table->vkCmdEndConditionalRenderingEXT = (PFN_vkCmdEndConditionalRenderingEXT)load(context, "vkCmdEndConditionalRenderingEXT"); +#endif /* defined(VK_EXT_conditional_rendering) */ +#if defined(VK_EXT_debug_marker) + table->vkCmdDebugMarkerBeginEXT = (PFN_vkCmdDebugMarkerBeginEXT)load(context, "vkCmdDebugMarkerBeginEXT"); + table->vkCmdDebugMarkerEndEXT = (PFN_vkCmdDebugMarkerEndEXT)load(context, "vkCmdDebugMarkerEndEXT"); + table->vkCmdDebugMarkerInsertEXT = (PFN_vkCmdDebugMarkerInsertEXT)load(context, "vkCmdDebugMarkerInsertEXT"); + table->vkDebugMarkerSetObjectNameEXT = (PFN_vkDebugMarkerSetObjectNameEXT)load(context, "vkDebugMarkerSetObjectNameEXT"); + table->vkDebugMarkerSetObjectTagEXT = (PFN_vkDebugMarkerSetObjectTagEXT)load(context, "vkDebugMarkerSetObjectTagEXT"); +#endif /* defined(VK_EXT_debug_marker) */ +#if defined(VK_EXT_depth_bias_control) + table->vkCmdSetDepthBias2EXT = (PFN_vkCmdSetDepthBias2EXT)load(context, "vkCmdSetDepthBias2EXT"); +#endif /* defined(VK_EXT_depth_bias_control) */ +#if defined(VK_EXT_descriptor_buffer) + table->vkCmdBindDescriptorBufferEmbeddedSamplersEXT = (PFN_vkCmdBindDescriptorBufferEmbeddedSamplersEXT)load(context, "vkCmdBindDescriptorBufferEmbeddedSamplersEXT"); + table->vkCmdBindDescriptorBuffersEXT = (PFN_vkCmdBindDescriptorBuffersEXT)load(context, "vkCmdBindDescriptorBuffersEXT"); + table->vkCmdSetDescriptorBufferOffsetsEXT = (PFN_vkCmdSetDescriptorBufferOffsetsEXT)load(context, "vkCmdSetDescriptorBufferOffsetsEXT"); + table->vkGetBufferOpaqueCaptureDescriptorDataEXT = (PFN_vkGetBufferOpaqueCaptureDescriptorDataEXT)load(context, "vkGetBufferOpaqueCaptureDescriptorDataEXT"); + table->vkGetDescriptorEXT = (PFN_vkGetDescriptorEXT)load(context, "vkGetDescriptorEXT"); + table->vkGetDescriptorSetLayoutBindingOffsetEXT = (PFN_vkGetDescriptorSetLayoutBindingOffsetEXT)load(context, "vkGetDescriptorSetLayoutBindingOffsetEXT"); + table->vkGetDescriptorSetLayoutSizeEXT = (PFN_vkGetDescriptorSetLayoutSizeEXT)load(context, "vkGetDescriptorSetLayoutSizeEXT"); + table->vkGetImageOpaqueCaptureDescriptorDataEXT = (PFN_vkGetImageOpaqueCaptureDescriptorDataEXT)load(context, "vkGetImageOpaqueCaptureDescriptorDataEXT"); + table->vkGetImageViewOpaqueCaptureDescriptorDataEXT = (PFN_vkGetImageViewOpaqueCaptureDescriptorDataEXT)load(context, "vkGetImageViewOpaqueCaptureDescriptorDataEXT"); + table->vkGetSamplerOpaqueCaptureDescriptorDataEXT = (PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT)load(context, "vkGetSamplerOpaqueCaptureDescriptorDataEXT"); +#endif /* defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) + table->vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT = (PFN_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT)load(context, "vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT"); +#endif /* defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) */ +#if defined(VK_EXT_device_fault) + table->vkGetDeviceFaultInfoEXT = (PFN_vkGetDeviceFaultInfoEXT)load(context, "vkGetDeviceFaultInfoEXT"); +#endif /* defined(VK_EXT_device_fault) */ +#if defined(VK_EXT_discard_rectangles) + table->vkCmdSetDiscardRectangleEXT = (PFN_vkCmdSetDiscardRectangleEXT)load(context, "vkCmdSetDiscardRectangleEXT"); +#endif /* defined(VK_EXT_discard_rectangles) */ +#if defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 + table->vkCmdSetDiscardRectangleEnableEXT = (PFN_vkCmdSetDiscardRectangleEnableEXT)load(context, "vkCmdSetDiscardRectangleEnableEXT"); + table->vkCmdSetDiscardRectangleModeEXT = (PFN_vkCmdSetDiscardRectangleModeEXT)load(context, "vkCmdSetDiscardRectangleModeEXT"); +#endif /* defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 */ +#if defined(VK_EXT_display_control) + table->vkDisplayPowerControlEXT = (PFN_vkDisplayPowerControlEXT)load(context, "vkDisplayPowerControlEXT"); + table->vkGetSwapchainCounterEXT = (PFN_vkGetSwapchainCounterEXT)load(context, "vkGetSwapchainCounterEXT"); + table->vkRegisterDeviceEventEXT = (PFN_vkRegisterDeviceEventEXT)load(context, "vkRegisterDeviceEventEXT"); + table->vkRegisterDisplayEventEXT = (PFN_vkRegisterDisplayEventEXT)load(context, "vkRegisterDisplayEventEXT"); +#endif /* defined(VK_EXT_display_control) */ +#if defined(VK_EXT_external_memory_host) + table->vkGetMemoryHostPointerPropertiesEXT = (PFN_vkGetMemoryHostPointerPropertiesEXT)load(context, "vkGetMemoryHostPointerPropertiesEXT"); +#endif /* defined(VK_EXT_external_memory_host) */ +#if defined(VK_EXT_full_screen_exclusive) + table->vkAcquireFullScreenExclusiveModeEXT = (PFN_vkAcquireFullScreenExclusiveModeEXT)load(context, "vkAcquireFullScreenExclusiveModeEXT"); + table->vkReleaseFullScreenExclusiveModeEXT = (PFN_vkReleaseFullScreenExclusiveModeEXT)load(context, "vkReleaseFullScreenExclusiveModeEXT"); +#endif /* defined(VK_EXT_full_screen_exclusive) */ +#if defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) + table->vkGetDeviceGroupSurfacePresentModes2EXT = (PFN_vkGetDeviceGroupSurfacePresentModes2EXT)load(context, "vkGetDeviceGroupSurfacePresentModes2EXT"); +#endif /* defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) */ +#if defined(VK_EXT_hdr_metadata) + table->vkSetHdrMetadataEXT = (PFN_vkSetHdrMetadataEXT)load(context, "vkSetHdrMetadataEXT"); +#endif /* defined(VK_EXT_hdr_metadata) */ +#if defined(VK_EXT_host_image_copy) + table->vkCopyImageToImageEXT = (PFN_vkCopyImageToImageEXT)load(context, "vkCopyImageToImageEXT"); + table->vkCopyImageToMemoryEXT = (PFN_vkCopyImageToMemoryEXT)load(context, "vkCopyImageToMemoryEXT"); + table->vkCopyMemoryToImageEXT = (PFN_vkCopyMemoryToImageEXT)load(context, "vkCopyMemoryToImageEXT"); + table->vkTransitionImageLayoutEXT = (PFN_vkTransitionImageLayoutEXT)load(context, "vkTransitionImageLayoutEXT"); +#endif /* defined(VK_EXT_host_image_copy) */ +#if defined(VK_EXT_host_query_reset) + table->vkResetQueryPoolEXT = (PFN_vkResetQueryPoolEXT)load(context, "vkResetQueryPoolEXT"); +#endif /* defined(VK_EXT_host_query_reset) */ +#if defined(VK_EXT_image_drm_format_modifier) + table->vkGetImageDrmFormatModifierPropertiesEXT = (PFN_vkGetImageDrmFormatModifierPropertiesEXT)load(context, "vkGetImageDrmFormatModifierPropertiesEXT"); +#endif /* defined(VK_EXT_image_drm_format_modifier) */ +#if defined(VK_EXT_line_rasterization) + table->vkCmdSetLineStippleEXT = (PFN_vkCmdSetLineStippleEXT)load(context, "vkCmdSetLineStippleEXT"); +#endif /* defined(VK_EXT_line_rasterization) */ +#if defined(VK_EXT_mesh_shader) + table->vkCmdDrawMeshTasksEXT = (PFN_vkCmdDrawMeshTasksEXT)load(context, "vkCmdDrawMeshTasksEXT"); + table->vkCmdDrawMeshTasksIndirectCountEXT = (PFN_vkCmdDrawMeshTasksIndirectCountEXT)load(context, "vkCmdDrawMeshTasksIndirectCountEXT"); + table->vkCmdDrawMeshTasksIndirectEXT = (PFN_vkCmdDrawMeshTasksIndirectEXT)load(context, "vkCmdDrawMeshTasksIndirectEXT"); +#endif /* defined(VK_EXT_mesh_shader) */ +#if defined(VK_EXT_metal_objects) + table->vkExportMetalObjectsEXT = (PFN_vkExportMetalObjectsEXT)load(context, "vkExportMetalObjectsEXT"); +#endif /* defined(VK_EXT_metal_objects) */ +#if defined(VK_EXT_multi_draw) + table->vkCmdDrawMultiEXT = (PFN_vkCmdDrawMultiEXT)load(context, "vkCmdDrawMultiEXT"); + table->vkCmdDrawMultiIndexedEXT = (PFN_vkCmdDrawMultiIndexedEXT)load(context, "vkCmdDrawMultiIndexedEXT"); +#endif /* defined(VK_EXT_multi_draw) */ +#if defined(VK_EXT_opacity_micromap) + table->vkBuildMicromapsEXT = (PFN_vkBuildMicromapsEXT)load(context, "vkBuildMicromapsEXT"); + table->vkCmdBuildMicromapsEXT = (PFN_vkCmdBuildMicromapsEXT)load(context, "vkCmdBuildMicromapsEXT"); + table->vkCmdCopyMemoryToMicromapEXT = (PFN_vkCmdCopyMemoryToMicromapEXT)load(context, "vkCmdCopyMemoryToMicromapEXT"); + table->vkCmdCopyMicromapEXT = (PFN_vkCmdCopyMicromapEXT)load(context, "vkCmdCopyMicromapEXT"); + table->vkCmdCopyMicromapToMemoryEXT = (PFN_vkCmdCopyMicromapToMemoryEXT)load(context, "vkCmdCopyMicromapToMemoryEXT"); + table->vkCmdWriteMicromapsPropertiesEXT = (PFN_vkCmdWriteMicromapsPropertiesEXT)load(context, "vkCmdWriteMicromapsPropertiesEXT"); + table->vkCopyMemoryToMicromapEXT = (PFN_vkCopyMemoryToMicromapEXT)load(context, "vkCopyMemoryToMicromapEXT"); + table->vkCopyMicromapEXT = (PFN_vkCopyMicromapEXT)load(context, "vkCopyMicromapEXT"); + table->vkCopyMicromapToMemoryEXT = (PFN_vkCopyMicromapToMemoryEXT)load(context, "vkCopyMicromapToMemoryEXT"); + table->vkCreateMicromapEXT = (PFN_vkCreateMicromapEXT)load(context, "vkCreateMicromapEXT"); + table->vkDestroyMicromapEXT = (PFN_vkDestroyMicromapEXT)load(context, "vkDestroyMicromapEXT"); + table->vkGetDeviceMicromapCompatibilityEXT = (PFN_vkGetDeviceMicromapCompatibilityEXT)load(context, "vkGetDeviceMicromapCompatibilityEXT"); + table->vkGetMicromapBuildSizesEXT = (PFN_vkGetMicromapBuildSizesEXT)load(context, "vkGetMicromapBuildSizesEXT"); + table->vkWriteMicromapsPropertiesEXT = (PFN_vkWriteMicromapsPropertiesEXT)load(context, "vkWriteMicromapsPropertiesEXT"); +#endif /* defined(VK_EXT_opacity_micromap) */ +#if defined(VK_EXT_pageable_device_local_memory) + table->vkSetDeviceMemoryPriorityEXT = (PFN_vkSetDeviceMemoryPriorityEXT)load(context, "vkSetDeviceMemoryPriorityEXT"); +#endif /* defined(VK_EXT_pageable_device_local_memory) */ +#if defined(VK_EXT_pipeline_properties) + table->vkGetPipelinePropertiesEXT = (PFN_vkGetPipelinePropertiesEXT)load(context, "vkGetPipelinePropertiesEXT"); +#endif /* defined(VK_EXT_pipeline_properties) */ +#if defined(VK_EXT_private_data) + table->vkCreatePrivateDataSlotEXT = (PFN_vkCreatePrivateDataSlotEXT)load(context, "vkCreatePrivateDataSlotEXT"); + table->vkDestroyPrivateDataSlotEXT = (PFN_vkDestroyPrivateDataSlotEXT)load(context, "vkDestroyPrivateDataSlotEXT"); + table->vkGetPrivateDataEXT = (PFN_vkGetPrivateDataEXT)load(context, "vkGetPrivateDataEXT"); + table->vkSetPrivateDataEXT = (PFN_vkSetPrivateDataEXT)load(context, "vkSetPrivateDataEXT"); +#endif /* defined(VK_EXT_private_data) */ +#if defined(VK_EXT_sample_locations) + table->vkCmdSetSampleLocationsEXT = (PFN_vkCmdSetSampleLocationsEXT)load(context, "vkCmdSetSampleLocationsEXT"); +#endif /* defined(VK_EXT_sample_locations) */ +#if defined(VK_EXT_shader_module_identifier) + table->vkGetShaderModuleCreateInfoIdentifierEXT = (PFN_vkGetShaderModuleCreateInfoIdentifierEXT)load(context, "vkGetShaderModuleCreateInfoIdentifierEXT"); + table->vkGetShaderModuleIdentifierEXT = (PFN_vkGetShaderModuleIdentifierEXT)load(context, "vkGetShaderModuleIdentifierEXT"); +#endif /* defined(VK_EXT_shader_module_identifier) */ +#if defined(VK_EXT_shader_object) + table->vkCmdBindShadersEXT = (PFN_vkCmdBindShadersEXT)load(context, "vkCmdBindShadersEXT"); + table->vkCreateShadersEXT = (PFN_vkCreateShadersEXT)load(context, "vkCreateShadersEXT"); + table->vkDestroyShaderEXT = (PFN_vkDestroyShaderEXT)load(context, "vkDestroyShaderEXT"); + table->vkGetShaderBinaryDataEXT = (PFN_vkGetShaderBinaryDataEXT)load(context, "vkGetShaderBinaryDataEXT"); +#endif /* defined(VK_EXT_shader_object) */ +#if defined(VK_EXT_swapchain_maintenance1) + table->vkReleaseSwapchainImagesEXT = (PFN_vkReleaseSwapchainImagesEXT)load(context, "vkReleaseSwapchainImagesEXT"); +#endif /* defined(VK_EXT_swapchain_maintenance1) */ +#if defined(VK_EXT_transform_feedback) + table->vkCmdBeginQueryIndexedEXT = (PFN_vkCmdBeginQueryIndexedEXT)load(context, "vkCmdBeginQueryIndexedEXT"); + table->vkCmdBeginTransformFeedbackEXT = (PFN_vkCmdBeginTransformFeedbackEXT)load(context, "vkCmdBeginTransformFeedbackEXT"); + table->vkCmdBindTransformFeedbackBuffersEXT = (PFN_vkCmdBindTransformFeedbackBuffersEXT)load(context, "vkCmdBindTransformFeedbackBuffersEXT"); + table->vkCmdDrawIndirectByteCountEXT = (PFN_vkCmdDrawIndirectByteCountEXT)load(context, "vkCmdDrawIndirectByteCountEXT"); + table->vkCmdEndQueryIndexedEXT = (PFN_vkCmdEndQueryIndexedEXT)load(context, "vkCmdEndQueryIndexedEXT"); + table->vkCmdEndTransformFeedbackEXT = (PFN_vkCmdEndTransformFeedbackEXT)load(context, "vkCmdEndTransformFeedbackEXT"); +#endif /* defined(VK_EXT_transform_feedback) */ +#if defined(VK_EXT_validation_cache) + table->vkCreateValidationCacheEXT = (PFN_vkCreateValidationCacheEXT)load(context, "vkCreateValidationCacheEXT"); + table->vkDestroyValidationCacheEXT = (PFN_vkDestroyValidationCacheEXT)load(context, "vkDestroyValidationCacheEXT"); + table->vkGetValidationCacheDataEXT = (PFN_vkGetValidationCacheDataEXT)load(context, "vkGetValidationCacheDataEXT"); + table->vkMergeValidationCachesEXT = (PFN_vkMergeValidationCachesEXT)load(context, "vkMergeValidationCachesEXT"); +#endif /* defined(VK_EXT_validation_cache) */ +#if defined(VK_FUCHSIA_buffer_collection) + table->vkCreateBufferCollectionFUCHSIA = (PFN_vkCreateBufferCollectionFUCHSIA)load(context, "vkCreateBufferCollectionFUCHSIA"); + table->vkDestroyBufferCollectionFUCHSIA = (PFN_vkDestroyBufferCollectionFUCHSIA)load(context, "vkDestroyBufferCollectionFUCHSIA"); + table->vkGetBufferCollectionPropertiesFUCHSIA = (PFN_vkGetBufferCollectionPropertiesFUCHSIA)load(context, "vkGetBufferCollectionPropertiesFUCHSIA"); + table->vkSetBufferCollectionBufferConstraintsFUCHSIA = (PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA)load(context, "vkSetBufferCollectionBufferConstraintsFUCHSIA"); + table->vkSetBufferCollectionImageConstraintsFUCHSIA = (PFN_vkSetBufferCollectionImageConstraintsFUCHSIA)load(context, "vkSetBufferCollectionImageConstraintsFUCHSIA"); +#endif /* defined(VK_FUCHSIA_buffer_collection) */ +#if defined(VK_FUCHSIA_external_memory) + table->vkGetMemoryZirconHandleFUCHSIA = (PFN_vkGetMemoryZirconHandleFUCHSIA)load(context, "vkGetMemoryZirconHandleFUCHSIA"); + table->vkGetMemoryZirconHandlePropertiesFUCHSIA = (PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)load(context, "vkGetMemoryZirconHandlePropertiesFUCHSIA"); +#endif /* defined(VK_FUCHSIA_external_memory) */ +#if defined(VK_FUCHSIA_external_semaphore) + table->vkGetSemaphoreZirconHandleFUCHSIA = (PFN_vkGetSemaphoreZirconHandleFUCHSIA)load(context, "vkGetSemaphoreZirconHandleFUCHSIA"); + table->vkImportSemaphoreZirconHandleFUCHSIA = (PFN_vkImportSemaphoreZirconHandleFUCHSIA)load(context, "vkImportSemaphoreZirconHandleFUCHSIA"); +#endif /* defined(VK_FUCHSIA_external_semaphore) */ +#if defined(VK_GOOGLE_display_timing) + table->vkGetPastPresentationTimingGOOGLE = (PFN_vkGetPastPresentationTimingGOOGLE)load(context, "vkGetPastPresentationTimingGOOGLE"); + table->vkGetRefreshCycleDurationGOOGLE = (PFN_vkGetRefreshCycleDurationGOOGLE)load(context, "vkGetRefreshCycleDurationGOOGLE"); +#endif /* defined(VK_GOOGLE_display_timing) */ +#if defined(VK_HUAWEI_cluster_culling_shader) + table->vkCmdDrawClusterHUAWEI = (PFN_vkCmdDrawClusterHUAWEI)load(context, "vkCmdDrawClusterHUAWEI"); + table->vkCmdDrawClusterIndirectHUAWEI = (PFN_vkCmdDrawClusterIndirectHUAWEI)load(context, "vkCmdDrawClusterIndirectHUAWEI"); +#endif /* defined(VK_HUAWEI_cluster_culling_shader) */ +#if defined(VK_HUAWEI_invocation_mask) + table->vkCmdBindInvocationMaskHUAWEI = (PFN_vkCmdBindInvocationMaskHUAWEI)load(context, "vkCmdBindInvocationMaskHUAWEI"); +#endif /* defined(VK_HUAWEI_invocation_mask) */ +#if defined(VK_HUAWEI_subpass_shading) + table->vkCmdSubpassShadingHUAWEI = (PFN_vkCmdSubpassShadingHUAWEI)load(context, "vkCmdSubpassShadingHUAWEI"); + table->vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI = (PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI)load(context, "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI"); +#endif /* defined(VK_HUAWEI_subpass_shading) */ +#if defined(VK_INTEL_performance_query) + table->vkAcquirePerformanceConfigurationINTEL = (PFN_vkAcquirePerformanceConfigurationINTEL)load(context, "vkAcquirePerformanceConfigurationINTEL"); + table->vkCmdSetPerformanceMarkerINTEL = (PFN_vkCmdSetPerformanceMarkerINTEL)load(context, "vkCmdSetPerformanceMarkerINTEL"); + table->vkCmdSetPerformanceOverrideINTEL = (PFN_vkCmdSetPerformanceOverrideINTEL)load(context, "vkCmdSetPerformanceOverrideINTEL"); + table->vkCmdSetPerformanceStreamMarkerINTEL = (PFN_vkCmdSetPerformanceStreamMarkerINTEL)load(context, "vkCmdSetPerformanceStreamMarkerINTEL"); + table->vkGetPerformanceParameterINTEL = (PFN_vkGetPerformanceParameterINTEL)load(context, "vkGetPerformanceParameterINTEL"); + table->vkInitializePerformanceApiINTEL = (PFN_vkInitializePerformanceApiINTEL)load(context, "vkInitializePerformanceApiINTEL"); + table->vkQueueSetPerformanceConfigurationINTEL = (PFN_vkQueueSetPerformanceConfigurationINTEL)load(context, "vkQueueSetPerformanceConfigurationINTEL"); + table->vkReleasePerformanceConfigurationINTEL = (PFN_vkReleasePerformanceConfigurationINTEL)load(context, "vkReleasePerformanceConfigurationINTEL"); + table->vkUninitializePerformanceApiINTEL = (PFN_vkUninitializePerformanceApiINTEL)load(context, "vkUninitializePerformanceApiINTEL"); +#endif /* defined(VK_INTEL_performance_query) */ +#if defined(VK_KHR_acceleration_structure) + table->vkBuildAccelerationStructuresKHR = (PFN_vkBuildAccelerationStructuresKHR)load(context, "vkBuildAccelerationStructuresKHR"); + table->vkCmdBuildAccelerationStructuresIndirectKHR = (PFN_vkCmdBuildAccelerationStructuresIndirectKHR)load(context, "vkCmdBuildAccelerationStructuresIndirectKHR"); + table->vkCmdBuildAccelerationStructuresKHR = (PFN_vkCmdBuildAccelerationStructuresKHR)load(context, "vkCmdBuildAccelerationStructuresKHR"); + table->vkCmdCopyAccelerationStructureKHR = (PFN_vkCmdCopyAccelerationStructureKHR)load(context, "vkCmdCopyAccelerationStructureKHR"); + table->vkCmdCopyAccelerationStructureToMemoryKHR = (PFN_vkCmdCopyAccelerationStructureToMemoryKHR)load(context, "vkCmdCopyAccelerationStructureToMemoryKHR"); + table->vkCmdCopyMemoryToAccelerationStructureKHR = (PFN_vkCmdCopyMemoryToAccelerationStructureKHR)load(context, "vkCmdCopyMemoryToAccelerationStructureKHR"); + table->vkCmdWriteAccelerationStructuresPropertiesKHR = (PFN_vkCmdWriteAccelerationStructuresPropertiesKHR)load(context, "vkCmdWriteAccelerationStructuresPropertiesKHR"); + table->vkCopyAccelerationStructureKHR = (PFN_vkCopyAccelerationStructureKHR)load(context, "vkCopyAccelerationStructureKHR"); + table->vkCopyAccelerationStructureToMemoryKHR = (PFN_vkCopyAccelerationStructureToMemoryKHR)load(context, "vkCopyAccelerationStructureToMemoryKHR"); + table->vkCopyMemoryToAccelerationStructureKHR = (PFN_vkCopyMemoryToAccelerationStructureKHR)load(context, "vkCopyMemoryToAccelerationStructureKHR"); + table->vkCreateAccelerationStructureKHR = (PFN_vkCreateAccelerationStructureKHR)load(context, "vkCreateAccelerationStructureKHR"); + table->vkDestroyAccelerationStructureKHR = (PFN_vkDestroyAccelerationStructureKHR)load(context, "vkDestroyAccelerationStructureKHR"); + table->vkGetAccelerationStructureBuildSizesKHR = (PFN_vkGetAccelerationStructureBuildSizesKHR)load(context, "vkGetAccelerationStructureBuildSizesKHR"); + table->vkGetAccelerationStructureDeviceAddressKHR = (PFN_vkGetAccelerationStructureDeviceAddressKHR)load(context, "vkGetAccelerationStructureDeviceAddressKHR"); + table->vkGetDeviceAccelerationStructureCompatibilityKHR = (PFN_vkGetDeviceAccelerationStructureCompatibilityKHR)load(context, "vkGetDeviceAccelerationStructureCompatibilityKHR"); + table->vkWriteAccelerationStructuresPropertiesKHR = (PFN_vkWriteAccelerationStructuresPropertiesKHR)load(context, "vkWriteAccelerationStructuresPropertiesKHR"); +#endif /* defined(VK_KHR_acceleration_structure) */ +#if defined(VK_KHR_bind_memory2) + table->vkBindBufferMemory2KHR = (PFN_vkBindBufferMemory2KHR)load(context, "vkBindBufferMemory2KHR"); + table->vkBindImageMemory2KHR = (PFN_vkBindImageMemory2KHR)load(context, "vkBindImageMemory2KHR"); +#endif /* defined(VK_KHR_bind_memory2) */ +#if defined(VK_KHR_buffer_device_address) + table->vkGetBufferDeviceAddressKHR = (PFN_vkGetBufferDeviceAddressKHR)load(context, "vkGetBufferDeviceAddressKHR"); + table->vkGetBufferOpaqueCaptureAddressKHR = (PFN_vkGetBufferOpaqueCaptureAddressKHR)load(context, "vkGetBufferOpaqueCaptureAddressKHR"); + table->vkGetDeviceMemoryOpaqueCaptureAddressKHR = (PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR)load(context, "vkGetDeviceMemoryOpaqueCaptureAddressKHR"); +#endif /* defined(VK_KHR_buffer_device_address) */ +#if defined(VK_KHR_calibrated_timestamps) + table->vkGetCalibratedTimestampsKHR = (PFN_vkGetCalibratedTimestampsKHR)load(context, "vkGetCalibratedTimestampsKHR"); +#endif /* defined(VK_KHR_calibrated_timestamps) */ +#if defined(VK_KHR_copy_commands2) + table->vkCmdBlitImage2KHR = (PFN_vkCmdBlitImage2KHR)load(context, "vkCmdBlitImage2KHR"); + table->vkCmdCopyBuffer2KHR = (PFN_vkCmdCopyBuffer2KHR)load(context, "vkCmdCopyBuffer2KHR"); + table->vkCmdCopyBufferToImage2KHR = (PFN_vkCmdCopyBufferToImage2KHR)load(context, "vkCmdCopyBufferToImage2KHR"); + table->vkCmdCopyImage2KHR = (PFN_vkCmdCopyImage2KHR)load(context, "vkCmdCopyImage2KHR"); + table->vkCmdCopyImageToBuffer2KHR = (PFN_vkCmdCopyImageToBuffer2KHR)load(context, "vkCmdCopyImageToBuffer2KHR"); + table->vkCmdResolveImage2KHR = (PFN_vkCmdResolveImage2KHR)load(context, "vkCmdResolveImage2KHR"); +#endif /* defined(VK_KHR_copy_commands2) */ +#if defined(VK_KHR_create_renderpass2) + table->vkCmdBeginRenderPass2KHR = (PFN_vkCmdBeginRenderPass2KHR)load(context, "vkCmdBeginRenderPass2KHR"); + table->vkCmdEndRenderPass2KHR = (PFN_vkCmdEndRenderPass2KHR)load(context, "vkCmdEndRenderPass2KHR"); + table->vkCmdNextSubpass2KHR = (PFN_vkCmdNextSubpass2KHR)load(context, "vkCmdNextSubpass2KHR"); + table->vkCreateRenderPass2KHR = (PFN_vkCreateRenderPass2KHR)load(context, "vkCreateRenderPass2KHR"); +#endif /* defined(VK_KHR_create_renderpass2) */ +#if defined(VK_KHR_deferred_host_operations) + table->vkCreateDeferredOperationKHR = (PFN_vkCreateDeferredOperationKHR)load(context, "vkCreateDeferredOperationKHR"); + table->vkDeferredOperationJoinKHR = (PFN_vkDeferredOperationJoinKHR)load(context, "vkDeferredOperationJoinKHR"); + table->vkDestroyDeferredOperationKHR = (PFN_vkDestroyDeferredOperationKHR)load(context, "vkDestroyDeferredOperationKHR"); + table->vkGetDeferredOperationMaxConcurrencyKHR = (PFN_vkGetDeferredOperationMaxConcurrencyKHR)load(context, "vkGetDeferredOperationMaxConcurrencyKHR"); + table->vkGetDeferredOperationResultKHR = (PFN_vkGetDeferredOperationResultKHR)load(context, "vkGetDeferredOperationResultKHR"); +#endif /* defined(VK_KHR_deferred_host_operations) */ +#if defined(VK_KHR_descriptor_update_template) + table->vkCreateDescriptorUpdateTemplateKHR = (PFN_vkCreateDescriptorUpdateTemplateKHR)load(context, "vkCreateDescriptorUpdateTemplateKHR"); + table->vkDestroyDescriptorUpdateTemplateKHR = (PFN_vkDestroyDescriptorUpdateTemplateKHR)load(context, "vkDestroyDescriptorUpdateTemplateKHR"); + table->vkUpdateDescriptorSetWithTemplateKHR = (PFN_vkUpdateDescriptorSetWithTemplateKHR)load(context, "vkUpdateDescriptorSetWithTemplateKHR"); +#endif /* defined(VK_KHR_descriptor_update_template) */ +#if defined(VK_KHR_device_group) + table->vkCmdDispatchBaseKHR = (PFN_vkCmdDispatchBaseKHR)load(context, "vkCmdDispatchBaseKHR"); + table->vkCmdSetDeviceMaskKHR = (PFN_vkCmdSetDeviceMaskKHR)load(context, "vkCmdSetDeviceMaskKHR"); + table->vkGetDeviceGroupPeerMemoryFeaturesKHR = (PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR)load(context, "vkGetDeviceGroupPeerMemoryFeaturesKHR"); +#endif /* defined(VK_KHR_device_group) */ +#if defined(VK_KHR_display_swapchain) + table->vkCreateSharedSwapchainsKHR = (PFN_vkCreateSharedSwapchainsKHR)load(context, "vkCreateSharedSwapchainsKHR"); +#endif /* defined(VK_KHR_display_swapchain) */ +#if defined(VK_KHR_draw_indirect_count) + table->vkCmdDrawIndexedIndirectCountKHR = (PFN_vkCmdDrawIndexedIndirectCountKHR)load(context, "vkCmdDrawIndexedIndirectCountKHR"); + table->vkCmdDrawIndirectCountKHR = (PFN_vkCmdDrawIndirectCountKHR)load(context, "vkCmdDrawIndirectCountKHR"); +#endif /* defined(VK_KHR_draw_indirect_count) */ +#if defined(VK_KHR_dynamic_rendering) + table->vkCmdBeginRenderingKHR = (PFN_vkCmdBeginRenderingKHR)load(context, "vkCmdBeginRenderingKHR"); + table->vkCmdEndRenderingKHR = (PFN_vkCmdEndRenderingKHR)load(context, "vkCmdEndRenderingKHR"); +#endif /* defined(VK_KHR_dynamic_rendering) */ +#if defined(VK_KHR_dynamic_rendering_local_read) + table->vkCmdSetRenderingAttachmentLocationsKHR = (PFN_vkCmdSetRenderingAttachmentLocationsKHR)load(context, "vkCmdSetRenderingAttachmentLocationsKHR"); + table->vkCmdSetRenderingInputAttachmentIndicesKHR = (PFN_vkCmdSetRenderingInputAttachmentIndicesKHR)load(context, "vkCmdSetRenderingInputAttachmentIndicesKHR"); +#endif /* defined(VK_KHR_dynamic_rendering_local_read) */ +#if defined(VK_KHR_external_fence_fd) + table->vkGetFenceFdKHR = (PFN_vkGetFenceFdKHR)load(context, "vkGetFenceFdKHR"); + table->vkImportFenceFdKHR = (PFN_vkImportFenceFdKHR)load(context, "vkImportFenceFdKHR"); +#endif /* defined(VK_KHR_external_fence_fd) */ +#if defined(VK_KHR_external_fence_win32) + table->vkGetFenceWin32HandleKHR = (PFN_vkGetFenceWin32HandleKHR)load(context, "vkGetFenceWin32HandleKHR"); + table->vkImportFenceWin32HandleKHR = (PFN_vkImportFenceWin32HandleKHR)load(context, "vkImportFenceWin32HandleKHR"); +#endif /* defined(VK_KHR_external_fence_win32) */ +#if defined(VK_KHR_external_memory_fd) + table->vkGetMemoryFdKHR = (PFN_vkGetMemoryFdKHR)load(context, "vkGetMemoryFdKHR"); + table->vkGetMemoryFdPropertiesKHR = (PFN_vkGetMemoryFdPropertiesKHR)load(context, "vkGetMemoryFdPropertiesKHR"); +#endif /* defined(VK_KHR_external_memory_fd) */ +#if defined(VK_KHR_external_memory_win32) + table->vkGetMemoryWin32HandleKHR = (PFN_vkGetMemoryWin32HandleKHR)load(context, "vkGetMemoryWin32HandleKHR"); + table->vkGetMemoryWin32HandlePropertiesKHR = (PFN_vkGetMemoryWin32HandlePropertiesKHR)load(context, "vkGetMemoryWin32HandlePropertiesKHR"); +#endif /* defined(VK_KHR_external_memory_win32) */ +#if defined(VK_KHR_external_semaphore_fd) + table->vkGetSemaphoreFdKHR = (PFN_vkGetSemaphoreFdKHR)load(context, "vkGetSemaphoreFdKHR"); + table->vkImportSemaphoreFdKHR = (PFN_vkImportSemaphoreFdKHR)load(context, "vkImportSemaphoreFdKHR"); +#endif /* defined(VK_KHR_external_semaphore_fd) */ +#if defined(VK_KHR_external_semaphore_win32) + table->vkGetSemaphoreWin32HandleKHR = (PFN_vkGetSemaphoreWin32HandleKHR)load(context, "vkGetSemaphoreWin32HandleKHR"); + table->vkImportSemaphoreWin32HandleKHR = (PFN_vkImportSemaphoreWin32HandleKHR)load(context, "vkImportSemaphoreWin32HandleKHR"); +#endif /* defined(VK_KHR_external_semaphore_win32) */ +#if defined(VK_KHR_fragment_shading_rate) + table->vkCmdSetFragmentShadingRateKHR = (PFN_vkCmdSetFragmentShadingRateKHR)load(context, "vkCmdSetFragmentShadingRateKHR"); +#endif /* defined(VK_KHR_fragment_shading_rate) */ +#if defined(VK_KHR_get_memory_requirements2) + table->vkGetBufferMemoryRequirements2KHR = (PFN_vkGetBufferMemoryRequirements2KHR)load(context, "vkGetBufferMemoryRequirements2KHR"); + table->vkGetImageMemoryRequirements2KHR = (PFN_vkGetImageMemoryRequirements2KHR)load(context, "vkGetImageMemoryRequirements2KHR"); + table->vkGetImageSparseMemoryRequirements2KHR = (PFN_vkGetImageSparseMemoryRequirements2KHR)load(context, "vkGetImageSparseMemoryRequirements2KHR"); +#endif /* defined(VK_KHR_get_memory_requirements2) */ +#if defined(VK_KHR_line_rasterization) + table->vkCmdSetLineStippleKHR = (PFN_vkCmdSetLineStippleKHR)load(context, "vkCmdSetLineStippleKHR"); +#endif /* defined(VK_KHR_line_rasterization) */ +#if defined(VK_KHR_maintenance1) + table->vkTrimCommandPoolKHR = (PFN_vkTrimCommandPoolKHR)load(context, "vkTrimCommandPoolKHR"); +#endif /* defined(VK_KHR_maintenance1) */ +#if defined(VK_KHR_maintenance3) + table->vkGetDescriptorSetLayoutSupportKHR = (PFN_vkGetDescriptorSetLayoutSupportKHR)load(context, "vkGetDescriptorSetLayoutSupportKHR"); +#endif /* defined(VK_KHR_maintenance3) */ +#if defined(VK_KHR_maintenance4) + table->vkGetDeviceBufferMemoryRequirementsKHR = (PFN_vkGetDeviceBufferMemoryRequirementsKHR)load(context, "vkGetDeviceBufferMemoryRequirementsKHR"); + table->vkGetDeviceImageMemoryRequirementsKHR = (PFN_vkGetDeviceImageMemoryRequirementsKHR)load(context, "vkGetDeviceImageMemoryRequirementsKHR"); + table->vkGetDeviceImageSparseMemoryRequirementsKHR = (PFN_vkGetDeviceImageSparseMemoryRequirementsKHR)load(context, "vkGetDeviceImageSparseMemoryRequirementsKHR"); +#endif /* defined(VK_KHR_maintenance4) */ +#if defined(VK_KHR_maintenance5) + table->vkCmdBindIndexBuffer2KHR = (PFN_vkCmdBindIndexBuffer2KHR)load(context, "vkCmdBindIndexBuffer2KHR"); + table->vkGetDeviceImageSubresourceLayoutKHR = (PFN_vkGetDeviceImageSubresourceLayoutKHR)load(context, "vkGetDeviceImageSubresourceLayoutKHR"); + table->vkGetImageSubresourceLayout2KHR = (PFN_vkGetImageSubresourceLayout2KHR)load(context, "vkGetImageSubresourceLayout2KHR"); + table->vkGetRenderingAreaGranularityKHR = (PFN_vkGetRenderingAreaGranularityKHR)load(context, "vkGetRenderingAreaGranularityKHR"); +#endif /* defined(VK_KHR_maintenance5) */ +#if defined(VK_KHR_maintenance6) + table->vkCmdBindDescriptorSets2KHR = (PFN_vkCmdBindDescriptorSets2KHR)load(context, "vkCmdBindDescriptorSets2KHR"); + table->vkCmdPushConstants2KHR = (PFN_vkCmdPushConstants2KHR)load(context, "vkCmdPushConstants2KHR"); +#endif /* defined(VK_KHR_maintenance6) */ +#if defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) + table->vkCmdPushDescriptorSet2KHR = (PFN_vkCmdPushDescriptorSet2KHR)load(context, "vkCmdPushDescriptorSet2KHR"); + table->vkCmdPushDescriptorSetWithTemplate2KHR = (PFN_vkCmdPushDescriptorSetWithTemplate2KHR)load(context, "vkCmdPushDescriptorSetWithTemplate2KHR"); +#endif /* defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) + table->vkCmdBindDescriptorBufferEmbeddedSamplers2EXT = (PFN_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT)load(context, "vkCmdBindDescriptorBufferEmbeddedSamplers2EXT"); + table->vkCmdSetDescriptorBufferOffsets2EXT = (PFN_vkCmdSetDescriptorBufferOffsets2EXT)load(context, "vkCmdSetDescriptorBufferOffsets2EXT"); +#endif /* defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_KHR_map_memory2) + table->vkMapMemory2KHR = (PFN_vkMapMemory2KHR)load(context, "vkMapMemory2KHR"); + table->vkUnmapMemory2KHR = (PFN_vkUnmapMemory2KHR)load(context, "vkUnmapMemory2KHR"); +#endif /* defined(VK_KHR_map_memory2) */ +#if defined(VK_KHR_performance_query) + table->vkAcquireProfilingLockKHR = (PFN_vkAcquireProfilingLockKHR)load(context, "vkAcquireProfilingLockKHR"); + table->vkReleaseProfilingLockKHR = (PFN_vkReleaseProfilingLockKHR)load(context, "vkReleaseProfilingLockKHR"); +#endif /* defined(VK_KHR_performance_query) */ +#if defined(VK_KHR_pipeline_executable_properties) + table->vkGetPipelineExecutableInternalRepresentationsKHR = (PFN_vkGetPipelineExecutableInternalRepresentationsKHR)load(context, "vkGetPipelineExecutableInternalRepresentationsKHR"); + table->vkGetPipelineExecutablePropertiesKHR = (PFN_vkGetPipelineExecutablePropertiesKHR)load(context, "vkGetPipelineExecutablePropertiesKHR"); + table->vkGetPipelineExecutableStatisticsKHR = (PFN_vkGetPipelineExecutableStatisticsKHR)load(context, "vkGetPipelineExecutableStatisticsKHR"); +#endif /* defined(VK_KHR_pipeline_executable_properties) */ +#if defined(VK_KHR_present_wait) + table->vkWaitForPresentKHR = (PFN_vkWaitForPresentKHR)load(context, "vkWaitForPresentKHR"); +#endif /* defined(VK_KHR_present_wait) */ +#if defined(VK_KHR_push_descriptor) + table->vkCmdPushDescriptorSetKHR = (PFN_vkCmdPushDescriptorSetKHR)load(context, "vkCmdPushDescriptorSetKHR"); +#endif /* defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) + table->vkCmdTraceRaysIndirect2KHR = (PFN_vkCmdTraceRaysIndirect2KHR)load(context, "vkCmdTraceRaysIndirect2KHR"); +#endif /* defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_ray_tracing_pipeline) + table->vkCmdSetRayTracingPipelineStackSizeKHR = (PFN_vkCmdSetRayTracingPipelineStackSizeKHR)load(context, "vkCmdSetRayTracingPipelineStackSizeKHR"); + table->vkCmdTraceRaysIndirectKHR = (PFN_vkCmdTraceRaysIndirectKHR)load(context, "vkCmdTraceRaysIndirectKHR"); + table->vkCmdTraceRaysKHR = (PFN_vkCmdTraceRaysKHR)load(context, "vkCmdTraceRaysKHR"); + table->vkCreateRayTracingPipelinesKHR = (PFN_vkCreateRayTracingPipelinesKHR)load(context, "vkCreateRayTracingPipelinesKHR"); + table->vkGetRayTracingCaptureReplayShaderGroupHandlesKHR = (PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR)load(context, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR"); + table->vkGetRayTracingShaderGroupHandlesKHR = (PFN_vkGetRayTracingShaderGroupHandlesKHR)load(context, "vkGetRayTracingShaderGroupHandlesKHR"); + table->vkGetRayTracingShaderGroupStackSizeKHR = (PFN_vkGetRayTracingShaderGroupStackSizeKHR)load(context, "vkGetRayTracingShaderGroupStackSizeKHR"); +#endif /* defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_sampler_ycbcr_conversion) + table->vkCreateSamplerYcbcrConversionKHR = (PFN_vkCreateSamplerYcbcrConversionKHR)load(context, "vkCreateSamplerYcbcrConversionKHR"); + table->vkDestroySamplerYcbcrConversionKHR = (PFN_vkDestroySamplerYcbcrConversionKHR)load(context, "vkDestroySamplerYcbcrConversionKHR"); +#endif /* defined(VK_KHR_sampler_ycbcr_conversion) */ +#if defined(VK_KHR_shared_presentable_image) + table->vkGetSwapchainStatusKHR = (PFN_vkGetSwapchainStatusKHR)load(context, "vkGetSwapchainStatusKHR"); +#endif /* defined(VK_KHR_shared_presentable_image) */ +#if defined(VK_KHR_swapchain) + table->vkAcquireNextImageKHR = (PFN_vkAcquireNextImageKHR)load(context, "vkAcquireNextImageKHR"); + table->vkCreateSwapchainKHR = (PFN_vkCreateSwapchainKHR)load(context, "vkCreateSwapchainKHR"); + table->vkDestroySwapchainKHR = (PFN_vkDestroySwapchainKHR)load(context, "vkDestroySwapchainKHR"); + table->vkGetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR)load(context, "vkGetSwapchainImagesKHR"); + table->vkQueuePresentKHR = (PFN_vkQueuePresentKHR)load(context, "vkQueuePresentKHR"); +#endif /* defined(VK_KHR_swapchain) */ +#if defined(VK_KHR_synchronization2) + table->vkCmdPipelineBarrier2KHR = (PFN_vkCmdPipelineBarrier2KHR)load(context, "vkCmdPipelineBarrier2KHR"); + table->vkCmdResetEvent2KHR = (PFN_vkCmdResetEvent2KHR)load(context, "vkCmdResetEvent2KHR"); + table->vkCmdSetEvent2KHR = (PFN_vkCmdSetEvent2KHR)load(context, "vkCmdSetEvent2KHR"); + table->vkCmdWaitEvents2KHR = (PFN_vkCmdWaitEvents2KHR)load(context, "vkCmdWaitEvents2KHR"); + table->vkCmdWriteTimestamp2KHR = (PFN_vkCmdWriteTimestamp2KHR)load(context, "vkCmdWriteTimestamp2KHR"); + table->vkQueueSubmit2KHR = (PFN_vkQueueSubmit2KHR)load(context, "vkQueueSubmit2KHR"); +#endif /* defined(VK_KHR_synchronization2) */ +#if defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) + table->vkCmdWriteBufferMarker2AMD = (PFN_vkCmdWriteBufferMarker2AMD)load(context, "vkCmdWriteBufferMarker2AMD"); +#endif /* defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) */ +#if defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) + table->vkGetQueueCheckpointData2NV = (PFN_vkGetQueueCheckpointData2NV)load(context, "vkGetQueueCheckpointData2NV"); +#endif /* defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_KHR_timeline_semaphore) + table->vkGetSemaphoreCounterValueKHR = (PFN_vkGetSemaphoreCounterValueKHR)load(context, "vkGetSemaphoreCounterValueKHR"); + table->vkSignalSemaphoreKHR = (PFN_vkSignalSemaphoreKHR)load(context, "vkSignalSemaphoreKHR"); + table->vkWaitSemaphoresKHR = (PFN_vkWaitSemaphoresKHR)load(context, "vkWaitSemaphoresKHR"); +#endif /* defined(VK_KHR_timeline_semaphore) */ +#if defined(VK_KHR_video_decode_queue) + table->vkCmdDecodeVideoKHR = (PFN_vkCmdDecodeVideoKHR)load(context, "vkCmdDecodeVideoKHR"); +#endif /* defined(VK_KHR_video_decode_queue) */ +#if defined(VK_KHR_video_encode_queue) + table->vkCmdEncodeVideoKHR = (PFN_vkCmdEncodeVideoKHR)load(context, "vkCmdEncodeVideoKHR"); + table->vkGetEncodedVideoSessionParametersKHR = (PFN_vkGetEncodedVideoSessionParametersKHR)load(context, "vkGetEncodedVideoSessionParametersKHR"); +#endif /* defined(VK_KHR_video_encode_queue) */ +#if defined(VK_KHR_video_queue) + table->vkBindVideoSessionMemoryKHR = (PFN_vkBindVideoSessionMemoryKHR)load(context, "vkBindVideoSessionMemoryKHR"); + table->vkCmdBeginVideoCodingKHR = (PFN_vkCmdBeginVideoCodingKHR)load(context, "vkCmdBeginVideoCodingKHR"); + table->vkCmdControlVideoCodingKHR = (PFN_vkCmdControlVideoCodingKHR)load(context, "vkCmdControlVideoCodingKHR"); + table->vkCmdEndVideoCodingKHR = (PFN_vkCmdEndVideoCodingKHR)load(context, "vkCmdEndVideoCodingKHR"); + table->vkCreateVideoSessionKHR = (PFN_vkCreateVideoSessionKHR)load(context, "vkCreateVideoSessionKHR"); + table->vkCreateVideoSessionParametersKHR = (PFN_vkCreateVideoSessionParametersKHR)load(context, "vkCreateVideoSessionParametersKHR"); + table->vkDestroyVideoSessionKHR = (PFN_vkDestroyVideoSessionKHR)load(context, "vkDestroyVideoSessionKHR"); + table->vkDestroyVideoSessionParametersKHR = (PFN_vkDestroyVideoSessionParametersKHR)load(context, "vkDestroyVideoSessionParametersKHR"); + table->vkGetVideoSessionMemoryRequirementsKHR = (PFN_vkGetVideoSessionMemoryRequirementsKHR)load(context, "vkGetVideoSessionMemoryRequirementsKHR"); + table->vkUpdateVideoSessionParametersKHR = (PFN_vkUpdateVideoSessionParametersKHR)load(context, "vkUpdateVideoSessionParametersKHR"); +#endif /* defined(VK_KHR_video_queue) */ +#if defined(VK_NVX_binary_import) + table->vkCmdCuLaunchKernelNVX = (PFN_vkCmdCuLaunchKernelNVX)load(context, "vkCmdCuLaunchKernelNVX"); + table->vkCreateCuFunctionNVX = (PFN_vkCreateCuFunctionNVX)load(context, "vkCreateCuFunctionNVX"); + table->vkCreateCuModuleNVX = (PFN_vkCreateCuModuleNVX)load(context, "vkCreateCuModuleNVX"); + table->vkDestroyCuFunctionNVX = (PFN_vkDestroyCuFunctionNVX)load(context, "vkDestroyCuFunctionNVX"); + table->vkDestroyCuModuleNVX = (PFN_vkDestroyCuModuleNVX)load(context, "vkDestroyCuModuleNVX"); +#endif /* defined(VK_NVX_binary_import) */ +#if defined(VK_NVX_image_view_handle) + table->vkGetImageViewAddressNVX = (PFN_vkGetImageViewAddressNVX)load(context, "vkGetImageViewAddressNVX"); + table->vkGetImageViewHandleNVX = (PFN_vkGetImageViewHandleNVX)load(context, "vkGetImageViewHandleNVX"); +#endif /* defined(VK_NVX_image_view_handle) */ +#if defined(VK_NV_clip_space_w_scaling) + table->vkCmdSetViewportWScalingNV = (PFN_vkCmdSetViewportWScalingNV)load(context, "vkCmdSetViewportWScalingNV"); +#endif /* defined(VK_NV_clip_space_w_scaling) */ +#if defined(VK_NV_copy_memory_indirect) + table->vkCmdCopyMemoryIndirectNV = (PFN_vkCmdCopyMemoryIndirectNV)load(context, "vkCmdCopyMemoryIndirectNV"); + table->vkCmdCopyMemoryToImageIndirectNV = (PFN_vkCmdCopyMemoryToImageIndirectNV)load(context, "vkCmdCopyMemoryToImageIndirectNV"); +#endif /* defined(VK_NV_copy_memory_indirect) */ +#if defined(VK_NV_cuda_kernel_launch) + table->vkCmdCudaLaunchKernelNV = (PFN_vkCmdCudaLaunchKernelNV)load(context, "vkCmdCudaLaunchKernelNV"); + table->vkCreateCudaFunctionNV = (PFN_vkCreateCudaFunctionNV)load(context, "vkCreateCudaFunctionNV"); + table->vkCreateCudaModuleNV = (PFN_vkCreateCudaModuleNV)load(context, "vkCreateCudaModuleNV"); + table->vkDestroyCudaFunctionNV = (PFN_vkDestroyCudaFunctionNV)load(context, "vkDestroyCudaFunctionNV"); + table->vkDestroyCudaModuleNV = (PFN_vkDestroyCudaModuleNV)load(context, "vkDestroyCudaModuleNV"); + table->vkGetCudaModuleCacheNV = (PFN_vkGetCudaModuleCacheNV)load(context, "vkGetCudaModuleCacheNV"); +#endif /* defined(VK_NV_cuda_kernel_launch) */ +#if defined(VK_NV_device_diagnostic_checkpoints) + table->vkCmdSetCheckpointNV = (PFN_vkCmdSetCheckpointNV)load(context, "vkCmdSetCheckpointNV"); + table->vkGetQueueCheckpointDataNV = (PFN_vkGetQueueCheckpointDataNV)load(context, "vkGetQueueCheckpointDataNV"); +#endif /* defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_NV_device_generated_commands) + table->vkCmdBindPipelineShaderGroupNV = (PFN_vkCmdBindPipelineShaderGroupNV)load(context, "vkCmdBindPipelineShaderGroupNV"); + table->vkCmdExecuteGeneratedCommandsNV = (PFN_vkCmdExecuteGeneratedCommandsNV)load(context, "vkCmdExecuteGeneratedCommandsNV"); + table->vkCmdPreprocessGeneratedCommandsNV = (PFN_vkCmdPreprocessGeneratedCommandsNV)load(context, "vkCmdPreprocessGeneratedCommandsNV"); + table->vkCreateIndirectCommandsLayoutNV = (PFN_vkCreateIndirectCommandsLayoutNV)load(context, "vkCreateIndirectCommandsLayoutNV"); + table->vkDestroyIndirectCommandsLayoutNV = (PFN_vkDestroyIndirectCommandsLayoutNV)load(context, "vkDestroyIndirectCommandsLayoutNV"); + table->vkGetGeneratedCommandsMemoryRequirementsNV = (PFN_vkGetGeneratedCommandsMemoryRequirementsNV)load(context, "vkGetGeneratedCommandsMemoryRequirementsNV"); +#endif /* defined(VK_NV_device_generated_commands) */ +#if defined(VK_NV_device_generated_commands_compute) + table->vkCmdUpdatePipelineIndirectBufferNV = (PFN_vkCmdUpdatePipelineIndirectBufferNV)load(context, "vkCmdUpdatePipelineIndirectBufferNV"); + table->vkGetPipelineIndirectDeviceAddressNV = (PFN_vkGetPipelineIndirectDeviceAddressNV)load(context, "vkGetPipelineIndirectDeviceAddressNV"); + table->vkGetPipelineIndirectMemoryRequirementsNV = (PFN_vkGetPipelineIndirectMemoryRequirementsNV)load(context, "vkGetPipelineIndirectMemoryRequirementsNV"); +#endif /* defined(VK_NV_device_generated_commands_compute) */ +#if defined(VK_NV_external_memory_rdma) + table->vkGetMemoryRemoteAddressNV = (PFN_vkGetMemoryRemoteAddressNV)load(context, "vkGetMemoryRemoteAddressNV"); +#endif /* defined(VK_NV_external_memory_rdma) */ +#if defined(VK_NV_external_memory_win32) + table->vkGetMemoryWin32HandleNV = (PFN_vkGetMemoryWin32HandleNV)load(context, "vkGetMemoryWin32HandleNV"); +#endif /* defined(VK_NV_external_memory_win32) */ +#if defined(VK_NV_fragment_shading_rate_enums) + table->vkCmdSetFragmentShadingRateEnumNV = (PFN_vkCmdSetFragmentShadingRateEnumNV)load(context, "vkCmdSetFragmentShadingRateEnumNV"); +#endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) + table->vkGetLatencyTimingsNV = (PFN_vkGetLatencyTimingsNV)load(context, "vkGetLatencyTimingsNV"); + table->vkLatencySleepNV = (PFN_vkLatencySleepNV)load(context, "vkLatencySleepNV"); + table->vkQueueNotifyOutOfBandNV = (PFN_vkQueueNotifyOutOfBandNV)load(context, "vkQueueNotifyOutOfBandNV"); + table->vkSetLatencyMarkerNV = (PFN_vkSetLatencyMarkerNV)load(context, "vkSetLatencyMarkerNV"); + table->vkSetLatencySleepModeNV = (PFN_vkSetLatencySleepModeNV)load(context, "vkSetLatencySleepModeNV"); +#endif /* defined(VK_NV_low_latency2) */ +#if defined(VK_NV_memory_decompression) + table->vkCmdDecompressMemoryIndirectCountNV = (PFN_vkCmdDecompressMemoryIndirectCountNV)load(context, "vkCmdDecompressMemoryIndirectCountNV"); + table->vkCmdDecompressMemoryNV = (PFN_vkCmdDecompressMemoryNV)load(context, "vkCmdDecompressMemoryNV"); +#endif /* defined(VK_NV_memory_decompression) */ +#if defined(VK_NV_mesh_shader) + table->vkCmdDrawMeshTasksIndirectCountNV = (PFN_vkCmdDrawMeshTasksIndirectCountNV)load(context, "vkCmdDrawMeshTasksIndirectCountNV"); + table->vkCmdDrawMeshTasksIndirectNV = (PFN_vkCmdDrawMeshTasksIndirectNV)load(context, "vkCmdDrawMeshTasksIndirectNV"); + table->vkCmdDrawMeshTasksNV = (PFN_vkCmdDrawMeshTasksNV)load(context, "vkCmdDrawMeshTasksNV"); +#endif /* defined(VK_NV_mesh_shader) */ +#if defined(VK_NV_optical_flow) + table->vkBindOpticalFlowSessionImageNV = (PFN_vkBindOpticalFlowSessionImageNV)load(context, "vkBindOpticalFlowSessionImageNV"); + table->vkCmdOpticalFlowExecuteNV = (PFN_vkCmdOpticalFlowExecuteNV)load(context, "vkCmdOpticalFlowExecuteNV"); + table->vkCreateOpticalFlowSessionNV = (PFN_vkCreateOpticalFlowSessionNV)load(context, "vkCreateOpticalFlowSessionNV"); + table->vkDestroyOpticalFlowSessionNV = (PFN_vkDestroyOpticalFlowSessionNV)load(context, "vkDestroyOpticalFlowSessionNV"); +#endif /* defined(VK_NV_optical_flow) */ +#if defined(VK_NV_ray_tracing) + table->vkBindAccelerationStructureMemoryNV = (PFN_vkBindAccelerationStructureMemoryNV)load(context, "vkBindAccelerationStructureMemoryNV"); + table->vkCmdBuildAccelerationStructureNV = (PFN_vkCmdBuildAccelerationStructureNV)load(context, "vkCmdBuildAccelerationStructureNV"); + table->vkCmdCopyAccelerationStructureNV = (PFN_vkCmdCopyAccelerationStructureNV)load(context, "vkCmdCopyAccelerationStructureNV"); + table->vkCmdTraceRaysNV = (PFN_vkCmdTraceRaysNV)load(context, "vkCmdTraceRaysNV"); + table->vkCmdWriteAccelerationStructuresPropertiesNV = (PFN_vkCmdWriteAccelerationStructuresPropertiesNV)load(context, "vkCmdWriteAccelerationStructuresPropertiesNV"); + table->vkCompileDeferredNV = (PFN_vkCompileDeferredNV)load(context, "vkCompileDeferredNV"); + table->vkCreateAccelerationStructureNV = (PFN_vkCreateAccelerationStructureNV)load(context, "vkCreateAccelerationStructureNV"); + table->vkCreateRayTracingPipelinesNV = (PFN_vkCreateRayTracingPipelinesNV)load(context, "vkCreateRayTracingPipelinesNV"); + table->vkDestroyAccelerationStructureNV = (PFN_vkDestroyAccelerationStructureNV)load(context, "vkDestroyAccelerationStructureNV"); + table->vkGetAccelerationStructureHandleNV = (PFN_vkGetAccelerationStructureHandleNV)load(context, "vkGetAccelerationStructureHandleNV"); + table->vkGetAccelerationStructureMemoryRequirementsNV = (PFN_vkGetAccelerationStructureMemoryRequirementsNV)load(context, "vkGetAccelerationStructureMemoryRequirementsNV"); + table->vkGetRayTracingShaderGroupHandlesNV = (PFN_vkGetRayTracingShaderGroupHandlesNV)load(context, "vkGetRayTracingShaderGroupHandlesNV"); +#endif /* defined(VK_NV_ray_tracing) */ +#if defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 + table->vkCmdSetExclusiveScissorEnableNV = (PFN_vkCmdSetExclusiveScissorEnableNV)load(context, "vkCmdSetExclusiveScissorEnableNV"); +#endif /* defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 */ +#if defined(VK_NV_scissor_exclusive) + table->vkCmdSetExclusiveScissorNV = (PFN_vkCmdSetExclusiveScissorNV)load(context, "vkCmdSetExclusiveScissorNV"); +#endif /* defined(VK_NV_scissor_exclusive) */ +#if defined(VK_NV_shading_rate_image) + table->vkCmdBindShadingRateImageNV = (PFN_vkCmdBindShadingRateImageNV)load(context, "vkCmdBindShadingRateImageNV"); + table->vkCmdSetCoarseSampleOrderNV = (PFN_vkCmdSetCoarseSampleOrderNV)load(context, "vkCmdSetCoarseSampleOrderNV"); + table->vkCmdSetViewportShadingRatePaletteNV = (PFN_vkCmdSetViewportShadingRatePaletteNV)load(context, "vkCmdSetViewportShadingRatePaletteNV"); +#endif /* defined(VK_NV_shading_rate_image) */ +#if defined(VK_QCOM_tile_properties) + table->vkGetDynamicRenderingTilePropertiesQCOM = (PFN_vkGetDynamicRenderingTilePropertiesQCOM)load(context, "vkGetDynamicRenderingTilePropertiesQCOM"); + table->vkGetFramebufferTilePropertiesQCOM = (PFN_vkGetFramebufferTilePropertiesQCOM)load(context, "vkGetFramebufferTilePropertiesQCOM"); +#endif /* defined(VK_QCOM_tile_properties) */ +#if defined(VK_QNX_external_memory_screen_buffer) + table->vkGetScreenBufferPropertiesQNX = (PFN_vkGetScreenBufferPropertiesQNX)load(context, "vkGetScreenBufferPropertiesQNX"); +#endif /* defined(VK_QNX_external_memory_screen_buffer) */ +#if defined(VK_VALVE_descriptor_set_host_mapping) + table->vkGetDescriptorSetHostMappingVALVE = (PFN_vkGetDescriptorSetHostMappingVALVE)load(context, "vkGetDescriptorSetHostMappingVALVE"); + table->vkGetDescriptorSetLayoutHostMappingInfoVALVE = (PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE)load(context, "vkGetDescriptorSetLayoutHostMappingInfoVALVE"); +#endif /* defined(VK_VALVE_descriptor_set_host_mapping) */ +#if (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) + table->vkCmdBindVertexBuffers2EXT = (PFN_vkCmdBindVertexBuffers2EXT)load(context, "vkCmdBindVertexBuffers2EXT"); + table->vkCmdSetCullModeEXT = (PFN_vkCmdSetCullModeEXT)load(context, "vkCmdSetCullModeEXT"); + table->vkCmdSetDepthBoundsTestEnableEXT = (PFN_vkCmdSetDepthBoundsTestEnableEXT)load(context, "vkCmdSetDepthBoundsTestEnableEXT"); + table->vkCmdSetDepthCompareOpEXT = (PFN_vkCmdSetDepthCompareOpEXT)load(context, "vkCmdSetDepthCompareOpEXT"); + table->vkCmdSetDepthTestEnableEXT = (PFN_vkCmdSetDepthTestEnableEXT)load(context, "vkCmdSetDepthTestEnableEXT"); + table->vkCmdSetDepthWriteEnableEXT = (PFN_vkCmdSetDepthWriteEnableEXT)load(context, "vkCmdSetDepthWriteEnableEXT"); + table->vkCmdSetFrontFaceEXT = (PFN_vkCmdSetFrontFaceEXT)load(context, "vkCmdSetFrontFaceEXT"); + table->vkCmdSetPrimitiveTopologyEXT = (PFN_vkCmdSetPrimitiveTopologyEXT)load(context, "vkCmdSetPrimitiveTopologyEXT"); + table->vkCmdSetScissorWithCountEXT = (PFN_vkCmdSetScissorWithCountEXT)load(context, "vkCmdSetScissorWithCountEXT"); + table->vkCmdSetStencilOpEXT = (PFN_vkCmdSetStencilOpEXT)load(context, "vkCmdSetStencilOpEXT"); + table->vkCmdSetStencilTestEnableEXT = (PFN_vkCmdSetStencilTestEnableEXT)load(context, "vkCmdSetStencilTestEnableEXT"); + table->vkCmdSetViewportWithCountEXT = (PFN_vkCmdSetViewportWithCountEXT)load(context, "vkCmdSetViewportWithCountEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) + table->vkCmdSetDepthBiasEnableEXT = (PFN_vkCmdSetDepthBiasEnableEXT)load(context, "vkCmdSetDepthBiasEnableEXT"); + table->vkCmdSetLogicOpEXT = (PFN_vkCmdSetLogicOpEXT)load(context, "vkCmdSetLogicOpEXT"); + table->vkCmdSetPatchControlPointsEXT = (PFN_vkCmdSetPatchControlPointsEXT)load(context, "vkCmdSetPatchControlPointsEXT"); + table->vkCmdSetPrimitiveRestartEnableEXT = (PFN_vkCmdSetPrimitiveRestartEnableEXT)load(context, "vkCmdSetPrimitiveRestartEnableEXT"); + table->vkCmdSetRasterizerDiscardEnableEXT = (PFN_vkCmdSetRasterizerDiscardEnableEXT)load(context, "vkCmdSetRasterizerDiscardEnableEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) + table->vkCmdSetAlphaToCoverageEnableEXT = (PFN_vkCmdSetAlphaToCoverageEnableEXT)load(context, "vkCmdSetAlphaToCoverageEnableEXT"); + table->vkCmdSetAlphaToOneEnableEXT = (PFN_vkCmdSetAlphaToOneEnableEXT)load(context, "vkCmdSetAlphaToOneEnableEXT"); + table->vkCmdSetColorBlendEnableEXT = (PFN_vkCmdSetColorBlendEnableEXT)load(context, "vkCmdSetColorBlendEnableEXT"); + table->vkCmdSetColorBlendEquationEXT = (PFN_vkCmdSetColorBlendEquationEXT)load(context, "vkCmdSetColorBlendEquationEXT"); + table->vkCmdSetColorWriteMaskEXT = (PFN_vkCmdSetColorWriteMaskEXT)load(context, "vkCmdSetColorWriteMaskEXT"); + table->vkCmdSetDepthClampEnableEXT = (PFN_vkCmdSetDepthClampEnableEXT)load(context, "vkCmdSetDepthClampEnableEXT"); + table->vkCmdSetLogicOpEnableEXT = (PFN_vkCmdSetLogicOpEnableEXT)load(context, "vkCmdSetLogicOpEnableEXT"); + table->vkCmdSetPolygonModeEXT = (PFN_vkCmdSetPolygonModeEXT)load(context, "vkCmdSetPolygonModeEXT"); + table->vkCmdSetRasterizationSamplesEXT = (PFN_vkCmdSetRasterizationSamplesEXT)load(context, "vkCmdSetRasterizationSamplesEXT"); + table->vkCmdSetSampleMaskEXT = (PFN_vkCmdSetSampleMaskEXT)load(context, "vkCmdSetSampleMaskEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) + table->vkCmdSetTessellationDomainOriginEXT = (PFN_vkCmdSetTessellationDomainOriginEXT)load(context, "vkCmdSetTessellationDomainOriginEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) + table->vkCmdSetRasterizationStreamEXT = (PFN_vkCmdSetRasterizationStreamEXT)load(context, "vkCmdSetRasterizationStreamEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) + table->vkCmdSetConservativeRasterizationModeEXT = (PFN_vkCmdSetConservativeRasterizationModeEXT)load(context, "vkCmdSetConservativeRasterizationModeEXT"); + table->vkCmdSetExtraPrimitiveOverestimationSizeEXT = (PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT)load(context, "vkCmdSetExtraPrimitiveOverestimationSizeEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) + table->vkCmdSetDepthClipEnableEXT = (PFN_vkCmdSetDepthClipEnableEXT)load(context, "vkCmdSetDepthClipEnableEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) + table->vkCmdSetSampleLocationsEnableEXT = (PFN_vkCmdSetSampleLocationsEnableEXT)load(context, "vkCmdSetSampleLocationsEnableEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) + table->vkCmdSetColorBlendAdvancedEXT = (PFN_vkCmdSetColorBlendAdvancedEXT)load(context, "vkCmdSetColorBlendAdvancedEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) + table->vkCmdSetProvokingVertexModeEXT = (PFN_vkCmdSetProvokingVertexModeEXT)load(context, "vkCmdSetProvokingVertexModeEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) + table->vkCmdSetLineRasterizationModeEXT = (PFN_vkCmdSetLineRasterizationModeEXT)load(context, "vkCmdSetLineRasterizationModeEXT"); + table->vkCmdSetLineStippleEnableEXT = (PFN_vkCmdSetLineStippleEnableEXT)load(context, "vkCmdSetLineStippleEnableEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) + table->vkCmdSetDepthClipNegativeOneToOneEXT = (PFN_vkCmdSetDepthClipNegativeOneToOneEXT)load(context, "vkCmdSetDepthClipNegativeOneToOneEXT"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) + table->vkCmdSetViewportWScalingEnableNV = (PFN_vkCmdSetViewportWScalingEnableNV)load(context, "vkCmdSetViewportWScalingEnableNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) + table->vkCmdSetViewportSwizzleNV = (PFN_vkCmdSetViewportSwizzleNV)load(context, "vkCmdSetViewportSwizzleNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) + table->vkCmdSetCoverageToColorEnableNV = (PFN_vkCmdSetCoverageToColorEnableNV)load(context, "vkCmdSetCoverageToColorEnableNV"); + table->vkCmdSetCoverageToColorLocationNV = (PFN_vkCmdSetCoverageToColorLocationNV)load(context, "vkCmdSetCoverageToColorLocationNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) + table->vkCmdSetCoverageModulationModeNV = (PFN_vkCmdSetCoverageModulationModeNV)load(context, "vkCmdSetCoverageModulationModeNV"); + table->vkCmdSetCoverageModulationTableEnableNV = (PFN_vkCmdSetCoverageModulationTableEnableNV)load(context, "vkCmdSetCoverageModulationTableEnableNV"); + table->vkCmdSetCoverageModulationTableNV = (PFN_vkCmdSetCoverageModulationTableNV)load(context, "vkCmdSetCoverageModulationTableNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) + table->vkCmdSetShadingRateImageEnableNV = (PFN_vkCmdSetShadingRateImageEnableNV)load(context, "vkCmdSetShadingRateImageEnableNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) + table->vkCmdSetRepresentativeFragmentTestEnableNV = (PFN_vkCmdSetRepresentativeFragmentTestEnableNV)load(context, "vkCmdSetRepresentativeFragmentTestEnableNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) + table->vkCmdSetCoverageReductionModeNV = (PFN_vkCmdSetCoverageReductionModeNV)load(context, "vkCmdSetCoverageReductionModeNV"); +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) */ +#if (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) + table->vkGetImageSubresourceLayout2EXT = (PFN_vkGetImageSubresourceLayout2EXT)load(context, "vkGetImageSubresourceLayout2EXT"); +#endif /* (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) */ +#if (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) + table->vkCmdSetVertexInputEXT = (PFN_vkCmdSetVertexInputEXT)load(context, "vkCmdSetVertexInputEXT"); +#endif /* (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) */ +#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) + table->vkCmdPushDescriptorSetWithTemplateKHR = (PFN_vkCmdPushDescriptorSetWithTemplateKHR)load(context, "vkCmdPushDescriptorSetWithTemplateKHR"); +#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) + table->vkGetDeviceGroupPresentCapabilitiesKHR = (PFN_vkGetDeviceGroupPresentCapabilitiesKHR)load(context, "vkGetDeviceGroupPresentCapabilitiesKHR"); + table->vkGetDeviceGroupSurfacePresentModesKHR = (PFN_vkGetDeviceGroupSurfacePresentModesKHR)load(context, "vkGetDeviceGroupSurfacePresentModesKHR"); +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) + table->vkAcquireNextImage2KHR = (PFN_vkAcquireNextImage2KHR)load(context, "vkAcquireNextImage2KHR"); +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ + /* VOLK_GENERATE_LOAD_DEVICE_TABLE */ +} + +#ifdef __GNUC__ +#ifdef VOLK_DEFAULT_VISIBILITY +# pragma GCC visibility push(default) +#else +# pragma GCC visibility push(hidden) +#endif +#endif + +/* VOLK_GENERATE_PROTOTYPES_C */ +#if defined(VK_VERSION_1_0) +PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers; +PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets; +PFN_vkAllocateMemory vkAllocateMemory; +PFN_vkBeginCommandBuffer vkBeginCommandBuffer; +PFN_vkBindBufferMemory vkBindBufferMemory; +PFN_vkBindImageMemory vkBindImageMemory; +PFN_vkCmdBeginQuery vkCmdBeginQuery; +PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass; +PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets; +PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer; +PFN_vkCmdBindPipeline vkCmdBindPipeline; +PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers; +PFN_vkCmdBlitImage vkCmdBlitImage; +PFN_vkCmdClearAttachments vkCmdClearAttachments; +PFN_vkCmdClearColorImage vkCmdClearColorImage; +PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage; +PFN_vkCmdCopyBuffer vkCmdCopyBuffer; +PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage; +PFN_vkCmdCopyImage vkCmdCopyImage; +PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer; +PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults; +PFN_vkCmdDispatch vkCmdDispatch; +PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect; +PFN_vkCmdDraw vkCmdDraw; +PFN_vkCmdDrawIndexed vkCmdDrawIndexed; +PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect; +PFN_vkCmdDrawIndirect vkCmdDrawIndirect; +PFN_vkCmdEndQuery vkCmdEndQuery; +PFN_vkCmdEndRenderPass vkCmdEndRenderPass; +PFN_vkCmdExecuteCommands vkCmdExecuteCommands; +PFN_vkCmdFillBuffer vkCmdFillBuffer; +PFN_vkCmdNextSubpass vkCmdNextSubpass; +PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier; +PFN_vkCmdPushConstants vkCmdPushConstants; +PFN_vkCmdResetEvent vkCmdResetEvent; +PFN_vkCmdResetQueryPool vkCmdResetQueryPool; +PFN_vkCmdResolveImage vkCmdResolveImage; +PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants; +PFN_vkCmdSetDepthBias vkCmdSetDepthBias; +PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds; +PFN_vkCmdSetEvent vkCmdSetEvent; +PFN_vkCmdSetLineWidth vkCmdSetLineWidth; +PFN_vkCmdSetScissor vkCmdSetScissor; +PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask; +PFN_vkCmdSetStencilReference vkCmdSetStencilReference; +PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask; +PFN_vkCmdSetViewport vkCmdSetViewport; +PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer; +PFN_vkCmdWaitEvents vkCmdWaitEvents; +PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp; +PFN_vkCreateBuffer vkCreateBuffer; +PFN_vkCreateBufferView vkCreateBufferView; +PFN_vkCreateCommandPool vkCreateCommandPool; +PFN_vkCreateComputePipelines vkCreateComputePipelines; +PFN_vkCreateDescriptorPool vkCreateDescriptorPool; +PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout; +PFN_vkCreateDevice vkCreateDevice; +PFN_vkCreateEvent vkCreateEvent; +PFN_vkCreateFence vkCreateFence; +PFN_vkCreateFramebuffer vkCreateFramebuffer; +PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines; +PFN_vkCreateImage vkCreateImage; +PFN_vkCreateImageView vkCreateImageView; +PFN_vkCreateInstance vkCreateInstance; +PFN_vkCreatePipelineCache vkCreatePipelineCache; +PFN_vkCreatePipelineLayout vkCreatePipelineLayout; +PFN_vkCreateQueryPool vkCreateQueryPool; +PFN_vkCreateRenderPass vkCreateRenderPass; +PFN_vkCreateSampler vkCreateSampler; +PFN_vkCreateSemaphore vkCreateSemaphore; +PFN_vkCreateShaderModule vkCreateShaderModule; +PFN_vkDestroyBuffer vkDestroyBuffer; +PFN_vkDestroyBufferView vkDestroyBufferView; +PFN_vkDestroyCommandPool vkDestroyCommandPool; +PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool; +PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout; +PFN_vkDestroyDevice vkDestroyDevice; +PFN_vkDestroyEvent vkDestroyEvent; +PFN_vkDestroyFence vkDestroyFence; +PFN_vkDestroyFramebuffer vkDestroyFramebuffer; +PFN_vkDestroyImage vkDestroyImage; +PFN_vkDestroyImageView vkDestroyImageView; +PFN_vkDestroyInstance vkDestroyInstance; +PFN_vkDestroyPipeline vkDestroyPipeline; +PFN_vkDestroyPipelineCache vkDestroyPipelineCache; +PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout; +PFN_vkDestroyQueryPool vkDestroyQueryPool; +PFN_vkDestroyRenderPass vkDestroyRenderPass; +PFN_vkDestroySampler vkDestroySampler; +PFN_vkDestroySemaphore vkDestroySemaphore; +PFN_vkDestroyShaderModule vkDestroyShaderModule; +PFN_vkDeviceWaitIdle vkDeviceWaitIdle; +PFN_vkEndCommandBuffer vkEndCommandBuffer; +PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties; +PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties; +PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties; +PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties; +PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; +PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges; +PFN_vkFreeCommandBuffers vkFreeCommandBuffers; +PFN_vkFreeDescriptorSets vkFreeDescriptorSets; +PFN_vkFreeMemory vkFreeMemory; +PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements; +PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment; +PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr; +PFN_vkGetDeviceQueue vkGetDeviceQueue; +PFN_vkGetEventStatus vkGetEventStatus; +PFN_vkGetFenceStatus vkGetFenceStatus; +PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements; +PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements; +PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout; +PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; +PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures; +PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; +PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties; +PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties; +PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; +PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties; +PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties; +PFN_vkGetPipelineCacheData vkGetPipelineCacheData; +PFN_vkGetQueryPoolResults vkGetQueryPoolResults; +PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity; +PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges; +PFN_vkMapMemory vkMapMemory; +PFN_vkMergePipelineCaches vkMergePipelineCaches; +PFN_vkQueueBindSparse vkQueueBindSparse; +PFN_vkQueueSubmit vkQueueSubmit; +PFN_vkQueueWaitIdle vkQueueWaitIdle; +PFN_vkResetCommandBuffer vkResetCommandBuffer; +PFN_vkResetCommandPool vkResetCommandPool; +PFN_vkResetDescriptorPool vkResetDescriptorPool; +PFN_vkResetEvent vkResetEvent; +PFN_vkResetFences vkResetFences; +PFN_vkSetEvent vkSetEvent; +PFN_vkUnmapMemory vkUnmapMemory; +PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets; +PFN_vkWaitForFences vkWaitForFences; +#endif /* defined(VK_VERSION_1_0) */ +#if defined(VK_VERSION_1_1) +PFN_vkBindBufferMemory2 vkBindBufferMemory2; +PFN_vkBindImageMemory2 vkBindImageMemory2; +PFN_vkCmdDispatchBase vkCmdDispatchBase; +PFN_vkCmdSetDeviceMask vkCmdSetDeviceMask; +PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate; +PFN_vkCreateSamplerYcbcrConversion vkCreateSamplerYcbcrConversion; +PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate; +PFN_vkDestroySamplerYcbcrConversion vkDestroySamplerYcbcrConversion; +PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion; +PFN_vkEnumeratePhysicalDeviceGroups vkEnumeratePhysicalDeviceGroups; +PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2; +PFN_vkGetDescriptorSetLayoutSupport vkGetDescriptorSetLayoutSupport; +PFN_vkGetDeviceGroupPeerMemoryFeatures vkGetDeviceGroupPeerMemoryFeatures; +PFN_vkGetDeviceQueue2 vkGetDeviceQueue2; +PFN_vkGetImageMemoryRequirements2 vkGetImageMemoryRequirements2; +PFN_vkGetImageSparseMemoryRequirements2 vkGetImageSparseMemoryRequirements2; +PFN_vkGetPhysicalDeviceExternalBufferProperties vkGetPhysicalDeviceExternalBufferProperties; +PFN_vkGetPhysicalDeviceExternalFenceProperties vkGetPhysicalDeviceExternalFenceProperties; +PFN_vkGetPhysicalDeviceExternalSemaphoreProperties vkGetPhysicalDeviceExternalSemaphoreProperties; +PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2; +PFN_vkGetPhysicalDeviceFormatProperties2 vkGetPhysicalDeviceFormatProperties2; +PFN_vkGetPhysicalDeviceImageFormatProperties2 vkGetPhysicalDeviceImageFormatProperties2; +PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2; +PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2; +PFN_vkGetPhysicalDeviceQueueFamilyProperties2 vkGetPhysicalDeviceQueueFamilyProperties2; +PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 vkGetPhysicalDeviceSparseImageFormatProperties2; +PFN_vkTrimCommandPool vkTrimCommandPool; +PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate; +#endif /* defined(VK_VERSION_1_1) */ +#if defined(VK_VERSION_1_2) +PFN_vkCmdBeginRenderPass2 vkCmdBeginRenderPass2; +PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount; +PFN_vkCmdDrawIndirectCount vkCmdDrawIndirectCount; +PFN_vkCmdEndRenderPass2 vkCmdEndRenderPass2; +PFN_vkCmdNextSubpass2 vkCmdNextSubpass2; +PFN_vkCreateRenderPass2 vkCreateRenderPass2; +PFN_vkGetBufferDeviceAddress vkGetBufferDeviceAddress; +PFN_vkGetBufferOpaqueCaptureAddress vkGetBufferOpaqueCaptureAddress; +PFN_vkGetDeviceMemoryOpaqueCaptureAddress vkGetDeviceMemoryOpaqueCaptureAddress; +PFN_vkGetSemaphoreCounterValue vkGetSemaphoreCounterValue; +PFN_vkResetQueryPool vkResetQueryPool; +PFN_vkSignalSemaphore vkSignalSemaphore; +PFN_vkWaitSemaphores vkWaitSemaphores; +#endif /* defined(VK_VERSION_1_2) */ +#if defined(VK_VERSION_1_3) +PFN_vkCmdBeginRendering vkCmdBeginRendering; +PFN_vkCmdBindVertexBuffers2 vkCmdBindVertexBuffers2; +PFN_vkCmdBlitImage2 vkCmdBlitImage2; +PFN_vkCmdCopyBuffer2 vkCmdCopyBuffer2; +PFN_vkCmdCopyBufferToImage2 vkCmdCopyBufferToImage2; +PFN_vkCmdCopyImage2 vkCmdCopyImage2; +PFN_vkCmdCopyImageToBuffer2 vkCmdCopyImageToBuffer2; +PFN_vkCmdEndRendering vkCmdEndRendering; +PFN_vkCmdPipelineBarrier2 vkCmdPipelineBarrier2; +PFN_vkCmdResetEvent2 vkCmdResetEvent2; +PFN_vkCmdResolveImage2 vkCmdResolveImage2; +PFN_vkCmdSetCullMode vkCmdSetCullMode; +PFN_vkCmdSetDepthBiasEnable vkCmdSetDepthBiasEnable; +PFN_vkCmdSetDepthBoundsTestEnable vkCmdSetDepthBoundsTestEnable; +PFN_vkCmdSetDepthCompareOp vkCmdSetDepthCompareOp; +PFN_vkCmdSetDepthTestEnable vkCmdSetDepthTestEnable; +PFN_vkCmdSetDepthWriteEnable vkCmdSetDepthWriteEnable; +PFN_vkCmdSetEvent2 vkCmdSetEvent2; +PFN_vkCmdSetFrontFace vkCmdSetFrontFace; +PFN_vkCmdSetPrimitiveRestartEnable vkCmdSetPrimitiveRestartEnable; +PFN_vkCmdSetPrimitiveTopology vkCmdSetPrimitiveTopology; +PFN_vkCmdSetRasterizerDiscardEnable vkCmdSetRasterizerDiscardEnable; +PFN_vkCmdSetScissorWithCount vkCmdSetScissorWithCount; +PFN_vkCmdSetStencilOp vkCmdSetStencilOp; +PFN_vkCmdSetStencilTestEnable vkCmdSetStencilTestEnable; +PFN_vkCmdSetViewportWithCount vkCmdSetViewportWithCount; +PFN_vkCmdWaitEvents2 vkCmdWaitEvents2; +PFN_vkCmdWriteTimestamp2 vkCmdWriteTimestamp2; +PFN_vkCreatePrivateDataSlot vkCreatePrivateDataSlot; +PFN_vkDestroyPrivateDataSlot vkDestroyPrivateDataSlot; +PFN_vkGetDeviceBufferMemoryRequirements vkGetDeviceBufferMemoryRequirements; +PFN_vkGetDeviceImageMemoryRequirements vkGetDeviceImageMemoryRequirements; +PFN_vkGetDeviceImageSparseMemoryRequirements vkGetDeviceImageSparseMemoryRequirements; +PFN_vkGetPhysicalDeviceToolProperties vkGetPhysicalDeviceToolProperties; +PFN_vkGetPrivateData vkGetPrivateData; +PFN_vkQueueSubmit2 vkQueueSubmit2; +PFN_vkSetPrivateData vkSetPrivateData; +#endif /* defined(VK_VERSION_1_3) */ +#if defined(VK_AMDX_shader_enqueue) +PFN_vkCmdDispatchGraphAMDX vkCmdDispatchGraphAMDX; +PFN_vkCmdDispatchGraphIndirectAMDX vkCmdDispatchGraphIndirectAMDX; +PFN_vkCmdDispatchGraphIndirectCountAMDX vkCmdDispatchGraphIndirectCountAMDX; +PFN_vkCmdInitializeGraphScratchMemoryAMDX vkCmdInitializeGraphScratchMemoryAMDX; +PFN_vkCreateExecutionGraphPipelinesAMDX vkCreateExecutionGraphPipelinesAMDX; +PFN_vkGetExecutionGraphPipelineNodeIndexAMDX vkGetExecutionGraphPipelineNodeIndexAMDX; +PFN_vkGetExecutionGraphPipelineScratchSizeAMDX vkGetExecutionGraphPipelineScratchSizeAMDX; +#endif /* defined(VK_AMDX_shader_enqueue) */ +#if defined(VK_AMD_anti_lag) +PFN_vkAntiLagUpdateAMD vkAntiLagUpdateAMD; +#endif /* defined(VK_AMD_anti_lag) */ +#if defined(VK_AMD_buffer_marker) +PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD; +#endif /* defined(VK_AMD_buffer_marker) */ +#if defined(VK_AMD_display_native_hdr) +PFN_vkSetLocalDimmingAMD vkSetLocalDimmingAMD; +#endif /* defined(VK_AMD_display_native_hdr) */ +#if defined(VK_AMD_draw_indirect_count) +PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD; +PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD; +#endif /* defined(VK_AMD_draw_indirect_count) */ +#if defined(VK_AMD_shader_info) +PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD; +#endif /* defined(VK_AMD_shader_info) */ +#if defined(VK_ANDROID_external_memory_android_hardware_buffer) +PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID; +PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBufferANDROID; +#endif /* defined(VK_ANDROID_external_memory_android_hardware_buffer) */ +#if defined(VK_EXT_acquire_drm_display) +PFN_vkAcquireDrmDisplayEXT vkAcquireDrmDisplayEXT; +PFN_vkGetDrmDisplayEXT vkGetDrmDisplayEXT; +#endif /* defined(VK_EXT_acquire_drm_display) */ +#if defined(VK_EXT_acquire_xlib_display) +PFN_vkAcquireXlibDisplayEXT vkAcquireXlibDisplayEXT; +PFN_vkGetRandROutputDisplayEXT vkGetRandROutputDisplayEXT; +#endif /* defined(VK_EXT_acquire_xlib_display) */ +#if defined(VK_EXT_attachment_feedback_loop_dynamic_state) +PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT vkCmdSetAttachmentFeedbackLoopEnableEXT; +#endif /* defined(VK_EXT_attachment_feedback_loop_dynamic_state) */ +#if defined(VK_EXT_buffer_device_address) +PFN_vkGetBufferDeviceAddressEXT vkGetBufferDeviceAddressEXT; +#endif /* defined(VK_EXT_buffer_device_address) */ +#if defined(VK_EXT_calibrated_timestamps) +PFN_vkGetCalibratedTimestampsEXT vkGetCalibratedTimestampsEXT; +PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT vkGetPhysicalDeviceCalibrateableTimeDomainsEXT; +#endif /* defined(VK_EXT_calibrated_timestamps) */ +#if defined(VK_EXT_color_write_enable) +PFN_vkCmdSetColorWriteEnableEXT vkCmdSetColorWriteEnableEXT; +#endif /* defined(VK_EXT_color_write_enable) */ +#if defined(VK_EXT_conditional_rendering) +PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT; +PFN_vkCmdEndConditionalRenderingEXT vkCmdEndConditionalRenderingEXT; +#endif /* defined(VK_EXT_conditional_rendering) */ +#if defined(VK_EXT_debug_marker) +PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT; +PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT; +PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT; +PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT; +PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT; +#endif /* defined(VK_EXT_debug_marker) */ +#if defined(VK_EXT_debug_report) +PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT; +PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT; +PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT; +#endif /* defined(VK_EXT_debug_report) */ +#if defined(VK_EXT_debug_utils) +PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT; +PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT; +PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT; +PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT; +PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT; +PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT; +PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT; +PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT; +PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT; +PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT; +PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT; +#endif /* defined(VK_EXT_debug_utils) */ +#if defined(VK_EXT_depth_bias_control) +PFN_vkCmdSetDepthBias2EXT vkCmdSetDepthBias2EXT; +#endif /* defined(VK_EXT_depth_bias_control) */ +#if defined(VK_EXT_descriptor_buffer) +PFN_vkCmdBindDescriptorBufferEmbeddedSamplersEXT vkCmdBindDescriptorBufferEmbeddedSamplersEXT; +PFN_vkCmdBindDescriptorBuffersEXT vkCmdBindDescriptorBuffersEXT; +PFN_vkCmdSetDescriptorBufferOffsetsEXT vkCmdSetDescriptorBufferOffsetsEXT; +PFN_vkGetBufferOpaqueCaptureDescriptorDataEXT vkGetBufferOpaqueCaptureDescriptorDataEXT; +PFN_vkGetDescriptorEXT vkGetDescriptorEXT; +PFN_vkGetDescriptorSetLayoutBindingOffsetEXT vkGetDescriptorSetLayoutBindingOffsetEXT; +PFN_vkGetDescriptorSetLayoutSizeEXT vkGetDescriptorSetLayoutSizeEXT; +PFN_vkGetImageOpaqueCaptureDescriptorDataEXT vkGetImageOpaqueCaptureDescriptorDataEXT; +PFN_vkGetImageViewOpaqueCaptureDescriptorDataEXT vkGetImageViewOpaqueCaptureDescriptorDataEXT; +PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT vkGetSamplerOpaqueCaptureDescriptorDataEXT; +#endif /* defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) +PFN_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT; +#endif /* defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) */ +#if defined(VK_EXT_device_fault) +PFN_vkGetDeviceFaultInfoEXT vkGetDeviceFaultInfoEXT; +#endif /* defined(VK_EXT_device_fault) */ +#if defined(VK_EXT_direct_mode_display) +PFN_vkReleaseDisplayEXT vkReleaseDisplayEXT; +#endif /* defined(VK_EXT_direct_mode_display) */ +#if defined(VK_EXT_directfb_surface) +PFN_vkCreateDirectFBSurfaceEXT vkCreateDirectFBSurfaceEXT; +PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT vkGetPhysicalDeviceDirectFBPresentationSupportEXT; +#endif /* defined(VK_EXT_directfb_surface) */ +#if defined(VK_EXT_discard_rectangles) +PFN_vkCmdSetDiscardRectangleEXT vkCmdSetDiscardRectangleEXT; +#endif /* defined(VK_EXT_discard_rectangles) */ +#if defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 +PFN_vkCmdSetDiscardRectangleEnableEXT vkCmdSetDiscardRectangleEnableEXT; +PFN_vkCmdSetDiscardRectangleModeEXT vkCmdSetDiscardRectangleModeEXT; +#endif /* defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 */ +#if defined(VK_EXT_display_control) +PFN_vkDisplayPowerControlEXT vkDisplayPowerControlEXT; +PFN_vkGetSwapchainCounterEXT vkGetSwapchainCounterEXT; +PFN_vkRegisterDeviceEventEXT vkRegisterDeviceEventEXT; +PFN_vkRegisterDisplayEventEXT vkRegisterDisplayEventEXT; +#endif /* defined(VK_EXT_display_control) */ +#if defined(VK_EXT_display_surface_counter) +PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT; +#endif /* defined(VK_EXT_display_surface_counter) */ +#if defined(VK_EXT_external_memory_host) +PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT; +#endif /* defined(VK_EXT_external_memory_host) */ +#if defined(VK_EXT_full_screen_exclusive) +PFN_vkAcquireFullScreenExclusiveModeEXT vkAcquireFullScreenExclusiveModeEXT; +PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT vkGetPhysicalDeviceSurfacePresentModes2EXT; +PFN_vkReleaseFullScreenExclusiveModeEXT vkReleaseFullScreenExclusiveModeEXT; +#endif /* defined(VK_EXT_full_screen_exclusive) */ +#if defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) +PFN_vkGetDeviceGroupSurfacePresentModes2EXT vkGetDeviceGroupSurfacePresentModes2EXT; +#endif /* defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) */ +#if defined(VK_EXT_hdr_metadata) +PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT; +#endif /* defined(VK_EXT_hdr_metadata) */ +#if defined(VK_EXT_headless_surface) +PFN_vkCreateHeadlessSurfaceEXT vkCreateHeadlessSurfaceEXT; +#endif /* defined(VK_EXT_headless_surface) */ +#if defined(VK_EXT_host_image_copy) +PFN_vkCopyImageToImageEXT vkCopyImageToImageEXT; +PFN_vkCopyImageToMemoryEXT vkCopyImageToMemoryEXT; +PFN_vkCopyMemoryToImageEXT vkCopyMemoryToImageEXT; +PFN_vkTransitionImageLayoutEXT vkTransitionImageLayoutEXT; +#endif /* defined(VK_EXT_host_image_copy) */ +#if defined(VK_EXT_host_query_reset) +PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT; +#endif /* defined(VK_EXT_host_query_reset) */ +#if defined(VK_EXT_image_drm_format_modifier) +PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT; +#endif /* defined(VK_EXT_image_drm_format_modifier) */ +#if defined(VK_EXT_line_rasterization) +PFN_vkCmdSetLineStippleEXT vkCmdSetLineStippleEXT; +#endif /* defined(VK_EXT_line_rasterization) */ +#if defined(VK_EXT_mesh_shader) +PFN_vkCmdDrawMeshTasksEXT vkCmdDrawMeshTasksEXT; +PFN_vkCmdDrawMeshTasksIndirectCountEXT vkCmdDrawMeshTasksIndirectCountEXT; +PFN_vkCmdDrawMeshTasksIndirectEXT vkCmdDrawMeshTasksIndirectEXT; +#endif /* defined(VK_EXT_mesh_shader) */ +#if defined(VK_EXT_metal_objects) +PFN_vkExportMetalObjectsEXT vkExportMetalObjectsEXT; +#endif /* defined(VK_EXT_metal_objects) */ +#if defined(VK_EXT_metal_surface) +PFN_vkCreateMetalSurfaceEXT vkCreateMetalSurfaceEXT; +#endif /* defined(VK_EXT_metal_surface) */ +#if defined(VK_EXT_multi_draw) +PFN_vkCmdDrawMultiEXT vkCmdDrawMultiEXT; +PFN_vkCmdDrawMultiIndexedEXT vkCmdDrawMultiIndexedEXT; +#endif /* defined(VK_EXT_multi_draw) */ +#if defined(VK_EXT_opacity_micromap) +PFN_vkBuildMicromapsEXT vkBuildMicromapsEXT; +PFN_vkCmdBuildMicromapsEXT vkCmdBuildMicromapsEXT; +PFN_vkCmdCopyMemoryToMicromapEXT vkCmdCopyMemoryToMicromapEXT; +PFN_vkCmdCopyMicromapEXT vkCmdCopyMicromapEXT; +PFN_vkCmdCopyMicromapToMemoryEXT vkCmdCopyMicromapToMemoryEXT; +PFN_vkCmdWriteMicromapsPropertiesEXT vkCmdWriteMicromapsPropertiesEXT; +PFN_vkCopyMemoryToMicromapEXT vkCopyMemoryToMicromapEXT; +PFN_vkCopyMicromapEXT vkCopyMicromapEXT; +PFN_vkCopyMicromapToMemoryEXT vkCopyMicromapToMemoryEXT; +PFN_vkCreateMicromapEXT vkCreateMicromapEXT; +PFN_vkDestroyMicromapEXT vkDestroyMicromapEXT; +PFN_vkGetDeviceMicromapCompatibilityEXT vkGetDeviceMicromapCompatibilityEXT; +PFN_vkGetMicromapBuildSizesEXT vkGetMicromapBuildSizesEXT; +PFN_vkWriteMicromapsPropertiesEXT vkWriteMicromapsPropertiesEXT; +#endif /* defined(VK_EXT_opacity_micromap) */ +#if defined(VK_EXT_pageable_device_local_memory) +PFN_vkSetDeviceMemoryPriorityEXT vkSetDeviceMemoryPriorityEXT; +#endif /* defined(VK_EXT_pageable_device_local_memory) */ +#if defined(VK_EXT_pipeline_properties) +PFN_vkGetPipelinePropertiesEXT vkGetPipelinePropertiesEXT; +#endif /* defined(VK_EXT_pipeline_properties) */ +#if defined(VK_EXT_private_data) +PFN_vkCreatePrivateDataSlotEXT vkCreatePrivateDataSlotEXT; +PFN_vkDestroyPrivateDataSlotEXT vkDestroyPrivateDataSlotEXT; +PFN_vkGetPrivateDataEXT vkGetPrivateDataEXT; +PFN_vkSetPrivateDataEXT vkSetPrivateDataEXT; +#endif /* defined(VK_EXT_private_data) */ +#if defined(VK_EXT_sample_locations) +PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT; +PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT; +#endif /* defined(VK_EXT_sample_locations) */ +#if defined(VK_EXT_shader_module_identifier) +PFN_vkGetShaderModuleCreateInfoIdentifierEXT vkGetShaderModuleCreateInfoIdentifierEXT; +PFN_vkGetShaderModuleIdentifierEXT vkGetShaderModuleIdentifierEXT; +#endif /* defined(VK_EXT_shader_module_identifier) */ +#if defined(VK_EXT_shader_object) +PFN_vkCmdBindShadersEXT vkCmdBindShadersEXT; +PFN_vkCreateShadersEXT vkCreateShadersEXT; +PFN_vkDestroyShaderEXT vkDestroyShaderEXT; +PFN_vkGetShaderBinaryDataEXT vkGetShaderBinaryDataEXT; +#endif /* defined(VK_EXT_shader_object) */ +#if defined(VK_EXT_swapchain_maintenance1) +PFN_vkReleaseSwapchainImagesEXT vkReleaseSwapchainImagesEXT; +#endif /* defined(VK_EXT_swapchain_maintenance1) */ +#if defined(VK_EXT_tooling_info) +PFN_vkGetPhysicalDeviceToolPropertiesEXT vkGetPhysicalDeviceToolPropertiesEXT; +#endif /* defined(VK_EXT_tooling_info) */ +#if defined(VK_EXT_transform_feedback) +PFN_vkCmdBeginQueryIndexedEXT vkCmdBeginQueryIndexedEXT; +PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT; +PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT; +PFN_vkCmdDrawIndirectByteCountEXT vkCmdDrawIndirectByteCountEXT; +PFN_vkCmdEndQueryIndexedEXT vkCmdEndQueryIndexedEXT; +PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT; +#endif /* defined(VK_EXT_transform_feedback) */ +#if defined(VK_EXT_validation_cache) +PFN_vkCreateValidationCacheEXT vkCreateValidationCacheEXT; +PFN_vkDestroyValidationCacheEXT vkDestroyValidationCacheEXT; +PFN_vkGetValidationCacheDataEXT vkGetValidationCacheDataEXT; +PFN_vkMergeValidationCachesEXT vkMergeValidationCachesEXT; +#endif /* defined(VK_EXT_validation_cache) */ +#if defined(VK_FUCHSIA_buffer_collection) +PFN_vkCreateBufferCollectionFUCHSIA vkCreateBufferCollectionFUCHSIA; +PFN_vkDestroyBufferCollectionFUCHSIA vkDestroyBufferCollectionFUCHSIA; +PFN_vkGetBufferCollectionPropertiesFUCHSIA vkGetBufferCollectionPropertiesFUCHSIA; +PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA vkSetBufferCollectionBufferConstraintsFUCHSIA; +PFN_vkSetBufferCollectionImageConstraintsFUCHSIA vkSetBufferCollectionImageConstraintsFUCHSIA; +#endif /* defined(VK_FUCHSIA_buffer_collection) */ +#if defined(VK_FUCHSIA_external_memory) +PFN_vkGetMemoryZirconHandleFUCHSIA vkGetMemoryZirconHandleFUCHSIA; +PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA vkGetMemoryZirconHandlePropertiesFUCHSIA; +#endif /* defined(VK_FUCHSIA_external_memory) */ +#if defined(VK_FUCHSIA_external_semaphore) +PFN_vkGetSemaphoreZirconHandleFUCHSIA vkGetSemaphoreZirconHandleFUCHSIA; +PFN_vkImportSemaphoreZirconHandleFUCHSIA vkImportSemaphoreZirconHandleFUCHSIA; +#endif /* defined(VK_FUCHSIA_external_semaphore) */ +#if defined(VK_FUCHSIA_imagepipe_surface) +PFN_vkCreateImagePipeSurfaceFUCHSIA vkCreateImagePipeSurfaceFUCHSIA; +#endif /* defined(VK_FUCHSIA_imagepipe_surface) */ +#if defined(VK_GGP_stream_descriptor_surface) +PFN_vkCreateStreamDescriptorSurfaceGGP vkCreateStreamDescriptorSurfaceGGP; +#endif /* defined(VK_GGP_stream_descriptor_surface) */ +#if defined(VK_GOOGLE_display_timing) +PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE; +PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE; +#endif /* defined(VK_GOOGLE_display_timing) */ +#if defined(VK_HUAWEI_cluster_culling_shader) +PFN_vkCmdDrawClusterHUAWEI vkCmdDrawClusterHUAWEI; +PFN_vkCmdDrawClusterIndirectHUAWEI vkCmdDrawClusterIndirectHUAWEI; +#endif /* defined(VK_HUAWEI_cluster_culling_shader) */ +#if defined(VK_HUAWEI_invocation_mask) +PFN_vkCmdBindInvocationMaskHUAWEI vkCmdBindInvocationMaskHUAWEI; +#endif /* defined(VK_HUAWEI_invocation_mask) */ +#if defined(VK_HUAWEI_subpass_shading) +PFN_vkCmdSubpassShadingHUAWEI vkCmdSubpassShadingHUAWEI; +PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI; +#endif /* defined(VK_HUAWEI_subpass_shading) */ +#if defined(VK_INTEL_performance_query) +PFN_vkAcquirePerformanceConfigurationINTEL vkAcquirePerformanceConfigurationINTEL; +PFN_vkCmdSetPerformanceMarkerINTEL vkCmdSetPerformanceMarkerINTEL; +PFN_vkCmdSetPerformanceOverrideINTEL vkCmdSetPerformanceOverrideINTEL; +PFN_vkCmdSetPerformanceStreamMarkerINTEL vkCmdSetPerformanceStreamMarkerINTEL; +PFN_vkGetPerformanceParameterINTEL vkGetPerformanceParameterINTEL; +PFN_vkInitializePerformanceApiINTEL vkInitializePerformanceApiINTEL; +PFN_vkQueueSetPerformanceConfigurationINTEL vkQueueSetPerformanceConfigurationINTEL; +PFN_vkReleasePerformanceConfigurationINTEL vkReleasePerformanceConfigurationINTEL; +PFN_vkUninitializePerformanceApiINTEL vkUninitializePerformanceApiINTEL; +#endif /* defined(VK_INTEL_performance_query) */ +#if defined(VK_KHR_acceleration_structure) +PFN_vkBuildAccelerationStructuresKHR vkBuildAccelerationStructuresKHR; +PFN_vkCmdBuildAccelerationStructuresIndirectKHR vkCmdBuildAccelerationStructuresIndirectKHR; +PFN_vkCmdBuildAccelerationStructuresKHR vkCmdBuildAccelerationStructuresKHR; +PFN_vkCmdCopyAccelerationStructureKHR vkCmdCopyAccelerationStructureKHR; +PFN_vkCmdCopyAccelerationStructureToMemoryKHR vkCmdCopyAccelerationStructureToMemoryKHR; +PFN_vkCmdCopyMemoryToAccelerationStructureKHR vkCmdCopyMemoryToAccelerationStructureKHR; +PFN_vkCmdWriteAccelerationStructuresPropertiesKHR vkCmdWriteAccelerationStructuresPropertiesKHR; +PFN_vkCopyAccelerationStructureKHR vkCopyAccelerationStructureKHR; +PFN_vkCopyAccelerationStructureToMemoryKHR vkCopyAccelerationStructureToMemoryKHR; +PFN_vkCopyMemoryToAccelerationStructureKHR vkCopyMemoryToAccelerationStructureKHR; +PFN_vkCreateAccelerationStructureKHR vkCreateAccelerationStructureKHR; +PFN_vkDestroyAccelerationStructureKHR vkDestroyAccelerationStructureKHR; +PFN_vkGetAccelerationStructureBuildSizesKHR vkGetAccelerationStructureBuildSizesKHR; +PFN_vkGetAccelerationStructureDeviceAddressKHR vkGetAccelerationStructureDeviceAddressKHR; +PFN_vkGetDeviceAccelerationStructureCompatibilityKHR vkGetDeviceAccelerationStructureCompatibilityKHR; +PFN_vkWriteAccelerationStructuresPropertiesKHR vkWriteAccelerationStructuresPropertiesKHR; +#endif /* defined(VK_KHR_acceleration_structure) */ +#if defined(VK_KHR_android_surface) +PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR; +#endif /* defined(VK_KHR_android_surface) */ +#if defined(VK_KHR_bind_memory2) +PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR; +PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR; +#endif /* defined(VK_KHR_bind_memory2) */ +#if defined(VK_KHR_buffer_device_address) +PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR; +PFN_vkGetBufferOpaqueCaptureAddressKHR vkGetBufferOpaqueCaptureAddressKHR; +PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR vkGetDeviceMemoryOpaqueCaptureAddressKHR; +#endif /* defined(VK_KHR_buffer_device_address) */ +#if defined(VK_KHR_calibrated_timestamps) +PFN_vkGetCalibratedTimestampsKHR vkGetCalibratedTimestampsKHR; +PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR vkGetPhysicalDeviceCalibrateableTimeDomainsKHR; +#endif /* defined(VK_KHR_calibrated_timestamps) */ +#if defined(VK_KHR_cooperative_matrix) +PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR; +#endif /* defined(VK_KHR_cooperative_matrix) */ +#if defined(VK_KHR_copy_commands2) +PFN_vkCmdBlitImage2KHR vkCmdBlitImage2KHR; +PFN_vkCmdCopyBuffer2KHR vkCmdCopyBuffer2KHR; +PFN_vkCmdCopyBufferToImage2KHR vkCmdCopyBufferToImage2KHR; +PFN_vkCmdCopyImage2KHR vkCmdCopyImage2KHR; +PFN_vkCmdCopyImageToBuffer2KHR vkCmdCopyImageToBuffer2KHR; +PFN_vkCmdResolveImage2KHR vkCmdResolveImage2KHR; +#endif /* defined(VK_KHR_copy_commands2) */ +#if defined(VK_KHR_create_renderpass2) +PFN_vkCmdBeginRenderPass2KHR vkCmdBeginRenderPass2KHR; +PFN_vkCmdEndRenderPass2KHR vkCmdEndRenderPass2KHR; +PFN_vkCmdNextSubpass2KHR vkCmdNextSubpass2KHR; +PFN_vkCreateRenderPass2KHR vkCreateRenderPass2KHR; +#endif /* defined(VK_KHR_create_renderpass2) */ +#if defined(VK_KHR_deferred_host_operations) +PFN_vkCreateDeferredOperationKHR vkCreateDeferredOperationKHR; +PFN_vkDeferredOperationJoinKHR vkDeferredOperationJoinKHR; +PFN_vkDestroyDeferredOperationKHR vkDestroyDeferredOperationKHR; +PFN_vkGetDeferredOperationMaxConcurrencyKHR vkGetDeferredOperationMaxConcurrencyKHR; +PFN_vkGetDeferredOperationResultKHR vkGetDeferredOperationResultKHR; +#endif /* defined(VK_KHR_deferred_host_operations) */ +#if defined(VK_KHR_descriptor_update_template) +PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR; +PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR; +PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR; +#endif /* defined(VK_KHR_descriptor_update_template) */ +#if defined(VK_KHR_device_group) +PFN_vkCmdDispatchBaseKHR vkCmdDispatchBaseKHR; +PFN_vkCmdSetDeviceMaskKHR vkCmdSetDeviceMaskKHR; +PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR vkGetDeviceGroupPeerMemoryFeaturesKHR; +#endif /* defined(VK_KHR_device_group) */ +#if defined(VK_KHR_device_group_creation) +PFN_vkEnumeratePhysicalDeviceGroupsKHR vkEnumeratePhysicalDeviceGroupsKHR; +#endif /* defined(VK_KHR_device_group_creation) */ +#if defined(VK_KHR_display) +PFN_vkCreateDisplayModeKHR vkCreateDisplayModeKHR; +PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR; +PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR; +PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR; +PFN_vkGetDisplayPlaneSupportedDisplaysKHR vkGetDisplayPlaneSupportedDisplaysKHR; +PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR; +PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR; +#endif /* defined(VK_KHR_display) */ +#if defined(VK_KHR_display_swapchain) +PFN_vkCreateSharedSwapchainsKHR vkCreateSharedSwapchainsKHR; +#endif /* defined(VK_KHR_display_swapchain) */ +#if defined(VK_KHR_draw_indirect_count) +PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR; +PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR; +#endif /* defined(VK_KHR_draw_indirect_count) */ +#if defined(VK_KHR_dynamic_rendering) +PFN_vkCmdBeginRenderingKHR vkCmdBeginRenderingKHR; +PFN_vkCmdEndRenderingKHR vkCmdEndRenderingKHR; +#endif /* defined(VK_KHR_dynamic_rendering) */ +#if defined(VK_KHR_dynamic_rendering_local_read) +PFN_vkCmdSetRenderingAttachmentLocationsKHR vkCmdSetRenderingAttachmentLocationsKHR; +PFN_vkCmdSetRenderingInputAttachmentIndicesKHR vkCmdSetRenderingInputAttachmentIndicesKHR; +#endif /* defined(VK_KHR_dynamic_rendering_local_read) */ +#if defined(VK_KHR_external_fence_capabilities) +PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR vkGetPhysicalDeviceExternalFencePropertiesKHR; +#endif /* defined(VK_KHR_external_fence_capabilities) */ +#if defined(VK_KHR_external_fence_fd) +PFN_vkGetFenceFdKHR vkGetFenceFdKHR; +PFN_vkImportFenceFdKHR vkImportFenceFdKHR; +#endif /* defined(VK_KHR_external_fence_fd) */ +#if defined(VK_KHR_external_fence_win32) +PFN_vkGetFenceWin32HandleKHR vkGetFenceWin32HandleKHR; +PFN_vkImportFenceWin32HandleKHR vkImportFenceWin32HandleKHR; +#endif /* defined(VK_KHR_external_fence_win32) */ +#if defined(VK_KHR_external_memory_capabilities) +PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR; +#endif /* defined(VK_KHR_external_memory_capabilities) */ +#if defined(VK_KHR_external_memory_fd) +PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR; +PFN_vkGetMemoryFdPropertiesKHR vkGetMemoryFdPropertiesKHR; +#endif /* defined(VK_KHR_external_memory_fd) */ +#if defined(VK_KHR_external_memory_win32) +PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR; +PFN_vkGetMemoryWin32HandlePropertiesKHR vkGetMemoryWin32HandlePropertiesKHR; +#endif /* defined(VK_KHR_external_memory_win32) */ +#if defined(VK_KHR_external_semaphore_capabilities) +PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; +#endif /* defined(VK_KHR_external_semaphore_capabilities) */ +#if defined(VK_KHR_external_semaphore_fd) +PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR; +PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR; +#endif /* defined(VK_KHR_external_semaphore_fd) */ +#if defined(VK_KHR_external_semaphore_win32) +PFN_vkGetSemaphoreWin32HandleKHR vkGetSemaphoreWin32HandleKHR; +PFN_vkImportSemaphoreWin32HandleKHR vkImportSemaphoreWin32HandleKHR; +#endif /* defined(VK_KHR_external_semaphore_win32) */ +#if defined(VK_KHR_fragment_shading_rate) +PFN_vkCmdSetFragmentShadingRateKHR vkCmdSetFragmentShadingRateKHR; +PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR vkGetPhysicalDeviceFragmentShadingRatesKHR; +#endif /* defined(VK_KHR_fragment_shading_rate) */ +#if defined(VK_KHR_get_display_properties2) +PFN_vkGetDisplayModeProperties2KHR vkGetDisplayModeProperties2KHR; +PFN_vkGetDisplayPlaneCapabilities2KHR vkGetDisplayPlaneCapabilities2KHR; +PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR vkGetPhysicalDeviceDisplayPlaneProperties2KHR; +PFN_vkGetPhysicalDeviceDisplayProperties2KHR vkGetPhysicalDeviceDisplayProperties2KHR; +#endif /* defined(VK_KHR_get_display_properties2) */ +#if defined(VK_KHR_get_memory_requirements2) +PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR; +PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR; +PFN_vkGetImageSparseMemoryRequirements2KHR vkGetImageSparseMemoryRequirements2KHR; +#endif /* defined(VK_KHR_get_memory_requirements2) */ +#if defined(VK_KHR_get_physical_device_properties2) +PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; +PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR; +PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR; +PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR; +PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR; +PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR; +PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR vkGetPhysicalDeviceSparseImageFormatProperties2KHR; +#endif /* defined(VK_KHR_get_physical_device_properties2) */ +#if defined(VK_KHR_get_surface_capabilities2) +PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR; +PFN_vkGetPhysicalDeviceSurfaceFormats2KHR vkGetPhysicalDeviceSurfaceFormats2KHR; +#endif /* defined(VK_KHR_get_surface_capabilities2) */ +#if defined(VK_KHR_line_rasterization) +PFN_vkCmdSetLineStippleKHR vkCmdSetLineStippleKHR; +#endif /* defined(VK_KHR_line_rasterization) */ +#if defined(VK_KHR_maintenance1) +PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR; +#endif /* defined(VK_KHR_maintenance1) */ +#if defined(VK_KHR_maintenance3) +PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR; +#endif /* defined(VK_KHR_maintenance3) */ +#if defined(VK_KHR_maintenance4) +PFN_vkGetDeviceBufferMemoryRequirementsKHR vkGetDeviceBufferMemoryRequirementsKHR; +PFN_vkGetDeviceImageMemoryRequirementsKHR vkGetDeviceImageMemoryRequirementsKHR; +PFN_vkGetDeviceImageSparseMemoryRequirementsKHR vkGetDeviceImageSparseMemoryRequirementsKHR; +#endif /* defined(VK_KHR_maintenance4) */ +#if defined(VK_KHR_maintenance5) +PFN_vkCmdBindIndexBuffer2KHR vkCmdBindIndexBuffer2KHR; +PFN_vkGetDeviceImageSubresourceLayoutKHR vkGetDeviceImageSubresourceLayoutKHR; +PFN_vkGetImageSubresourceLayout2KHR vkGetImageSubresourceLayout2KHR; +PFN_vkGetRenderingAreaGranularityKHR vkGetRenderingAreaGranularityKHR; +#endif /* defined(VK_KHR_maintenance5) */ +#if defined(VK_KHR_maintenance6) +PFN_vkCmdBindDescriptorSets2KHR vkCmdBindDescriptorSets2KHR; +PFN_vkCmdPushConstants2KHR vkCmdPushConstants2KHR; +#endif /* defined(VK_KHR_maintenance6) */ +#if defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) +PFN_vkCmdPushDescriptorSet2KHR vkCmdPushDescriptorSet2KHR; +PFN_vkCmdPushDescriptorSetWithTemplate2KHR vkCmdPushDescriptorSetWithTemplate2KHR; +#endif /* defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) +PFN_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT vkCmdBindDescriptorBufferEmbeddedSamplers2EXT; +PFN_vkCmdSetDescriptorBufferOffsets2EXT vkCmdSetDescriptorBufferOffsets2EXT; +#endif /* defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_KHR_map_memory2) +PFN_vkMapMemory2KHR vkMapMemory2KHR; +PFN_vkUnmapMemory2KHR vkUnmapMemory2KHR; +#endif /* defined(VK_KHR_map_memory2) */ +#if defined(VK_KHR_performance_query) +PFN_vkAcquireProfilingLockKHR vkAcquireProfilingLockKHR; +PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR; +PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR; +PFN_vkReleaseProfilingLockKHR vkReleaseProfilingLockKHR; +#endif /* defined(VK_KHR_performance_query) */ +#if defined(VK_KHR_pipeline_executable_properties) +PFN_vkGetPipelineExecutableInternalRepresentationsKHR vkGetPipelineExecutableInternalRepresentationsKHR; +PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR; +PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR; +#endif /* defined(VK_KHR_pipeline_executable_properties) */ +#if defined(VK_KHR_present_wait) +PFN_vkWaitForPresentKHR vkWaitForPresentKHR; +#endif /* defined(VK_KHR_present_wait) */ +#if defined(VK_KHR_push_descriptor) +PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR; +#endif /* defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) +PFN_vkCmdTraceRaysIndirect2KHR vkCmdTraceRaysIndirect2KHR; +#endif /* defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_ray_tracing_pipeline) +PFN_vkCmdSetRayTracingPipelineStackSizeKHR vkCmdSetRayTracingPipelineStackSizeKHR; +PFN_vkCmdTraceRaysIndirectKHR vkCmdTraceRaysIndirectKHR; +PFN_vkCmdTraceRaysKHR vkCmdTraceRaysKHR; +PFN_vkCreateRayTracingPipelinesKHR vkCreateRayTracingPipelinesKHR; +PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR vkGetRayTracingCaptureReplayShaderGroupHandlesKHR; +PFN_vkGetRayTracingShaderGroupHandlesKHR vkGetRayTracingShaderGroupHandlesKHR; +PFN_vkGetRayTracingShaderGroupStackSizeKHR vkGetRayTracingShaderGroupStackSizeKHR; +#endif /* defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_sampler_ycbcr_conversion) +PFN_vkCreateSamplerYcbcrConversionKHR vkCreateSamplerYcbcrConversionKHR; +PFN_vkDestroySamplerYcbcrConversionKHR vkDestroySamplerYcbcrConversionKHR; +#endif /* defined(VK_KHR_sampler_ycbcr_conversion) */ +#if defined(VK_KHR_shared_presentable_image) +PFN_vkGetSwapchainStatusKHR vkGetSwapchainStatusKHR; +#endif /* defined(VK_KHR_shared_presentable_image) */ +#if defined(VK_KHR_surface) +PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; +PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR; +PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR; +PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR; +PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; +#endif /* defined(VK_KHR_surface) */ +#if defined(VK_KHR_swapchain) +PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR; +PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR; +PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR; +PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR; +PFN_vkQueuePresentKHR vkQueuePresentKHR; +#endif /* defined(VK_KHR_swapchain) */ +#if defined(VK_KHR_synchronization2) +PFN_vkCmdPipelineBarrier2KHR vkCmdPipelineBarrier2KHR; +PFN_vkCmdResetEvent2KHR vkCmdResetEvent2KHR; +PFN_vkCmdSetEvent2KHR vkCmdSetEvent2KHR; +PFN_vkCmdWaitEvents2KHR vkCmdWaitEvents2KHR; +PFN_vkCmdWriteTimestamp2KHR vkCmdWriteTimestamp2KHR; +PFN_vkQueueSubmit2KHR vkQueueSubmit2KHR; +#endif /* defined(VK_KHR_synchronization2) */ +#if defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) +PFN_vkCmdWriteBufferMarker2AMD vkCmdWriteBufferMarker2AMD; +#endif /* defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) */ +#if defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) +PFN_vkGetQueueCheckpointData2NV vkGetQueueCheckpointData2NV; +#endif /* defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_KHR_timeline_semaphore) +PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValueKHR; +PFN_vkSignalSemaphoreKHR vkSignalSemaphoreKHR; +PFN_vkWaitSemaphoresKHR vkWaitSemaphoresKHR; +#endif /* defined(VK_KHR_timeline_semaphore) */ +#if defined(VK_KHR_video_decode_queue) +PFN_vkCmdDecodeVideoKHR vkCmdDecodeVideoKHR; +#endif /* defined(VK_KHR_video_decode_queue) */ +#if defined(VK_KHR_video_encode_queue) +PFN_vkCmdEncodeVideoKHR vkCmdEncodeVideoKHR; +PFN_vkGetEncodedVideoSessionParametersKHR vkGetEncodedVideoSessionParametersKHR; +PFN_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR; +#endif /* defined(VK_KHR_video_encode_queue) */ +#if defined(VK_KHR_video_queue) +PFN_vkBindVideoSessionMemoryKHR vkBindVideoSessionMemoryKHR; +PFN_vkCmdBeginVideoCodingKHR vkCmdBeginVideoCodingKHR; +PFN_vkCmdControlVideoCodingKHR vkCmdControlVideoCodingKHR; +PFN_vkCmdEndVideoCodingKHR vkCmdEndVideoCodingKHR; +PFN_vkCreateVideoSessionKHR vkCreateVideoSessionKHR; +PFN_vkCreateVideoSessionParametersKHR vkCreateVideoSessionParametersKHR; +PFN_vkDestroyVideoSessionKHR vkDestroyVideoSessionKHR; +PFN_vkDestroyVideoSessionParametersKHR vkDestroyVideoSessionParametersKHR; +PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR; +PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR vkGetPhysicalDeviceVideoFormatPropertiesKHR; +PFN_vkGetVideoSessionMemoryRequirementsKHR vkGetVideoSessionMemoryRequirementsKHR; +PFN_vkUpdateVideoSessionParametersKHR vkUpdateVideoSessionParametersKHR; +#endif /* defined(VK_KHR_video_queue) */ +#if defined(VK_KHR_wayland_surface) +PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR; +PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR vkGetPhysicalDeviceWaylandPresentationSupportKHR; +#endif /* defined(VK_KHR_wayland_surface) */ +#if defined(VK_KHR_win32_surface) +PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR; +PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR; +#endif /* defined(VK_KHR_win32_surface) */ +#if defined(VK_KHR_xcb_surface) +PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR; +PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR; +#endif /* defined(VK_KHR_xcb_surface) */ +#if defined(VK_KHR_xlib_surface) +PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR; +PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPhysicalDeviceXlibPresentationSupportKHR; +#endif /* defined(VK_KHR_xlib_surface) */ +#if defined(VK_MVK_ios_surface) +PFN_vkCreateIOSSurfaceMVK vkCreateIOSSurfaceMVK; +#endif /* defined(VK_MVK_ios_surface) */ +#if defined(VK_MVK_macos_surface) +PFN_vkCreateMacOSSurfaceMVK vkCreateMacOSSurfaceMVK; +#endif /* defined(VK_MVK_macos_surface) */ +#if defined(VK_NN_vi_surface) +PFN_vkCreateViSurfaceNN vkCreateViSurfaceNN; +#endif /* defined(VK_NN_vi_surface) */ +#if defined(VK_NVX_binary_import) +PFN_vkCmdCuLaunchKernelNVX vkCmdCuLaunchKernelNVX; +PFN_vkCreateCuFunctionNVX vkCreateCuFunctionNVX; +PFN_vkCreateCuModuleNVX vkCreateCuModuleNVX; +PFN_vkDestroyCuFunctionNVX vkDestroyCuFunctionNVX; +PFN_vkDestroyCuModuleNVX vkDestroyCuModuleNVX; +#endif /* defined(VK_NVX_binary_import) */ +#if defined(VK_NVX_image_view_handle) +PFN_vkGetImageViewAddressNVX vkGetImageViewAddressNVX; +PFN_vkGetImageViewHandleNVX vkGetImageViewHandleNVX; +#endif /* defined(VK_NVX_image_view_handle) */ +#if defined(VK_NV_acquire_winrt_display) +PFN_vkAcquireWinrtDisplayNV vkAcquireWinrtDisplayNV; +PFN_vkGetWinrtDisplayNV vkGetWinrtDisplayNV; +#endif /* defined(VK_NV_acquire_winrt_display) */ +#if defined(VK_NV_clip_space_w_scaling) +PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV; +#endif /* defined(VK_NV_clip_space_w_scaling) */ +#if defined(VK_NV_cooperative_matrix) +PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV vkGetPhysicalDeviceCooperativeMatrixPropertiesNV; +#endif /* defined(VK_NV_cooperative_matrix) */ +#if defined(VK_NV_copy_memory_indirect) +PFN_vkCmdCopyMemoryIndirectNV vkCmdCopyMemoryIndirectNV; +PFN_vkCmdCopyMemoryToImageIndirectNV vkCmdCopyMemoryToImageIndirectNV; +#endif /* defined(VK_NV_copy_memory_indirect) */ +#if defined(VK_NV_coverage_reduction_mode) +PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV; +#endif /* defined(VK_NV_coverage_reduction_mode) */ +#if defined(VK_NV_cuda_kernel_launch) +PFN_vkCmdCudaLaunchKernelNV vkCmdCudaLaunchKernelNV; +PFN_vkCreateCudaFunctionNV vkCreateCudaFunctionNV; +PFN_vkCreateCudaModuleNV vkCreateCudaModuleNV; +PFN_vkDestroyCudaFunctionNV vkDestroyCudaFunctionNV; +PFN_vkDestroyCudaModuleNV vkDestroyCudaModuleNV; +PFN_vkGetCudaModuleCacheNV vkGetCudaModuleCacheNV; +#endif /* defined(VK_NV_cuda_kernel_launch) */ +#if defined(VK_NV_device_diagnostic_checkpoints) +PFN_vkCmdSetCheckpointNV vkCmdSetCheckpointNV; +PFN_vkGetQueueCheckpointDataNV vkGetQueueCheckpointDataNV; +#endif /* defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_NV_device_generated_commands) +PFN_vkCmdBindPipelineShaderGroupNV vkCmdBindPipelineShaderGroupNV; +PFN_vkCmdExecuteGeneratedCommandsNV vkCmdExecuteGeneratedCommandsNV; +PFN_vkCmdPreprocessGeneratedCommandsNV vkCmdPreprocessGeneratedCommandsNV; +PFN_vkCreateIndirectCommandsLayoutNV vkCreateIndirectCommandsLayoutNV; +PFN_vkDestroyIndirectCommandsLayoutNV vkDestroyIndirectCommandsLayoutNV; +PFN_vkGetGeneratedCommandsMemoryRequirementsNV vkGetGeneratedCommandsMemoryRequirementsNV; +#endif /* defined(VK_NV_device_generated_commands) */ +#if defined(VK_NV_device_generated_commands_compute) +PFN_vkCmdUpdatePipelineIndirectBufferNV vkCmdUpdatePipelineIndirectBufferNV; +PFN_vkGetPipelineIndirectDeviceAddressNV vkGetPipelineIndirectDeviceAddressNV; +PFN_vkGetPipelineIndirectMemoryRequirementsNV vkGetPipelineIndirectMemoryRequirementsNV; +#endif /* defined(VK_NV_device_generated_commands_compute) */ +#if defined(VK_NV_external_memory_capabilities) +PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV vkGetPhysicalDeviceExternalImageFormatPropertiesNV; +#endif /* defined(VK_NV_external_memory_capabilities) */ +#if defined(VK_NV_external_memory_rdma) +PFN_vkGetMemoryRemoteAddressNV vkGetMemoryRemoteAddressNV; +#endif /* defined(VK_NV_external_memory_rdma) */ +#if defined(VK_NV_external_memory_win32) +PFN_vkGetMemoryWin32HandleNV vkGetMemoryWin32HandleNV; +#endif /* defined(VK_NV_external_memory_win32) */ +#if defined(VK_NV_fragment_shading_rate_enums) +PFN_vkCmdSetFragmentShadingRateEnumNV vkCmdSetFragmentShadingRateEnumNV; +#endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) +PFN_vkGetLatencyTimingsNV vkGetLatencyTimingsNV; +PFN_vkLatencySleepNV vkLatencySleepNV; +PFN_vkQueueNotifyOutOfBandNV vkQueueNotifyOutOfBandNV; +PFN_vkSetLatencyMarkerNV vkSetLatencyMarkerNV; +PFN_vkSetLatencySleepModeNV vkSetLatencySleepModeNV; +#endif /* defined(VK_NV_low_latency2) */ +#if defined(VK_NV_memory_decompression) +PFN_vkCmdDecompressMemoryIndirectCountNV vkCmdDecompressMemoryIndirectCountNV; +PFN_vkCmdDecompressMemoryNV vkCmdDecompressMemoryNV; +#endif /* defined(VK_NV_memory_decompression) */ +#if defined(VK_NV_mesh_shader) +PFN_vkCmdDrawMeshTasksIndirectCountNV vkCmdDrawMeshTasksIndirectCountNV; +PFN_vkCmdDrawMeshTasksIndirectNV vkCmdDrawMeshTasksIndirectNV; +PFN_vkCmdDrawMeshTasksNV vkCmdDrawMeshTasksNV; +#endif /* defined(VK_NV_mesh_shader) */ +#if defined(VK_NV_optical_flow) +PFN_vkBindOpticalFlowSessionImageNV vkBindOpticalFlowSessionImageNV; +PFN_vkCmdOpticalFlowExecuteNV vkCmdOpticalFlowExecuteNV; +PFN_vkCreateOpticalFlowSessionNV vkCreateOpticalFlowSessionNV; +PFN_vkDestroyOpticalFlowSessionNV vkDestroyOpticalFlowSessionNV; +PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV vkGetPhysicalDeviceOpticalFlowImageFormatsNV; +#endif /* defined(VK_NV_optical_flow) */ +#if defined(VK_NV_ray_tracing) +PFN_vkBindAccelerationStructureMemoryNV vkBindAccelerationStructureMemoryNV; +PFN_vkCmdBuildAccelerationStructureNV vkCmdBuildAccelerationStructureNV; +PFN_vkCmdCopyAccelerationStructureNV vkCmdCopyAccelerationStructureNV; +PFN_vkCmdTraceRaysNV vkCmdTraceRaysNV; +PFN_vkCmdWriteAccelerationStructuresPropertiesNV vkCmdWriteAccelerationStructuresPropertiesNV; +PFN_vkCompileDeferredNV vkCompileDeferredNV; +PFN_vkCreateAccelerationStructureNV vkCreateAccelerationStructureNV; +PFN_vkCreateRayTracingPipelinesNV vkCreateRayTracingPipelinesNV; +PFN_vkDestroyAccelerationStructureNV vkDestroyAccelerationStructureNV; +PFN_vkGetAccelerationStructureHandleNV vkGetAccelerationStructureHandleNV; +PFN_vkGetAccelerationStructureMemoryRequirementsNV vkGetAccelerationStructureMemoryRequirementsNV; +PFN_vkGetRayTracingShaderGroupHandlesNV vkGetRayTracingShaderGroupHandlesNV; +#endif /* defined(VK_NV_ray_tracing) */ +#if defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 +PFN_vkCmdSetExclusiveScissorEnableNV vkCmdSetExclusiveScissorEnableNV; +#endif /* defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 */ +#if defined(VK_NV_scissor_exclusive) +PFN_vkCmdSetExclusiveScissorNV vkCmdSetExclusiveScissorNV; +#endif /* defined(VK_NV_scissor_exclusive) */ +#if defined(VK_NV_shading_rate_image) +PFN_vkCmdBindShadingRateImageNV vkCmdBindShadingRateImageNV; +PFN_vkCmdSetCoarseSampleOrderNV vkCmdSetCoarseSampleOrderNV; +PFN_vkCmdSetViewportShadingRatePaletteNV vkCmdSetViewportShadingRatePaletteNV; +#endif /* defined(VK_NV_shading_rate_image) */ +#if defined(VK_QCOM_tile_properties) +PFN_vkGetDynamicRenderingTilePropertiesQCOM vkGetDynamicRenderingTilePropertiesQCOM; +PFN_vkGetFramebufferTilePropertiesQCOM vkGetFramebufferTilePropertiesQCOM; +#endif /* defined(VK_QCOM_tile_properties) */ +#if defined(VK_QNX_external_memory_screen_buffer) +PFN_vkGetScreenBufferPropertiesQNX vkGetScreenBufferPropertiesQNX; +#endif /* defined(VK_QNX_external_memory_screen_buffer) */ +#if defined(VK_QNX_screen_surface) +PFN_vkCreateScreenSurfaceQNX vkCreateScreenSurfaceQNX; +PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX vkGetPhysicalDeviceScreenPresentationSupportQNX; +#endif /* defined(VK_QNX_screen_surface) */ +#if defined(VK_VALVE_descriptor_set_host_mapping) +PFN_vkGetDescriptorSetHostMappingVALVE vkGetDescriptorSetHostMappingVALVE; +PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE vkGetDescriptorSetLayoutHostMappingInfoVALVE; +#endif /* defined(VK_VALVE_descriptor_set_host_mapping) */ +#if (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) +PFN_vkCmdBindVertexBuffers2EXT vkCmdBindVertexBuffers2EXT; +PFN_vkCmdSetCullModeEXT vkCmdSetCullModeEXT; +PFN_vkCmdSetDepthBoundsTestEnableEXT vkCmdSetDepthBoundsTestEnableEXT; +PFN_vkCmdSetDepthCompareOpEXT vkCmdSetDepthCompareOpEXT; +PFN_vkCmdSetDepthTestEnableEXT vkCmdSetDepthTestEnableEXT; +PFN_vkCmdSetDepthWriteEnableEXT vkCmdSetDepthWriteEnableEXT; +PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT; +PFN_vkCmdSetPrimitiveTopologyEXT vkCmdSetPrimitiveTopologyEXT; +PFN_vkCmdSetScissorWithCountEXT vkCmdSetScissorWithCountEXT; +PFN_vkCmdSetStencilOpEXT vkCmdSetStencilOpEXT; +PFN_vkCmdSetStencilTestEnableEXT vkCmdSetStencilTestEnableEXT; +PFN_vkCmdSetViewportWithCountEXT vkCmdSetViewportWithCountEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) +PFN_vkCmdSetDepthBiasEnableEXT vkCmdSetDepthBiasEnableEXT; +PFN_vkCmdSetLogicOpEXT vkCmdSetLogicOpEXT; +PFN_vkCmdSetPatchControlPointsEXT vkCmdSetPatchControlPointsEXT; +PFN_vkCmdSetPrimitiveRestartEnableEXT vkCmdSetPrimitiveRestartEnableEXT; +PFN_vkCmdSetRasterizerDiscardEnableEXT vkCmdSetRasterizerDiscardEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) +PFN_vkCmdSetAlphaToCoverageEnableEXT vkCmdSetAlphaToCoverageEnableEXT; +PFN_vkCmdSetAlphaToOneEnableEXT vkCmdSetAlphaToOneEnableEXT; +PFN_vkCmdSetColorBlendEnableEXT vkCmdSetColorBlendEnableEXT; +PFN_vkCmdSetColorBlendEquationEXT vkCmdSetColorBlendEquationEXT; +PFN_vkCmdSetColorWriteMaskEXT vkCmdSetColorWriteMaskEXT; +PFN_vkCmdSetDepthClampEnableEXT vkCmdSetDepthClampEnableEXT; +PFN_vkCmdSetLogicOpEnableEXT vkCmdSetLogicOpEnableEXT; +PFN_vkCmdSetPolygonModeEXT vkCmdSetPolygonModeEXT; +PFN_vkCmdSetRasterizationSamplesEXT vkCmdSetRasterizationSamplesEXT; +PFN_vkCmdSetSampleMaskEXT vkCmdSetSampleMaskEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) +PFN_vkCmdSetTessellationDomainOriginEXT vkCmdSetTessellationDomainOriginEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) +PFN_vkCmdSetRasterizationStreamEXT vkCmdSetRasterizationStreamEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) +PFN_vkCmdSetConservativeRasterizationModeEXT vkCmdSetConservativeRasterizationModeEXT; +PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT vkCmdSetExtraPrimitiveOverestimationSizeEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) +PFN_vkCmdSetDepthClipEnableEXT vkCmdSetDepthClipEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) +PFN_vkCmdSetSampleLocationsEnableEXT vkCmdSetSampleLocationsEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) +PFN_vkCmdSetColorBlendAdvancedEXT vkCmdSetColorBlendAdvancedEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) +PFN_vkCmdSetProvokingVertexModeEXT vkCmdSetProvokingVertexModeEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) +PFN_vkCmdSetLineRasterizationModeEXT vkCmdSetLineRasterizationModeEXT; +PFN_vkCmdSetLineStippleEnableEXT vkCmdSetLineStippleEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) +PFN_vkCmdSetDepthClipNegativeOneToOneEXT vkCmdSetDepthClipNegativeOneToOneEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) +PFN_vkCmdSetViewportWScalingEnableNV vkCmdSetViewportWScalingEnableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) +PFN_vkCmdSetViewportSwizzleNV vkCmdSetViewportSwizzleNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) +PFN_vkCmdSetCoverageToColorEnableNV vkCmdSetCoverageToColorEnableNV; +PFN_vkCmdSetCoverageToColorLocationNV vkCmdSetCoverageToColorLocationNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) +PFN_vkCmdSetCoverageModulationModeNV vkCmdSetCoverageModulationModeNV; +PFN_vkCmdSetCoverageModulationTableEnableNV vkCmdSetCoverageModulationTableEnableNV; +PFN_vkCmdSetCoverageModulationTableNV vkCmdSetCoverageModulationTableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) +PFN_vkCmdSetShadingRateImageEnableNV vkCmdSetShadingRateImageEnableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) +PFN_vkCmdSetRepresentativeFragmentTestEnableNV vkCmdSetRepresentativeFragmentTestEnableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) +PFN_vkCmdSetCoverageReductionModeNV vkCmdSetCoverageReductionModeNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) */ +#if (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) +PFN_vkGetImageSubresourceLayout2EXT vkGetImageSubresourceLayout2EXT; +#endif /* (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) */ +#if (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) +PFN_vkCmdSetVertexInputEXT vkCmdSetVertexInputEXT; +#endif /* (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) */ +#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) +PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR; +#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) +PFN_vkGetDeviceGroupPresentCapabilitiesKHR vkGetDeviceGroupPresentCapabilitiesKHR; +PFN_vkGetDeviceGroupSurfacePresentModesKHR vkGetDeviceGroupSurfacePresentModesKHR; +PFN_vkGetPhysicalDevicePresentRectanglesKHR vkGetPhysicalDevicePresentRectanglesKHR; +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) +PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR; +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ +/* VOLK_GENERATE_PROTOTYPES_C */ + +#ifdef __GNUC__ +# pragma GCC visibility pop +#endif + +#ifdef __cplusplus +} +#endif +/* clang-format on */ diff --git a/deps/volk copy/volk.h b/deps/volk copy/volk.h new file mode 100644 index 0000000..1ad7ed2 --- /dev/null +++ b/deps/volk copy/volk.h @@ -0,0 +1,2075 @@ +/** + * volk + * + * Copyright (C) 2018-2024, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) + * Report bugs and download new versions at https://github.com/zeux/volk + * + * This library is distributed under the MIT License. See notice at the end of this file. + */ +/* clang-format off */ +#ifndef VOLK_H_ +#define VOLK_H_ + +#if defined(VULKAN_H_) && !defined(VK_NO_PROTOTYPES) +# error To use volk, you need to define VK_NO_PROTOTYPES before including vulkan.h +#endif + +/* VOLK_GENERATE_VERSION_DEFINE */ +#define VOLK_HEADER_VERSION 293 +/* VOLK_GENERATE_VERSION_DEFINE */ + +#ifndef VK_NO_PROTOTYPES +# define VK_NO_PROTOTYPES +#endif + +#ifndef VULKAN_H_ +# ifdef VOLK_VULKAN_H_PATH +# include VOLK_VULKAN_H_PATH +# elif defined(VK_USE_PLATFORM_WIN32_KHR) +# include +# include + + /* When VK_USE_PLATFORM_WIN32_KHR is defined, instead of including vulkan.h directly, we include individual parts of the SDK + * This is necessary to avoid including which is very heavy - it takes 200ms to parse without WIN32_LEAN_AND_MEAN + * and 100ms to parse with it. vulkan_win32.h only needs a few symbols that are easy to redefine ourselves. + */ + typedef unsigned long DWORD; + typedef const wchar_t* LPCWSTR; + typedef void* HANDLE; + typedef struct HINSTANCE__* HINSTANCE; + typedef struct HWND__* HWND; + typedef struct HMONITOR__* HMONITOR; + typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES; + +# include + +# ifdef VK_ENABLE_BETA_EXTENSIONS +# include +# endif +# else +# include +# endif +#endif + +/* Disable several extensions on earlier SDKs because later SDKs introduce a backwards incompatible change to function signatures */ +#if VK_HEADER_VERSION < 140 +# undef VK_NVX_image_view_handle +#endif +#if VK_HEADER_VERSION < 184 +# undef VK_HUAWEI_subpass_shading +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct VolkDeviceTable; + +/** + * Initialize library by loading Vulkan loader; call this function before creating the Vulkan instance. + * + * Returns VK_SUCCESS on success and VK_ERROR_INITIALIZATION_FAILED otherwise. + */ +VkResult volkInitialize(void); + +/** + * Initialize library by providing a custom handler to load global symbols. + * + * This function can be used instead of volkInitialize. + * The handler function pointer will be asked to load global Vulkan symbols which require no instance + * (such as vkCreateInstance, vkEnumerateInstance* and vkEnumerateInstanceVersion if available). + */ +void volkInitializeCustom(PFN_vkGetInstanceProcAddr handler); + +/** + * Finalize library by unloading Vulkan loader and resetting global symbols to NULL. + * + * This function does not need to be called on process exit (as loader will be unloaded automatically) or if volkInitialize failed. + * In general this function is optional to call but may be useful in rare cases eg if volk needs to be reinitialized multiple times. + */ +void volkFinalize(void); + +/** + * Get Vulkan instance version supported by the Vulkan loader, or 0 if Vulkan isn't supported + * + * Returns 0 if volkInitialize wasn't called or failed. + */ +uint32_t volkGetInstanceVersion(void); + +/** + * Load global function pointers using application-created VkInstance; call this function after creating the Vulkan instance. + */ +void volkLoadInstance(VkInstance instance); + +/** + * Load global function pointers using application-created VkInstance; call this function after creating the Vulkan instance. + * Skips loading device-based function pointers, requires usage of volkLoadDevice afterwards. + */ +void volkLoadInstanceOnly(VkInstance instance); + +/** + * Load global function pointers using application-created VkDevice; call this function after creating the Vulkan device. + * + * Note: this is not suitable for applications that want to use multiple VkDevice objects concurrently. + */ +void volkLoadDevice(VkDevice device); + +/** + * Return last VkInstance for which global function pointers have been loaded via volkLoadInstance(), + * or VK_NULL_HANDLE if volkLoadInstance() has not been called. + */ +VkInstance volkGetLoadedInstance(void); + +/** + * Return last VkDevice for which global function pointers have been loaded via volkLoadDevice(), + * or VK_NULL_HANDLE if volkLoadDevice() has not been called. + */ +VkDevice volkGetLoadedDevice(void); + +/** + * Load function pointers using application-created VkDevice into a table. + * Application should use function pointers from that table instead of using global function pointers. + */ +void volkLoadDeviceTable(struct VolkDeviceTable* table, VkDevice device); + +/** + * Device-specific function pointer table + */ +struct VolkDeviceTable +{ + /* VOLK_GENERATE_DEVICE_TABLE */ +#if defined(VK_VERSION_1_0) + PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers; + PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets; + PFN_vkAllocateMemory vkAllocateMemory; + PFN_vkBeginCommandBuffer vkBeginCommandBuffer; + PFN_vkBindBufferMemory vkBindBufferMemory; + PFN_vkBindImageMemory vkBindImageMemory; + PFN_vkCmdBeginQuery vkCmdBeginQuery; + PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass; + PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets; + PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer; + PFN_vkCmdBindPipeline vkCmdBindPipeline; + PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers; + PFN_vkCmdBlitImage vkCmdBlitImage; + PFN_vkCmdClearAttachments vkCmdClearAttachments; + PFN_vkCmdClearColorImage vkCmdClearColorImage; + PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage; + PFN_vkCmdCopyBuffer vkCmdCopyBuffer; + PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage; + PFN_vkCmdCopyImage vkCmdCopyImage; + PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer; + PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults; + PFN_vkCmdDispatch vkCmdDispatch; + PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect; + PFN_vkCmdDraw vkCmdDraw; + PFN_vkCmdDrawIndexed vkCmdDrawIndexed; + PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect; + PFN_vkCmdDrawIndirect vkCmdDrawIndirect; + PFN_vkCmdEndQuery vkCmdEndQuery; + PFN_vkCmdEndRenderPass vkCmdEndRenderPass; + PFN_vkCmdExecuteCommands vkCmdExecuteCommands; + PFN_vkCmdFillBuffer vkCmdFillBuffer; + PFN_vkCmdNextSubpass vkCmdNextSubpass; + PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier; + PFN_vkCmdPushConstants vkCmdPushConstants; + PFN_vkCmdResetEvent vkCmdResetEvent; + PFN_vkCmdResetQueryPool vkCmdResetQueryPool; + PFN_vkCmdResolveImage vkCmdResolveImage; + PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants; + PFN_vkCmdSetDepthBias vkCmdSetDepthBias; + PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds; + PFN_vkCmdSetEvent vkCmdSetEvent; + PFN_vkCmdSetLineWidth vkCmdSetLineWidth; + PFN_vkCmdSetScissor vkCmdSetScissor; + PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask; + PFN_vkCmdSetStencilReference vkCmdSetStencilReference; + PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask; + PFN_vkCmdSetViewport vkCmdSetViewport; + PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer; + PFN_vkCmdWaitEvents vkCmdWaitEvents; + PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp; + PFN_vkCreateBuffer vkCreateBuffer; + PFN_vkCreateBufferView vkCreateBufferView; + PFN_vkCreateCommandPool vkCreateCommandPool; + PFN_vkCreateComputePipelines vkCreateComputePipelines; + PFN_vkCreateDescriptorPool vkCreateDescriptorPool; + PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout; + PFN_vkCreateEvent vkCreateEvent; + PFN_vkCreateFence vkCreateFence; + PFN_vkCreateFramebuffer vkCreateFramebuffer; + PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines; + PFN_vkCreateImage vkCreateImage; + PFN_vkCreateImageView vkCreateImageView; + PFN_vkCreatePipelineCache vkCreatePipelineCache; + PFN_vkCreatePipelineLayout vkCreatePipelineLayout; + PFN_vkCreateQueryPool vkCreateQueryPool; + PFN_vkCreateRenderPass vkCreateRenderPass; + PFN_vkCreateSampler vkCreateSampler; + PFN_vkCreateSemaphore vkCreateSemaphore; + PFN_vkCreateShaderModule vkCreateShaderModule; + PFN_vkDestroyBuffer vkDestroyBuffer; + PFN_vkDestroyBufferView vkDestroyBufferView; + PFN_vkDestroyCommandPool vkDestroyCommandPool; + PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool; + PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout; + PFN_vkDestroyDevice vkDestroyDevice; + PFN_vkDestroyEvent vkDestroyEvent; + PFN_vkDestroyFence vkDestroyFence; + PFN_vkDestroyFramebuffer vkDestroyFramebuffer; + PFN_vkDestroyImage vkDestroyImage; + PFN_vkDestroyImageView vkDestroyImageView; + PFN_vkDestroyPipeline vkDestroyPipeline; + PFN_vkDestroyPipelineCache vkDestroyPipelineCache; + PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout; + PFN_vkDestroyQueryPool vkDestroyQueryPool; + PFN_vkDestroyRenderPass vkDestroyRenderPass; + PFN_vkDestroySampler vkDestroySampler; + PFN_vkDestroySemaphore vkDestroySemaphore; + PFN_vkDestroyShaderModule vkDestroyShaderModule; + PFN_vkDeviceWaitIdle vkDeviceWaitIdle; + PFN_vkEndCommandBuffer vkEndCommandBuffer; + PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges; + PFN_vkFreeCommandBuffers vkFreeCommandBuffers; + PFN_vkFreeDescriptorSets vkFreeDescriptorSets; + PFN_vkFreeMemory vkFreeMemory; + PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements; + PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment; + PFN_vkGetDeviceQueue vkGetDeviceQueue; + PFN_vkGetEventStatus vkGetEventStatus; + PFN_vkGetFenceStatus vkGetFenceStatus; + PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements; + PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements; + PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout; + PFN_vkGetPipelineCacheData vkGetPipelineCacheData; + PFN_vkGetQueryPoolResults vkGetQueryPoolResults; + PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity; + PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges; + PFN_vkMapMemory vkMapMemory; + PFN_vkMergePipelineCaches vkMergePipelineCaches; + PFN_vkQueueBindSparse vkQueueBindSparse; + PFN_vkQueueSubmit vkQueueSubmit; + PFN_vkQueueWaitIdle vkQueueWaitIdle; + PFN_vkResetCommandBuffer vkResetCommandBuffer; + PFN_vkResetCommandPool vkResetCommandPool; + PFN_vkResetDescriptorPool vkResetDescriptorPool; + PFN_vkResetEvent vkResetEvent; + PFN_vkResetFences vkResetFences; + PFN_vkSetEvent vkSetEvent; + PFN_vkUnmapMemory vkUnmapMemory; + PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets; + PFN_vkWaitForFences vkWaitForFences; +#endif /* defined(VK_VERSION_1_0) */ +#if defined(VK_VERSION_1_1) + PFN_vkBindBufferMemory2 vkBindBufferMemory2; + PFN_vkBindImageMemory2 vkBindImageMemory2; + PFN_vkCmdDispatchBase vkCmdDispatchBase; + PFN_vkCmdSetDeviceMask vkCmdSetDeviceMask; + PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate; + PFN_vkCreateSamplerYcbcrConversion vkCreateSamplerYcbcrConversion; + PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate; + PFN_vkDestroySamplerYcbcrConversion vkDestroySamplerYcbcrConversion; + PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2; + PFN_vkGetDescriptorSetLayoutSupport vkGetDescriptorSetLayoutSupport; + PFN_vkGetDeviceGroupPeerMemoryFeatures vkGetDeviceGroupPeerMemoryFeatures; + PFN_vkGetDeviceQueue2 vkGetDeviceQueue2; + PFN_vkGetImageMemoryRequirements2 vkGetImageMemoryRequirements2; + PFN_vkGetImageSparseMemoryRequirements2 vkGetImageSparseMemoryRequirements2; + PFN_vkTrimCommandPool vkTrimCommandPool; + PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate; +#endif /* defined(VK_VERSION_1_1) */ +#if defined(VK_VERSION_1_2) + PFN_vkCmdBeginRenderPass2 vkCmdBeginRenderPass2; + PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount; + PFN_vkCmdDrawIndirectCount vkCmdDrawIndirectCount; + PFN_vkCmdEndRenderPass2 vkCmdEndRenderPass2; + PFN_vkCmdNextSubpass2 vkCmdNextSubpass2; + PFN_vkCreateRenderPass2 vkCreateRenderPass2; + PFN_vkGetBufferDeviceAddress vkGetBufferDeviceAddress; + PFN_vkGetBufferOpaqueCaptureAddress vkGetBufferOpaqueCaptureAddress; + PFN_vkGetDeviceMemoryOpaqueCaptureAddress vkGetDeviceMemoryOpaqueCaptureAddress; + PFN_vkGetSemaphoreCounterValue vkGetSemaphoreCounterValue; + PFN_vkResetQueryPool vkResetQueryPool; + PFN_vkSignalSemaphore vkSignalSemaphore; + PFN_vkWaitSemaphores vkWaitSemaphores; +#endif /* defined(VK_VERSION_1_2) */ +#if defined(VK_VERSION_1_3) + PFN_vkCmdBeginRendering vkCmdBeginRendering; + PFN_vkCmdBindVertexBuffers2 vkCmdBindVertexBuffers2; + PFN_vkCmdBlitImage2 vkCmdBlitImage2; + PFN_vkCmdCopyBuffer2 vkCmdCopyBuffer2; + PFN_vkCmdCopyBufferToImage2 vkCmdCopyBufferToImage2; + PFN_vkCmdCopyImage2 vkCmdCopyImage2; + PFN_vkCmdCopyImageToBuffer2 vkCmdCopyImageToBuffer2; + PFN_vkCmdEndRendering vkCmdEndRendering; + PFN_vkCmdPipelineBarrier2 vkCmdPipelineBarrier2; + PFN_vkCmdResetEvent2 vkCmdResetEvent2; + PFN_vkCmdResolveImage2 vkCmdResolveImage2; + PFN_vkCmdSetCullMode vkCmdSetCullMode; + PFN_vkCmdSetDepthBiasEnable vkCmdSetDepthBiasEnable; + PFN_vkCmdSetDepthBoundsTestEnable vkCmdSetDepthBoundsTestEnable; + PFN_vkCmdSetDepthCompareOp vkCmdSetDepthCompareOp; + PFN_vkCmdSetDepthTestEnable vkCmdSetDepthTestEnable; + PFN_vkCmdSetDepthWriteEnable vkCmdSetDepthWriteEnable; + PFN_vkCmdSetEvent2 vkCmdSetEvent2; + PFN_vkCmdSetFrontFace vkCmdSetFrontFace; + PFN_vkCmdSetPrimitiveRestartEnable vkCmdSetPrimitiveRestartEnable; + PFN_vkCmdSetPrimitiveTopology vkCmdSetPrimitiveTopology; + PFN_vkCmdSetRasterizerDiscardEnable vkCmdSetRasterizerDiscardEnable; + PFN_vkCmdSetScissorWithCount vkCmdSetScissorWithCount; + PFN_vkCmdSetStencilOp vkCmdSetStencilOp; + PFN_vkCmdSetStencilTestEnable vkCmdSetStencilTestEnable; + PFN_vkCmdSetViewportWithCount vkCmdSetViewportWithCount; + PFN_vkCmdWaitEvents2 vkCmdWaitEvents2; + PFN_vkCmdWriteTimestamp2 vkCmdWriteTimestamp2; + PFN_vkCreatePrivateDataSlot vkCreatePrivateDataSlot; + PFN_vkDestroyPrivateDataSlot vkDestroyPrivateDataSlot; + PFN_vkGetDeviceBufferMemoryRequirements vkGetDeviceBufferMemoryRequirements; + PFN_vkGetDeviceImageMemoryRequirements vkGetDeviceImageMemoryRequirements; + PFN_vkGetDeviceImageSparseMemoryRequirements vkGetDeviceImageSparseMemoryRequirements; + PFN_vkGetPrivateData vkGetPrivateData; + PFN_vkQueueSubmit2 vkQueueSubmit2; + PFN_vkSetPrivateData vkSetPrivateData; +#endif /* defined(VK_VERSION_1_3) */ +#if defined(VK_AMDX_shader_enqueue) + PFN_vkCmdDispatchGraphAMDX vkCmdDispatchGraphAMDX; + PFN_vkCmdDispatchGraphIndirectAMDX vkCmdDispatchGraphIndirectAMDX; + PFN_vkCmdDispatchGraphIndirectCountAMDX vkCmdDispatchGraphIndirectCountAMDX; + PFN_vkCmdInitializeGraphScratchMemoryAMDX vkCmdInitializeGraphScratchMemoryAMDX; + PFN_vkCreateExecutionGraphPipelinesAMDX vkCreateExecutionGraphPipelinesAMDX; + PFN_vkGetExecutionGraphPipelineNodeIndexAMDX vkGetExecutionGraphPipelineNodeIndexAMDX; + PFN_vkGetExecutionGraphPipelineScratchSizeAMDX vkGetExecutionGraphPipelineScratchSizeAMDX; +#endif /* defined(VK_AMDX_shader_enqueue) */ +#if defined(VK_AMD_anti_lag) + PFN_vkAntiLagUpdateAMD vkAntiLagUpdateAMD; +#endif /* defined(VK_AMD_anti_lag) */ +#if defined(VK_AMD_buffer_marker) + PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD; +#endif /* defined(VK_AMD_buffer_marker) */ +#if defined(VK_AMD_display_native_hdr) + PFN_vkSetLocalDimmingAMD vkSetLocalDimmingAMD; +#endif /* defined(VK_AMD_display_native_hdr) */ +#if defined(VK_AMD_draw_indirect_count) + PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD; + PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD; +#endif /* defined(VK_AMD_draw_indirect_count) */ +#if defined(VK_AMD_shader_info) + PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD; +#endif /* defined(VK_AMD_shader_info) */ +#if defined(VK_ANDROID_external_memory_android_hardware_buffer) + PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID; + PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBufferANDROID; +#endif /* defined(VK_ANDROID_external_memory_android_hardware_buffer) */ +#if defined(VK_EXT_attachment_feedback_loop_dynamic_state) + PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT vkCmdSetAttachmentFeedbackLoopEnableEXT; +#endif /* defined(VK_EXT_attachment_feedback_loop_dynamic_state) */ +#if defined(VK_EXT_buffer_device_address) + PFN_vkGetBufferDeviceAddressEXT vkGetBufferDeviceAddressEXT; +#endif /* defined(VK_EXT_buffer_device_address) */ +#if defined(VK_EXT_calibrated_timestamps) + PFN_vkGetCalibratedTimestampsEXT vkGetCalibratedTimestampsEXT; +#endif /* defined(VK_EXT_calibrated_timestamps) */ +#if defined(VK_EXT_color_write_enable) + PFN_vkCmdSetColorWriteEnableEXT vkCmdSetColorWriteEnableEXT; +#endif /* defined(VK_EXT_color_write_enable) */ +#if defined(VK_EXT_conditional_rendering) + PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT; + PFN_vkCmdEndConditionalRenderingEXT vkCmdEndConditionalRenderingEXT; +#endif /* defined(VK_EXT_conditional_rendering) */ +#if defined(VK_EXT_debug_marker) + PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT; + PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT; + PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT; + PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT; + PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT; +#endif /* defined(VK_EXT_debug_marker) */ +#if defined(VK_EXT_depth_bias_control) + PFN_vkCmdSetDepthBias2EXT vkCmdSetDepthBias2EXT; +#endif /* defined(VK_EXT_depth_bias_control) */ +#if defined(VK_EXT_descriptor_buffer) + PFN_vkCmdBindDescriptorBufferEmbeddedSamplersEXT vkCmdBindDescriptorBufferEmbeddedSamplersEXT; + PFN_vkCmdBindDescriptorBuffersEXT vkCmdBindDescriptorBuffersEXT; + PFN_vkCmdSetDescriptorBufferOffsetsEXT vkCmdSetDescriptorBufferOffsetsEXT; + PFN_vkGetBufferOpaqueCaptureDescriptorDataEXT vkGetBufferOpaqueCaptureDescriptorDataEXT; + PFN_vkGetDescriptorEXT vkGetDescriptorEXT; + PFN_vkGetDescriptorSetLayoutBindingOffsetEXT vkGetDescriptorSetLayoutBindingOffsetEXT; + PFN_vkGetDescriptorSetLayoutSizeEXT vkGetDescriptorSetLayoutSizeEXT; + PFN_vkGetImageOpaqueCaptureDescriptorDataEXT vkGetImageOpaqueCaptureDescriptorDataEXT; + PFN_vkGetImageViewOpaqueCaptureDescriptorDataEXT vkGetImageViewOpaqueCaptureDescriptorDataEXT; + PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT vkGetSamplerOpaqueCaptureDescriptorDataEXT; +#endif /* defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) + PFN_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT; +#endif /* defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) */ +#if defined(VK_EXT_device_fault) + PFN_vkGetDeviceFaultInfoEXT vkGetDeviceFaultInfoEXT; +#endif /* defined(VK_EXT_device_fault) */ +#if defined(VK_EXT_discard_rectangles) + PFN_vkCmdSetDiscardRectangleEXT vkCmdSetDiscardRectangleEXT; +#endif /* defined(VK_EXT_discard_rectangles) */ +#if defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 + PFN_vkCmdSetDiscardRectangleEnableEXT vkCmdSetDiscardRectangleEnableEXT; + PFN_vkCmdSetDiscardRectangleModeEXT vkCmdSetDiscardRectangleModeEXT; +#endif /* defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 */ +#if defined(VK_EXT_display_control) + PFN_vkDisplayPowerControlEXT vkDisplayPowerControlEXT; + PFN_vkGetSwapchainCounterEXT vkGetSwapchainCounterEXT; + PFN_vkRegisterDeviceEventEXT vkRegisterDeviceEventEXT; + PFN_vkRegisterDisplayEventEXT vkRegisterDisplayEventEXT; +#endif /* defined(VK_EXT_display_control) */ +#if defined(VK_EXT_external_memory_host) + PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT; +#endif /* defined(VK_EXT_external_memory_host) */ +#if defined(VK_EXT_full_screen_exclusive) + PFN_vkAcquireFullScreenExclusiveModeEXT vkAcquireFullScreenExclusiveModeEXT; + PFN_vkReleaseFullScreenExclusiveModeEXT vkReleaseFullScreenExclusiveModeEXT; +#endif /* defined(VK_EXT_full_screen_exclusive) */ +#if defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) + PFN_vkGetDeviceGroupSurfacePresentModes2EXT vkGetDeviceGroupSurfacePresentModes2EXT; +#endif /* defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) */ +#if defined(VK_EXT_hdr_metadata) + PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT; +#endif /* defined(VK_EXT_hdr_metadata) */ +#if defined(VK_EXT_host_image_copy) + PFN_vkCopyImageToImageEXT vkCopyImageToImageEXT; + PFN_vkCopyImageToMemoryEXT vkCopyImageToMemoryEXT; + PFN_vkCopyMemoryToImageEXT vkCopyMemoryToImageEXT; + PFN_vkTransitionImageLayoutEXT vkTransitionImageLayoutEXT; +#endif /* defined(VK_EXT_host_image_copy) */ +#if defined(VK_EXT_host_query_reset) + PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT; +#endif /* defined(VK_EXT_host_query_reset) */ +#if defined(VK_EXT_image_drm_format_modifier) + PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT; +#endif /* defined(VK_EXT_image_drm_format_modifier) */ +#if defined(VK_EXT_line_rasterization) + PFN_vkCmdSetLineStippleEXT vkCmdSetLineStippleEXT; +#endif /* defined(VK_EXT_line_rasterization) */ +#if defined(VK_EXT_mesh_shader) + PFN_vkCmdDrawMeshTasksEXT vkCmdDrawMeshTasksEXT; + PFN_vkCmdDrawMeshTasksIndirectCountEXT vkCmdDrawMeshTasksIndirectCountEXT; + PFN_vkCmdDrawMeshTasksIndirectEXT vkCmdDrawMeshTasksIndirectEXT; +#endif /* defined(VK_EXT_mesh_shader) */ +#if defined(VK_EXT_metal_objects) + PFN_vkExportMetalObjectsEXT vkExportMetalObjectsEXT; +#endif /* defined(VK_EXT_metal_objects) */ +#if defined(VK_EXT_multi_draw) + PFN_vkCmdDrawMultiEXT vkCmdDrawMultiEXT; + PFN_vkCmdDrawMultiIndexedEXT vkCmdDrawMultiIndexedEXT; +#endif /* defined(VK_EXT_multi_draw) */ +#if defined(VK_EXT_opacity_micromap) + PFN_vkBuildMicromapsEXT vkBuildMicromapsEXT; + PFN_vkCmdBuildMicromapsEXT vkCmdBuildMicromapsEXT; + PFN_vkCmdCopyMemoryToMicromapEXT vkCmdCopyMemoryToMicromapEXT; + PFN_vkCmdCopyMicromapEXT vkCmdCopyMicromapEXT; + PFN_vkCmdCopyMicromapToMemoryEXT vkCmdCopyMicromapToMemoryEXT; + PFN_vkCmdWriteMicromapsPropertiesEXT vkCmdWriteMicromapsPropertiesEXT; + PFN_vkCopyMemoryToMicromapEXT vkCopyMemoryToMicromapEXT; + PFN_vkCopyMicromapEXT vkCopyMicromapEXT; + PFN_vkCopyMicromapToMemoryEXT vkCopyMicromapToMemoryEXT; + PFN_vkCreateMicromapEXT vkCreateMicromapEXT; + PFN_vkDestroyMicromapEXT vkDestroyMicromapEXT; + PFN_vkGetDeviceMicromapCompatibilityEXT vkGetDeviceMicromapCompatibilityEXT; + PFN_vkGetMicromapBuildSizesEXT vkGetMicromapBuildSizesEXT; + PFN_vkWriteMicromapsPropertiesEXT vkWriteMicromapsPropertiesEXT; +#endif /* defined(VK_EXT_opacity_micromap) */ +#if defined(VK_EXT_pageable_device_local_memory) + PFN_vkSetDeviceMemoryPriorityEXT vkSetDeviceMemoryPriorityEXT; +#endif /* defined(VK_EXT_pageable_device_local_memory) */ +#if defined(VK_EXT_pipeline_properties) + PFN_vkGetPipelinePropertiesEXT vkGetPipelinePropertiesEXT; +#endif /* defined(VK_EXT_pipeline_properties) */ +#if defined(VK_EXT_private_data) + PFN_vkCreatePrivateDataSlotEXT vkCreatePrivateDataSlotEXT; + PFN_vkDestroyPrivateDataSlotEXT vkDestroyPrivateDataSlotEXT; + PFN_vkGetPrivateDataEXT vkGetPrivateDataEXT; + PFN_vkSetPrivateDataEXT vkSetPrivateDataEXT; +#endif /* defined(VK_EXT_private_data) */ +#if defined(VK_EXT_sample_locations) + PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT; +#endif /* defined(VK_EXT_sample_locations) */ +#if defined(VK_EXT_shader_module_identifier) + PFN_vkGetShaderModuleCreateInfoIdentifierEXT vkGetShaderModuleCreateInfoIdentifierEXT; + PFN_vkGetShaderModuleIdentifierEXT vkGetShaderModuleIdentifierEXT; +#endif /* defined(VK_EXT_shader_module_identifier) */ +#if defined(VK_EXT_shader_object) + PFN_vkCmdBindShadersEXT vkCmdBindShadersEXT; + PFN_vkCreateShadersEXT vkCreateShadersEXT; + PFN_vkDestroyShaderEXT vkDestroyShaderEXT; + PFN_vkGetShaderBinaryDataEXT vkGetShaderBinaryDataEXT; +#endif /* defined(VK_EXT_shader_object) */ +#if defined(VK_EXT_swapchain_maintenance1) + PFN_vkReleaseSwapchainImagesEXT vkReleaseSwapchainImagesEXT; +#endif /* defined(VK_EXT_swapchain_maintenance1) */ +#if defined(VK_EXT_transform_feedback) + PFN_vkCmdBeginQueryIndexedEXT vkCmdBeginQueryIndexedEXT; + PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT; + PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT; + PFN_vkCmdDrawIndirectByteCountEXT vkCmdDrawIndirectByteCountEXT; + PFN_vkCmdEndQueryIndexedEXT vkCmdEndQueryIndexedEXT; + PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT; +#endif /* defined(VK_EXT_transform_feedback) */ +#if defined(VK_EXT_validation_cache) + PFN_vkCreateValidationCacheEXT vkCreateValidationCacheEXT; + PFN_vkDestroyValidationCacheEXT vkDestroyValidationCacheEXT; + PFN_vkGetValidationCacheDataEXT vkGetValidationCacheDataEXT; + PFN_vkMergeValidationCachesEXT vkMergeValidationCachesEXT; +#endif /* defined(VK_EXT_validation_cache) */ +#if defined(VK_FUCHSIA_buffer_collection) + PFN_vkCreateBufferCollectionFUCHSIA vkCreateBufferCollectionFUCHSIA; + PFN_vkDestroyBufferCollectionFUCHSIA vkDestroyBufferCollectionFUCHSIA; + PFN_vkGetBufferCollectionPropertiesFUCHSIA vkGetBufferCollectionPropertiesFUCHSIA; + PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA vkSetBufferCollectionBufferConstraintsFUCHSIA; + PFN_vkSetBufferCollectionImageConstraintsFUCHSIA vkSetBufferCollectionImageConstraintsFUCHSIA; +#endif /* defined(VK_FUCHSIA_buffer_collection) */ +#if defined(VK_FUCHSIA_external_memory) + PFN_vkGetMemoryZirconHandleFUCHSIA vkGetMemoryZirconHandleFUCHSIA; + PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA vkGetMemoryZirconHandlePropertiesFUCHSIA; +#endif /* defined(VK_FUCHSIA_external_memory) */ +#if defined(VK_FUCHSIA_external_semaphore) + PFN_vkGetSemaphoreZirconHandleFUCHSIA vkGetSemaphoreZirconHandleFUCHSIA; + PFN_vkImportSemaphoreZirconHandleFUCHSIA vkImportSemaphoreZirconHandleFUCHSIA; +#endif /* defined(VK_FUCHSIA_external_semaphore) */ +#if defined(VK_GOOGLE_display_timing) + PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE; + PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE; +#endif /* defined(VK_GOOGLE_display_timing) */ +#if defined(VK_HUAWEI_cluster_culling_shader) + PFN_vkCmdDrawClusterHUAWEI vkCmdDrawClusterHUAWEI; + PFN_vkCmdDrawClusterIndirectHUAWEI vkCmdDrawClusterIndirectHUAWEI; +#endif /* defined(VK_HUAWEI_cluster_culling_shader) */ +#if defined(VK_HUAWEI_invocation_mask) + PFN_vkCmdBindInvocationMaskHUAWEI vkCmdBindInvocationMaskHUAWEI; +#endif /* defined(VK_HUAWEI_invocation_mask) */ +#if defined(VK_HUAWEI_subpass_shading) + PFN_vkCmdSubpassShadingHUAWEI vkCmdSubpassShadingHUAWEI; + PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI; +#endif /* defined(VK_HUAWEI_subpass_shading) */ +#if defined(VK_INTEL_performance_query) + PFN_vkAcquirePerformanceConfigurationINTEL vkAcquirePerformanceConfigurationINTEL; + PFN_vkCmdSetPerformanceMarkerINTEL vkCmdSetPerformanceMarkerINTEL; + PFN_vkCmdSetPerformanceOverrideINTEL vkCmdSetPerformanceOverrideINTEL; + PFN_vkCmdSetPerformanceStreamMarkerINTEL vkCmdSetPerformanceStreamMarkerINTEL; + PFN_vkGetPerformanceParameterINTEL vkGetPerformanceParameterINTEL; + PFN_vkInitializePerformanceApiINTEL vkInitializePerformanceApiINTEL; + PFN_vkQueueSetPerformanceConfigurationINTEL vkQueueSetPerformanceConfigurationINTEL; + PFN_vkReleasePerformanceConfigurationINTEL vkReleasePerformanceConfigurationINTEL; + PFN_vkUninitializePerformanceApiINTEL vkUninitializePerformanceApiINTEL; +#endif /* defined(VK_INTEL_performance_query) */ +#if defined(VK_KHR_acceleration_structure) + PFN_vkBuildAccelerationStructuresKHR vkBuildAccelerationStructuresKHR; + PFN_vkCmdBuildAccelerationStructuresIndirectKHR vkCmdBuildAccelerationStructuresIndirectKHR; + PFN_vkCmdBuildAccelerationStructuresKHR vkCmdBuildAccelerationStructuresKHR; + PFN_vkCmdCopyAccelerationStructureKHR vkCmdCopyAccelerationStructureKHR; + PFN_vkCmdCopyAccelerationStructureToMemoryKHR vkCmdCopyAccelerationStructureToMemoryKHR; + PFN_vkCmdCopyMemoryToAccelerationStructureKHR vkCmdCopyMemoryToAccelerationStructureKHR; + PFN_vkCmdWriteAccelerationStructuresPropertiesKHR vkCmdWriteAccelerationStructuresPropertiesKHR; + PFN_vkCopyAccelerationStructureKHR vkCopyAccelerationStructureKHR; + PFN_vkCopyAccelerationStructureToMemoryKHR vkCopyAccelerationStructureToMemoryKHR; + PFN_vkCopyMemoryToAccelerationStructureKHR vkCopyMemoryToAccelerationStructureKHR; + PFN_vkCreateAccelerationStructureKHR vkCreateAccelerationStructureKHR; + PFN_vkDestroyAccelerationStructureKHR vkDestroyAccelerationStructureKHR; + PFN_vkGetAccelerationStructureBuildSizesKHR vkGetAccelerationStructureBuildSizesKHR; + PFN_vkGetAccelerationStructureDeviceAddressKHR vkGetAccelerationStructureDeviceAddressKHR; + PFN_vkGetDeviceAccelerationStructureCompatibilityKHR vkGetDeviceAccelerationStructureCompatibilityKHR; + PFN_vkWriteAccelerationStructuresPropertiesKHR vkWriteAccelerationStructuresPropertiesKHR; +#endif /* defined(VK_KHR_acceleration_structure) */ +#if defined(VK_KHR_bind_memory2) + PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR; + PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR; +#endif /* defined(VK_KHR_bind_memory2) */ +#if defined(VK_KHR_buffer_device_address) + PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR; + PFN_vkGetBufferOpaqueCaptureAddressKHR vkGetBufferOpaqueCaptureAddressKHR; + PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR vkGetDeviceMemoryOpaqueCaptureAddressKHR; +#endif /* defined(VK_KHR_buffer_device_address) */ +#if defined(VK_KHR_calibrated_timestamps) + PFN_vkGetCalibratedTimestampsKHR vkGetCalibratedTimestampsKHR; +#endif /* defined(VK_KHR_calibrated_timestamps) */ +#if defined(VK_KHR_copy_commands2) + PFN_vkCmdBlitImage2KHR vkCmdBlitImage2KHR; + PFN_vkCmdCopyBuffer2KHR vkCmdCopyBuffer2KHR; + PFN_vkCmdCopyBufferToImage2KHR vkCmdCopyBufferToImage2KHR; + PFN_vkCmdCopyImage2KHR vkCmdCopyImage2KHR; + PFN_vkCmdCopyImageToBuffer2KHR vkCmdCopyImageToBuffer2KHR; + PFN_vkCmdResolveImage2KHR vkCmdResolveImage2KHR; +#endif /* defined(VK_KHR_copy_commands2) */ +#if defined(VK_KHR_create_renderpass2) + PFN_vkCmdBeginRenderPass2KHR vkCmdBeginRenderPass2KHR; + PFN_vkCmdEndRenderPass2KHR vkCmdEndRenderPass2KHR; + PFN_vkCmdNextSubpass2KHR vkCmdNextSubpass2KHR; + PFN_vkCreateRenderPass2KHR vkCreateRenderPass2KHR; +#endif /* defined(VK_KHR_create_renderpass2) */ +#if defined(VK_KHR_deferred_host_operations) + PFN_vkCreateDeferredOperationKHR vkCreateDeferredOperationKHR; + PFN_vkDeferredOperationJoinKHR vkDeferredOperationJoinKHR; + PFN_vkDestroyDeferredOperationKHR vkDestroyDeferredOperationKHR; + PFN_vkGetDeferredOperationMaxConcurrencyKHR vkGetDeferredOperationMaxConcurrencyKHR; + PFN_vkGetDeferredOperationResultKHR vkGetDeferredOperationResultKHR; +#endif /* defined(VK_KHR_deferred_host_operations) */ +#if defined(VK_KHR_descriptor_update_template) + PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR; + PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR; + PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR; +#endif /* defined(VK_KHR_descriptor_update_template) */ +#if defined(VK_KHR_device_group) + PFN_vkCmdDispatchBaseKHR vkCmdDispatchBaseKHR; + PFN_vkCmdSetDeviceMaskKHR vkCmdSetDeviceMaskKHR; + PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR vkGetDeviceGroupPeerMemoryFeaturesKHR; +#endif /* defined(VK_KHR_device_group) */ +#if defined(VK_KHR_display_swapchain) + PFN_vkCreateSharedSwapchainsKHR vkCreateSharedSwapchainsKHR; +#endif /* defined(VK_KHR_display_swapchain) */ +#if defined(VK_KHR_draw_indirect_count) + PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR; + PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR; +#endif /* defined(VK_KHR_draw_indirect_count) */ +#if defined(VK_KHR_dynamic_rendering) + PFN_vkCmdBeginRenderingKHR vkCmdBeginRenderingKHR; + PFN_vkCmdEndRenderingKHR vkCmdEndRenderingKHR; +#endif /* defined(VK_KHR_dynamic_rendering) */ +#if defined(VK_KHR_dynamic_rendering_local_read) + PFN_vkCmdSetRenderingAttachmentLocationsKHR vkCmdSetRenderingAttachmentLocationsKHR; + PFN_vkCmdSetRenderingInputAttachmentIndicesKHR vkCmdSetRenderingInputAttachmentIndicesKHR; +#endif /* defined(VK_KHR_dynamic_rendering_local_read) */ +#if defined(VK_KHR_external_fence_fd) + PFN_vkGetFenceFdKHR vkGetFenceFdKHR; + PFN_vkImportFenceFdKHR vkImportFenceFdKHR; +#endif /* defined(VK_KHR_external_fence_fd) */ +#if defined(VK_KHR_external_fence_win32) + PFN_vkGetFenceWin32HandleKHR vkGetFenceWin32HandleKHR; + PFN_vkImportFenceWin32HandleKHR vkImportFenceWin32HandleKHR; +#endif /* defined(VK_KHR_external_fence_win32) */ +#if defined(VK_KHR_external_memory_fd) + PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR; + PFN_vkGetMemoryFdPropertiesKHR vkGetMemoryFdPropertiesKHR; +#endif /* defined(VK_KHR_external_memory_fd) */ +#if defined(VK_KHR_external_memory_win32) + PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR; + PFN_vkGetMemoryWin32HandlePropertiesKHR vkGetMemoryWin32HandlePropertiesKHR; +#endif /* defined(VK_KHR_external_memory_win32) */ +#if defined(VK_KHR_external_semaphore_fd) + PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR; + PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR; +#endif /* defined(VK_KHR_external_semaphore_fd) */ +#if defined(VK_KHR_external_semaphore_win32) + PFN_vkGetSemaphoreWin32HandleKHR vkGetSemaphoreWin32HandleKHR; + PFN_vkImportSemaphoreWin32HandleKHR vkImportSemaphoreWin32HandleKHR; +#endif /* defined(VK_KHR_external_semaphore_win32) */ +#if defined(VK_KHR_fragment_shading_rate) + PFN_vkCmdSetFragmentShadingRateKHR vkCmdSetFragmentShadingRateKHR; +#endif /* defined(VK_KHR_fragment_shading_rate) */ +#if defined(VK_KHR_get_memory_requirements2) + PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR; + PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR; + PFN_vkGetImageSparseMemoryRequirements2KHR vkGetImageSparseMemoryRequirements2KHR; +#endif /* defined(VK_KHR_get_memory_requirements2) */ +#if defined(VK_KHR_line_rasterization) + PFN_vkCmdSetLineStippleKHR vkCmdSetLineStippleKHR; +#endif /* defined(VK_KHR_line_rasterization) */ +#if defined(VK_KHR_maintenance1) + PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR; +#endif /* defined(VK_KHR_maintenance1) */ +#if defined(VK_KHR_maintenance3) + PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR; +#endif /* defined(VK_KHR_maintenance3) */ +#if defined(VK_KHR_maintenance4) + PFN_vkGetDeviceBufferMemoryRequirementsKHR vkGetDeviceBufferMemoryRequirementsKHR; + PFN_vkGetDeviceImageMemoryRequirementsKHR vkGetDeviceImageMemoryRequirementsKHR; + PFN_vkGetDeviceImageSparseMemoryRequirementsKHR vkGetDeviceImageSparseMemoryRequirementsKHR; +#endif /* defined(VK_KHR_maintenance4) */ +#if defined(VK_KHR_maintenance5) + PFN_vkCmdBindIndexBuffer2KHR vkCmdBindIndexBuffer2KHR; + PFN_vkGetDeviceImageSubresourceLayoutKHR vkGetDeviceImageSubresourceLayoutKHR; + PFN_vkGetImageSubresourceLayout2KHR vkGetImageSubresourceLayout2KHR; + PFN_vkGetRenderingAreaGranularityKHR vkGetRenderingAreaGranularityKHR; +#endif /* defined(VK_KHR_maintenance5) */ +#if defined(VK_KHR_maintenance6) + PFN_vkCmdBindDescriptorSets2KHR vkCmdBindDescriptorSets2KHR; + PFN_vkCmdPushConstants2KHR vkCmdPushConstants2KHR; +#endif /* defined(VK_KHR_maintenance6) */ +#if defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) + PFN_vkCmdPushDescriptorSet2KHR vkCmdPushDescriptorSet2KHR; + PFN_vkCmdPushDescriptorSetWithTemplate2KHR vkCmdPushDescriptorSetWithTemplate2KHR; +#endif /* defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) + PFN_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT vkCmdBindDescriptorBufferEmbeddedSamplers2EXT; + PFN_vkCmdSetDescriptorBufferOffsets2EXT vkCmdSetDescriptorBufferOffsets2EXT; +#endif /* defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_KHR_map_memory2) + PFN_vkMapMemory2KHR vkMapMemory2KHR; + PFN_vkUnmapMemory2KHR vkUnmapMemory2KHR; +#endif /* defined(VK_KHR_map_memory2) */ +#if defined(VK_KHR_performance_query) + PFN_vkAcquireProfilingLockKHR vkAcquireProfilingLockKHR; + PFN_vkReleaseProfilingLockKHR vkReleaseProfilingLockKHR; +#endif /* defined(VK_KHR_performance_query) */ +#if defined(VK_KHR_pipeline_executable_properties) + PFN_vkGetPipelineExecutableInternalRepresentationsKHR vkGetPipelineExecutableInternalRepresentationsKHR; + PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR; + PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR; +#endif /* defined(VK_KHR_pipeline_executable_properties) */ +#if defined(VK_KHR_present_wait) + PFN_vkWaitForPresentKHR vkWaitForPresentKHR; +#endif /* defined(VK_KHR_present_wait) */ +#if defined(VK_KHR_push_descriptor) + PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR; +#endif /* defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) + PFN_vkCmdTraceRaysIndirect2KHR vkCmdTraceRaysIndirect2KHR; +#endif /* defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_ray_tracing_pipeline) + PFN_vkCmdSetRayTracingPipelineStackSizeKHR vkCmdSetRayTracingPipelineStackSizeKHR; + PFN_vkCmdTraceRaysIndirectKHR vkCmdTraceRaysIndirectKHR; + PFN_vkCmdTraceRaysKHR vkCmdTraceRaysKHR; + PFN_vkCreateRayTracingPipelinesKHR vkCreateRayTracingPipelinesKHR; + PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR vkGetRayTracingCaptureReplayShaderGroupHandlesKHR; + PFN_vkGetRayTracingShaderGroupHandlesKHR vkGetRayTracingShaderGroupHandlesKHR; + PFN_vkGetRayTracingShaderGroupStackSizeKHR vkGetRayTracingShaderGroupStackSizeKHR; +#endif /* defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_sampler_ycbcr_conversion) + PFN_vkCreateSamplerYcbcrConversionKHR vkCreateSamplerYcbcrConversionKHR; + PFN_vkDestroySamplerYcbcrConversionKHR vkDestroySamplerYcbcrConversionKHR; +#endif /* defined(VK_KHR_sampler_ycbcr_conversion) */ +#if defined(VK_KHR_shared_presentable_image) + PFN_vkGetSwapchainStatusKHR vkGetSwapchainStatusKHR; +#endif /* defined(VK_KHR_shared_presentable_image) */ +#if defined(VK_KHR_swapchain) + PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR; + PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR; + PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR; + PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR; + PFN_vkQueuePresentKHR vkQueuePresentKHR; +#endif /* defined(VK_KHR_swapchain) */ +#if defined(VK_KHR_synchronization2) + PFN_vkCmdPipelineBarrier2KHR vkCmdPipelineBarrier2KHR; + PFN_vkCmdResetEvent2KHR vkCmdResetEvent2KHR; + PFN_vkCmdSetEvent2KHR vkCmdSetEvent2KHR; + PFN_vkCmdWaitEvents2KHR vkCmdWaitEvents2KHR; + PFN_vkCmdWriteTimestamp2KHR vkCmdWriteTimestamp2KHR; + PFN_vkQueueSubmit2KHR vkQueueSubmit2KHR; +#endif /* defined(VK_KHR_synchronization2) */ +#if defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) + PFN_vkCmdWriteBufferMarker2AMD vkCmdWriteBufferMarker2AMD; +#endif /* defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) */ +#if defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) + PFN_vkGetQueueCheckpointData2NV vkGetQueueCheckpointData2NV; +#endif /* defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_KHR_timeline_semaphore) + PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValueKHR; + PFN_vkSignalSemaphoreKHR vkSignalSemaphoreKHR; + PFN_vkWaitSemaphoresKHR vkWaitSemaphoresKHR; +#endif /* defined(VK_KHR_timeline_semaphore) */ +#if defined(VK_KHR_video_decode_queue) + PFN_vkCmdDecodeVideoKHR vkCmdDecodeVideoKHR; +#endif /* defined(VK_KHR_video_decode_queue) */ +#if defined(VK_KHR_video_encode_queue) + PFN_vkCmdEncodeVideoKHR vkCmdEncodeVideoKHR; + PFN_vkGetEncodedVideoSessionParametersKHR vkGetEncodedVideoSessionParametersKHR; +#endif /* defined(VK_KHR_video_encode_queue) */ +#if defined(VK_KHR_video_queue) + PFN_vkBindVideoSessionMemoryKHR vkBindVideoSessionMemoryKHR; + PFN_vkCmdBeginVideoCodingKHR vkCmdBeginVideoCodingKHR; + PFN_vkCmdControlVideoCodingKHR vkCmdControlVideoCodingKHR; + PFN_vkCmdEndVideoCodingKHR vkCmdEndVideoCodingKHR; + PFN_vkCreateVideoSessionKHR vkCreateVideoSessionKHR; + PFN_vkCreateVideoSessionParametersKHR vkCreateVideoSessionParametersKHR; + PFN_vkDestroyVideoSessionKHR vkDestroyVideoSessionKHR; + PFN_vkDestroyVideoSessionParametersKHR vkDestroyVideoSessionParametersKHR; + PFN_vkGetVideoSessionMemoryRequirementsKHR vkGetVideoSessionMemoryRequirementsKHR; + PFN_vkUpdateVideoSessionParametersKHR vkUpdateVideoSessionParametersKHR; +#endif /* defined(VK_KHR_video_queue) */ +#if defined(VK_NVX_binary_import) + PFN_vkCmdCuLaunchKernelNVX vkCmdCuLaunchKernelNVX; + PFN_vkCreateCuFunctionNVX vkCreateCuFunctionNVX; + PFN_vkCreateCuModuleNVX vkCreateCuModuleNVX; + PFN_vkDestroyCuFunctionNVX vkDestroyCuFunctionNVX; + PFN_vkDestroyCuModuleNVX vkDestroyCuModuleNVX; +#endif /* defined(VK_NVX_binary_import) */ +#if defined(VK_NVX_image_view_handle) + PFN_vkGetImageViewAddressNVX vkGetImageViewAddressNVX; + PFN_vkGetImageViewHandleNVX vkGetImageViewHandleNVX; +#endif /* defined(VK_NVX_image_view_handle) */ +#if defined(VK_NV_clip_space_w_scaling) + PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV; +#endif /* defined(VK_NV_clip_space_w_scaling) */ +#if defined(VK_NV_copy_memory_indirect) + PFN_vkCmdCopyMemoryIndirectNV vkCmdCopyMemoryIndirectNV; + PFN_vkCmdCopyMemoryToImageIndirectNV vkCmdCopyMemoryToImageIndirectNV; +#endif /* defined(VK_NV_copy_memory_indirect) */ +#if defined(VK_NV_cuda_kernel_launch) + PFN_vkCmdCudaLaunchKernelNV vkCmdCudaLaunchKernelNV; + PFN_vkCreateCudaFunctionNV vkCreateCudaFunctionNV; + PFN_vkCreateCudaModuleNV vkCreateCudaModuleNV; + PFN_vkDestroyCudaFunctionNV vkDestroyCudaFunctionNV; + PFN_vkDestroyCudaModuleNV vkDestroyCudaModuleNV; + PFN_vkGetCudaModuleCacheNV vkGetCudaModuleCacheNV; +#endif /* defined(VK_NV_cuda_kernel_launch) */ +#if defined(VK_NV_device_diagnostic_checkpoints) + PFN_vkCmdSetCheckpointNV vkCmdSetCheckpointNV; + PFN_vkGetQueueCheckpointDataNV vkGetQueueCheckpointDataNV; +#endif /* defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_NV_device_generated_commands) + PFN_vkCmdBindPipelineShaderGroupNV vkCmdBindPipelineShaderGroupNV; + PFN_vkCmdExecuteGeneratedCommandsNV vkCmdExecuteGeneratedCommandsNV; + PFN_vkCmdPreprocessGeneratedCommandsNV vkCmdPreprocessGeneratedCommandsNV; + PFN_vkCreateIndirectCommandsLayoutNV vkCreateIndirectCommandsLayoutNV; + PFN_vkDestroyIndirectCommandsLayoutNV vkDestroyIndirectCommandsLayoutNV; + PFN_vkGetGeneratedCommandsMemoryRequirementsNV vkGetGeneratedCommandsMemoryRequirementsNV; +#endif /* defined(VK_NV_device_generated_commands) */ +#if defined(VK_NV_device_generated_commands_compute) + PFN_vkCmdUpdatePipelineIndirectBufferNV vkCmdUpdatePipelineIndirectBufferNV; + PFN_vkGetPipelineIndirectDeviceAddressNV vkGetPipelineIndirectDeviceAddressNV; + PFN_vkGetPipelineIndirectMemoryRequirementsNV vkGetPipelineIndirectMemoryRequirementsNV; +#endif /* defined(VK_NV_device_generated_commands_compute) */ +#if defined(VK_NV_external_memory_rdma) + PFN_vkGetMemoryRemoteAddressNV vkGetMemoryRemoteAddressNV; +#endif /* defined(VK_NV_external_memory_rdma) */ +#if defined(VK_NV_external_memory_win32) + PFN_vkGetMemoryWin32HandleNV vkGetMemoryWin32HandleNV; +#endif /* defined(VK_NV_external_memory_win32) */ +#if defined(VK_NV_fragment_shading_rate_enums) + PFN_vkCmdSetFragmentShadingRateEnumNV vkCmdSetFragmentShadingRateEnumNV; +#endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) + PFN_vkGetLatencyTimingsNV vkGetLatencyTimingsNV; + PFN_vkLatencySleepNV vkLatencySleepNV; + PFN_vkQueueNotifyOutOfBandNV vkQueueNotifyOutOfBandNV; + PFN_vkSetLatencyMarkerNV vkSetLatencyMarkerNV; + PFN_vkSetLatencySleepModeNV vkSetLatencySleepModeNV; +#endif /* defined(VK_NV_low_latency2) */ +#if defined(VK_NV_memory_decompression) + PFN_vkCmdDecompressMemoryIndirectCountNV vkCmdDecompressMemoryIndirectCountNV; + PFN_vkCmdDecompressMemoryNV vkCmdDecompressMemoryNV; +#endif /* defined(VK_NV_memory_decompression) */ +#if defined(VK_NV_mesh_shader) + PFN_vkCmdDrawMeshTasksIndirectCountNV vkCmdDrawMeshTasksIndirectCountNV; + PFN_vkCmdDrawMeshTasksIndirectNV vkCmdDrawMeshTasksIndirectNV; + PFN_vkCmdDrawMeshTasksNV vkCmdDrawMeshTasksNV; +#endif /* defined(VK_NV_mesh_shader) */ +#if defined(VK_NV_optical_flow) + PFN_vkBindOpticalFlowSessionImageNV vkBindOpticalFlowSessionImageNV; + PFN_vkCmdOpticalFlowExecuteNV vkCmdOpticalFlowExecuteNV; + PFN_vkCreateOpticalFlowSessionNV vkCreateOpticalFlowSessionNV; + PFN_vkDestroyOpticalFlowSessionNV vkDestroyOpticalFlowSessionNV; +#endif /* defined(VK_NV_optical_flow) */ +#if defined(VK_NV_ray_tracing) + PFN_vkBindAccelerationStructureMemoryNV vkBindAccelerationStructureMemoryNV; + PFN_vkCmdBuildAccelerationStructureNV vkCmdBuildAccelerationStructureNV; + PFN_vkCmdCopyAccelerationStructureNV vkCmdCopyAccelerationStructureNV; + PFN_vkCmdTraceRaysNV vkCmdTraceRaysNV; + PFN_vkCmdWriteAccelerationStructuresPropertiesNV vkCmdWriteAccelerationStructuresPropertiesNV; + PFN_vkCompileDeferredNV vkCompileDeferredNV; + PFN_vkCreateAccelerationStructureNV vkCreateAccelerationStructureNV; + PFN_vkCreateRayTracingPipelinesNV vkCreateRayTracingPipelinesNV; + PFN_vkDestroyAccelerationStructureNV vkDestroyAccelerationStructureNV; + PFN_vkGetAccelerationStructureHandleNV vkGetAccelerationStructureHandleNV; + PFN_vkGetAccelerationStructureMemoryRequirementsNV vkGetAccelerationStructureMemoryRequirementsNV; + PFN_vkGetRayTracingShaderGroupHandlesNV vkGetRayTracingShaderGroupHandlesNV; +#endif /* defined(VK_NV_ray_tracing) */ +#if defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 + PFN_vkCmdSetExclusiveScissorEnableNV vkCmdSetExclusiveScissorEnableNV; +#endif /* defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 */ +#if defined(VK_NV_scissor_exclusive) + PFN_vkCmdSetExclusiveScissorNV vkCmdSetExclusiveScissorNV; +#endif /* defined(VK_NV_scissor_exclusive) */ +#if defined(VK_NV_shading_rate_image) + PFN_vkCmdBindShadingRateImageNV vkCmdBindShadingRateImageNV; + PFN_vkCmdSetCoarseSampleOrderNV vkCmdSetCoarseSampleOrderNV; + PFN_vkCmdSetViewportShadingRatePaletteNV vkCmdSetViewportShadingRatePaletteNV; +#endif /* defined(VK_NV_shading_rate_image) */ +#if defined(VK_QCOM_tile_properties) + PFN_vkGetDynamicRenderingTilePropertiesQCOM vkGetDynamicRenderingTilePropertiesQCOM; + PFN_vkGetFramebufferTilePropertiesQCOM vkGetFramebufferTilePropertiesQCOM; +#endif /* defined(VK_QCOM_tile_properties) */ +#if defined(VK_QNX_external_memory_screen_buffer) + PFN_vkGetScreenBufferPropertiesQNX vkGetScreenBufferPropertiesQNX; +#endif /* defined(VK_QNX_external_memory_screen_buffer) */ +#if defined(VK_VALVE_descriptor_set_host_mapping) + PFN_vkGetDescriptorSetHostMappingVALVE vkGetDescriptorSetHostMappingVALVE; + PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE vkGetDescriptorSetLayoutHostMappingInfoVALVE; +#endif /* defined(VK_VALVE_descriptor_set_host_mapping) */ +#if (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) + PFN_vkCmdBindVertexBuffers2EXT vkCmdBindVertexBuffers2EXT; + PFN_vkCmdSetCullModeEXT vkCmdSetCullModeEXT; + PFN_vkCmdSetDepthBoundsTestEnableEXT vkCmdSetDepthBoundsTestEnableEXT; + PFN_vkCmdSetDepthCompareOpEXT vkCmdSetDepthCompareOpEXT; + PFN_vkCmdSetDepthTestEnableEXT vkCmdSetDepthTestEnableEXT; + PFN_vkCmdSetDepthWriteEnableEXT vkCmdSetDepthWriteEnableEXT; + PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT; + PFN_vkCmdSetPrimitiveTopologyEXT vkCmdSetPrimitiveTopologyEXT; + PFN_vkCmdSetScissorWithCountEXT vkCmdSetScissorWithCountEXT; + PFN_vkCmdSetStencilOpEXT vkCmdSetStencilOpEXT; + PFN_vkCmdSetStencilTestEnableEXT vkCmdSetStencilTestEnableEXT; + PFN_vkCmdSetViewportWithCountEXT vkCmdSetViewportWithCountEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) + PFN_vkCmdSetDepthBiasEnableEXT vkCmdSetDepthBiasEnableEXT; + PFN_vkCmdSetLogicOpEXT vkCmdSetLogicOpEXT; + PFN_vkCmdSetPatchControlPointsEXT vkCmdSetPatchControlPointsEXT; + PFN_vkCmdSetPrimitiveRestartEnableEXT vkCmdSetPrimitiveRestartEnableEXT; + PFN_vkCmdSetRasterizerDiscardEnableEXT vkCmdSetRasterizerDiscardEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) + PFN_vkCmdSetAlphaToCoverageEnableEXT vkCmdSetAlphaToCoverageEnableEXT; + PFN_vkCmdSetAlphaToOneEnableEXT vkCmdSetAlphaToOneEnableEXT; + PFN_vkCmdSetColorBlendEnableEXT vkCmdSetColorBlendEnableEXT; + PFN_vkCmdSetColorBlendEquationEXT vkCmdSetColorBlendEquationEXT; + PFN_vkCmdSetColorWriteMaskEXT vkCmdSetColorWriteMaskEXT; + PFN_vkCmdSetDepthClampEnableEXT vkCmdSetDepthClampEnableEXT; + PFN_vkCmdSetLogicOpEnableEXT vkCmdSetLogicOpEnableEXT; + PFN_vkCmdSetPolygonModeEXT vkCmdSetPolygonModeEXT; + PFN_vkCmdSetRasterizationSamplesEXT vkCmdSetRasterizationSamplesEXT; + PFN_vkCmdSetSampleMaskEXT vkCmdSetSampleMaskEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) + PFN_vkCmdSetTessellationDomainOriginEXT vkCmdSetTessellationDomainOriginEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) + PFN_vkCmdSetRasterizationStreamEXT vkCmdSetRasterizationStreamEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) + PFN_vkCmdSetConservativeRasterizationModeEXT vkCmdSetConservativeRasterizationModeEXT; + PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT vkCmdSetExtraPrimitiveOverestimationSizeEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) + PFN_vkCmdSetDepthClipEnableEXT vkCmdSetDepthClipEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) + PFN_vkCmdSetSampleLocationsEnableEXT vkCmdSetSampleLocationsEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) + PFN_vkCmdSetColorBlendAdvancedEXT vkCmdSetColorBlendAdvancedEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) + PFN_vkCmdSetProvokingVertexModeEXT vkCmdSetProvokingVertexModeEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) + PFN_vkCmdSetLineRasterizationModeEXT vkCmdSetLineRasterizationModeEXT; + PFN_vkCmdSetLineStippleEnableEXT vkCmdSetLineStippleEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) + PFN_vkCmdSetDepthClipNegativeOneToOneEXT vkCmdSetDepthClipNegativeOneToOneEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) + PFN_vkCmdSetViewportWScalingEnableNV vkCmdSetViewportWScalingEnableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) + PFN_vkCmdSetViewportSwizzleNV vkCmdSetViewportSwizzleNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) + PFN_vkCmdSetCoverageToColorEnableNV vkCmdSetCoverageToColorEnableNV; + PFN_vkCmdSetCoverageToColorLocationNV vkCmdSetCoverageToColorLocationNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) + PFN_vkCmdSetCoverageModulationModeNV vkCmdSetCoverageModulationModeNV; + PFN_vkCmdSetCoverageModulationTableEnableNV vkCmdSetCoverageModulationTableEnableNV; + PFN_vkCmdSetCoverageModulationTableNV vkCmdSetCoverageModulationTableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) + PFN_vkCmdSetShadingRateImageEnableNV vkCmdSetShadingRateImageEnableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) + PFN_vkCmdSetRepresentativeFragmentTestEnableNV vkCmdSetRepresentativeFragmentTestEnableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) + PFN_vkCmdSetCoverageReductionModeNV vkCmdSetCoverageReductionModeNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) */ +#if (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) + PFN_vkGetImageSubresourceLayout2EXT vkGetImageSubresourceLayout2EXT; +#endif /* (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) */ +#if (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) + PFN_vkCmdSetVertexInputEXT vkCmdSetVertexInputEXT; +#endif /* (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) */ +#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) + PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR; +#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) + PFN_vkGetDeviceGroupPresentCapabilitiesKHR vkGetDeviceGroupPresentCapabilitiesKHR; + PFN_vkGetDeviceGroupSurfacePresentModesKHR vkGetDeviceGroupSurfacePresentModesKHR; +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) + PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR; +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ + /* VOLK_GENERATE_DEVICE_TABLE */ +}; + +/* VOLK_GENERATE_PROTOTYPES_H */ +#if defined(VK_VERSION_1_0) +extern PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers; +extern PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets; +extern PFN_vkAllocateMemory vkAllocateMemory; +extern PFN_vkBeginCommandBuffer vkBeginCommandBuffer; +extern PFN_vkBindBufferMemory vkBindBufferMemory; +extern PFN_vkBindImageMemory vkBindImageMemory; +extern PFN_vkCmdBeginQuery vkCmdBeginQuery; +extern PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass; +extern PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets; +extern PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer; +extern PFN_vkCmdBindPipeline vkCmdBindPipeline; +extern PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers; +extern PFN_vkCmdBlitImage vkCmdBlitImage; +extern PFN_vkCmdClearAttachments vkCmdClearAttachments; +extern PFN_vkCmdClearColorImage vkCmdClearColorImage; +extern PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage; +extern PFN_vkCmdCopyBuffer vkCmdCopyBuffer; +extern PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage; +extern PFN_vkCmdCopyImage vkCmdCopyImage; +extern PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer; +extern PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults; +extern PFN_vkCmdDispatch vkCmdDispatch; +extern PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect; +extern PFN_vkCmdDraw vkCmdDraw; +extern PFN_vkCmdDrawIndexed vkCmdDrawIndexed; +extern PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect; +extern PFN_vkCmdDrawIndirect vkCmdDrawIndirect; +extern PFN_vkCmdEndQuery vkCmdEndQuery; +extern PFN_vkCmdEndRenderPass vkCmdEndRenderPass; +extern PFN_vkCmdExecuteCommands vkCmdExecuteCommands; +extern PFN_vkCmdFillBuffer vkCmdFillBuffer; +extern PFN_vkCmdNextSubpass vkCmdNextSubpass; +extern PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier; +extern PFN_vkCmdPushConstants vkCmdPushConstants; +extern PFN_vkCmdResetEvent vkCmdResetEvent; +extern PFN_vkCmdResetQueryPool vkCmdResetQueryPool; +extern PFN_vkCmdResolveImage vkCmdResolveImage; +extern PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants; +extern PFN_vkCmdSetDepthBias vkCmdSetDepthBias; +extern PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds; +extern PFN_vkCmdSetEvent vkCmdSetEvent; +extern PFN_vkCmdSetLineWidth vkCmdSetLineWidth; +extern PFN_vkCmdSetScissor vkCmdSetScissor; +extern PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask; +extern PFN_vkCmdSetStencilReference vkCmdSetStencilReference; +extern PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask; +extern PFN_vkCmdSetViewport vkCmdSetViewport; +extern PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer; +extern PFN_vkCmdWaitEvents vkCmdWaitEvents; +extern PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp; +extern PFN_vkCreateBuffer vkCreateBuffer; +extern PFN_vkCreateBufferView vkCreateBufferView; +extern PFN_vkCreateCommandPool vkCreateCommandPool; +extern PFN_vkCreateComputePipelines vkCreateComputePipelines; +extern PFN_vkCreateDescriptorPool vkCreateDescriptorPool; +extern PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout; +extern PFN_vkCreateDevice vkCreateDevice; +extern PFN_vkCreateEvent vkCreateEvent; +extern PFN_vkCreateFence vkCreateFence; +extern PFN_vkCreateFramebuffer vkCreateFramebuffer; +extern PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines; +extern PFN_vkCreateImage vkCreateImage; +extern PFN_vkCreateImageView vkCreateImageView; +extern PFN_vkCreateInstance vkCreateInstance; +extern PFN_vkCreatePipelineCache vkCreatePipelineCache; +extern PFN_vkCreatePipelineLayout vkCreatePipelineLayout; +extern PFN_vkCreateQueryPool vkCreateQueryPool; +extern PFN_vkCreateRenderPass vkCreateRenderPass; +extern PFN_vkCreateSampler vkCreateSampler; +extern PFN_vkCreateSemaphore vkCreateSemaphore; +extern PFN_vkCreateShaderModule vkCreateShaderModule; +extern PFN_vkDestroyBuffer vkDestroyBuffer; +extern PFN_vkDestroyBufferView vkDestroyBufferView; +extern PFN_vkDestroyCommandPool vkDestroyCommandPool; +extern PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool; +extern PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout; +extern PFN_vkDestroyDevice vkDestroyDevice; +extern PFN_vkDestroyEvent vkDestroyEvent; +extern PFN_vkDestroyFence vkDestroyFence; +extern PFN_vkDestroyFramebuffer vkDestroyFramebuffer; +extern PFN_vkDestroyImage vkDestroyImage; +extern PFN_vkDestroyImageView vkDestroyImageView; +extern PFN_vkDestroyInstance vkDestroyInstance; +extern PFN_vkDestroyPipeline vkDestroyPipeline; +extern PFN_vkDestroyPipelineCache vkDestroyPipelineCache; +extern PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout; +extern PFN_vkDestroyQueryPool vkDestroyQueryPool; +extern PFN_vkDestroyRenderPass vkDestroyRenderPass; +extern PFN_vkDestroySampler vkDestroySampler; +extern PFN_vkDestroySemaphore vkDestroySemaphore; +extern PFN_vkDestroyShaderModule vkDestroyShaderModule; +extern PFN_vkDeviceWaitIdle vkDeviceWaitIdle; +extern PFN_vkEndCommandBuffer vkEndCommandBuffer; +extern PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties; +extern PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties; +extern PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties; +extern PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties; +extern PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices; +extern PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges; +extern PFN_vkFreeCommandBuffers vkFreeCommandBuffers; +extern PFN_vkFreeDescriptorSets vkFreeDescriptorSets; +extern PFN_vkFreeMemory vkFreeMemory; +extern PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements; +extern PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment; +extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr; +extern PFN_vkGetDeviceQueue vkGetDeviceQueue; +extern PFN_vkGetEventStatus vkGetEventStatus; +extern PFN_vkGetFenceStatus vkGetFenceStatus; +extern PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements; +extern PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements; +extern PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout; +extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; +extern PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures; +extern PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; +extern PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties; +extern PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties; +extern PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties; +extern PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties; +extern PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties; +extern PFN_vkGetPipelineCacheData vkGetPipelineCacheData; +extern PFN_vkGetQueryPoolResults vkGetQueryPoolResults; +extern PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity; +extern PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges; +extern PFN_vkMapMemory vkMapMemory; +extern PFN_vkMergePipelineCaches vkMergePipelineCaches; +extern PFN_vkQueueBindSparse vkQueueBindSparse; +extern PFN_vkQueueSubmit vkQueueSubmit; +extern PFN_vkQueueWaitIdle vkQueueWaitIdle; +extern PFN_vkResetCommandBuffer vkResetCommandBuffer; +extern PFN_vkResetCommandPool vkResetCommandPool; +extern PFN_vkResetDescriptorPool vkResetDescriptorPool; +extern PFN_vkResetEvent vkResetEvent; +extern PFN_vkResetFences vkResetFences; +extern PFN_vkSetEvent vkSetEvent; +extern PFN_vkUnmapMemory vkUnmapMemory; +extern PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets; +extern PFN_vkWaitForFences vkWaitForFences; +#endif /* defined(VK_VERSION_1_0) */ +#if defined(VK_VERSION_1_1) +extern PFN_vkBindBufferMemory2 vkBindBufferMemory2; +extern PFN_vkBindImageMemory2 vkBindImageMemory2; +extern PFN_vkCmdDispatchBase vkCmdDispatchBase; +extern PFN_vkCmdSetDeviceMask vkCmdSetDeviceMask; +extern PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate; +extern PFN_vkCreateSamplerYcbcrConversion vkCreateSamplerYcbcrConversion; +extern PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate; +extern PFN_vkDestroySamplerYcbcrConversion vkDestroySamplerYcbcrConversion; +extern PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion; +extern PFN_vkEnumeratePhysicalDeviceGroups vkEnumeratePhysicalDeviceGroups; +extern PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2; +extern PFN_vkGetDescriptorSetLayoutSupport vkGetDescriptorSetLayoutSupport; +extern PFN_vkGetDeviceGroupPeerMemoryFeatures vkGetDeviceGroupPeerMemoryFeatures; +extern PFN_vkGetDeviceQueue2 vkGetDeviceQueue2; +extern PFN_vkGetImageMemoryRequirements2 vkGetImageMemoryRequirements2; +extern PFN_vkGetImageSparseMemoryRequirements2 vkGetImageSparseMemoryRequirements2; +extern PFN_vkGetPhysicalDeviceExternalBufferProperties vkGetPhysicalDeviceExternalBufferProperties; +extern PFN_vkGetPhysicalDeviceExternalFenceProperties vkGetPhysicalDeviceExternalFenceProperties; +extern PFN_vkGetPhysicalDeviceExternalSemaphoreProperties vkGetPhysicalDeviceExternalSemaphoreProperties; +extern PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2; +extern PFN_vkGetPhysicalDeviceFormatProperties2 vkGetPhysicalDeviceFormatProperties2; +extern PFN_vkGetPhysicalDeviceImageFormatProperties2 vkGetPhysicalDeviceImageFormatProperties2; +extern PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2; +extern PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2; +extern PFN_vkGetPhysicalDeviceQueueFamilyProperties2 vkGetPhysicalDeviceQueueFamilyProperties2; +extern PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 vkGetPhysicalDeviceSparseImageFormatProperties2; +extern PFN_vkTrimCommandPool vkTrimCommandPool; +extern PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate; +#endif /* defined(VK_VERSION_1_1) */ +#if defined(VK_VERSION_1_2) +extern PFN_vkCmdBeginRenderPass2 vkCmdBeginRenderPass2; +extern PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount; +extern PFN_vkCmdDrawIndirectCount vkCmdDrawIndirectCount; +extern PFN_vkCmdEndRenderPass2 vkCmdEndRenderPass2; +extern PFN_vkCmdNextSubpass2 vkCmdNextSubpass2; +extern PFN_vkCreateRenderPass2 vkCreateRenderPass2; +extern PFN_vkGetBufferDeviceAddress vkGetBufferDeviceAddress; +extern PFN_vkGetBufferOpaqueCaptureAddress vkGetBufferOpaqueCaptureAddress; +extern PFN_vkGetDeviceMemoryOpaqueCaptureAddress vkGetDeviceMemoryOpaqueCaptureAddress; +extern PFN_vkGetSemaphoreCounterValue vkGetSemaphoreCounterValue; +extern PFN_vkResetQueryPool vkResetQueryPool; +extern PFN_vkSignalSemaphore vkSignalSemaphore; +extern PFN_vkWaitSemaphores vkWaitSemaphores; +#endif /* defined(VK_VERSION_1_2) */ +#if defined(VK_VERSION_1_3) +extern PFN_vkCmdBeginRendering vkCmdBeginRendering; +extern PFN_vkCmdBindVertexBuffers2 vkCmdBindVertexBuffers2; +extern PFN_vkCmdBlitImage2 vkCmdBlitImage2; +extern PFN_vkCmdCopyBuffer2 vkCmdCopyBuffer2; +extern PFN_vkCmdCopyBufferToImage2 vkCmdCopyBufferToImage2; +extern PFN_vkCmdCopyImage2 vkCmdCopyImage2; +extern PFN_vkCmdCopyImageToBuffer2 vkCmdCopyImageToBuffer2; +extern PFN_vkCmdEndRendering vkCmdEndRendering; +extern PFN_vkCmdPipelineBarrier2 vkCmdPipelineBarrier2; +extern PFN_vkCmdResetEvent2 vkCmdResetEvent2; +extern PFN_vkCmdResolveImage2 vkCmdResolveImage2; +extern PFN_vkCmdSetCullMode vkCmdSetCullMode; +extern PFN_vkCmdSetDepthBiasEnable vkCmdSetDepthBiasEnable; +extern PFN_vkCmdSetDepthBoundsTestEnable vkCmdSetDepthBoundsTestEnable; +extern PFN_vkCmdSetDepthCompareOp vkCmdSetDepthCompareOp; +extern PFN_vkCmdSetDepthTestEnable vkCmdSetDepthTestEnable; +extern PFN_vkCmdSetDepthWriteEnable vkCmdSetDepthWriteEnable; +extern PFN_vkCmdSetEvent2 vkCmdSetEvent2; +extern PFN_vkCmdSetFrontFace vkCmdSetFrontFace; +extern PFN_vkCmdSetPrimitiveRestartEnable vkCmdSetPrimitiveRestartEnable; +extern PFN_vkCmdSetPrimitiveTopology vkCmdSetPrimitiveTopology; +extern PFN_vkCmdSetRasterizerDiscardEnable vkCmdSetRasterizerDiscardEnable; +extern PFN_vkCmdSetScissorWithCount vkCmdSetScissorWithCount; +extern PFN_vkCmdSetStencilOp vkCmdSetStencilOp; +extern PFN_vkCmdSetStencilTestEnable vkCmdSetStencilTestEnable; +extern PFN_vkCmdSetViewportWithCount vkCmdSetViewportWithCount; +extern PFN_vkCmdWaitEvents2 vkCmdWaitEvents2; +extern PFN_vkCmdWriteTimestamp2 vkCmdWriteTimestamp2; +extern PFN_vkCreatePrivateDataSlot vkCreatePrivateDataSlot; +extern PFN_vkDestroyPrivateDataSlot vkDestroyPrivateDataSlot; +extern PFN_vkGetDeviceBufferMemoryRequirements vkGetDeviceBufferMemoryRequirements; +extern PFN_vkGetDeviceImageMemoryRequirements vkGetDeviceImageMemoryRequirements; +extern PFN_vkGetDeviceImageSparseMemoryRequirements vkGetDeviceImageSparseMemoryRequirements; +extern PFN_vkGetPhysicalDeviceToolProperties vkGetPhysicalDeviceToolProperties; +extern PFN_vkGetPrivateData vkGetPrivateData; +extern PFN_vkQueueSubmit2 vkQueueSubmit2; +extern PFN_vkSetPrivateData vkSetPrivateData; +#endif /* defined(VK_VERSION_1_3) */ +#if defined(VK_AMDX_shader_enqueue) +extern PFN_vkCmdDispatchGraphAMDX vkCmdDispatchGraphAMDX; +extern PFN_vkCmdDispatchGraphIndirectAMDX vkCmdDispatchGraphIndirectAMDX; +extern PFN_vkCmdDispatchGraphIndirectCountAMDX vkCmdDispatchGraphIndirectCountAMDX; +extern PFN_vkCmdInitializeGraphScratchMemoryAMDX vkCmdInitializeGraphScratchMemoryAMDX; +extern PFN_vkCreateExecutionGraphPipelinesAMDX vkCreateExecutionGraphPipelinesAMDX; +extern PFN_vkGetExecutionGraphPipelineNodeIndexAMDX vkGetExecutionGraphPipelineNodeIndexAMDX; +extern PFN_vkGetExecutionGraphPipelineScratchSizeAMDX vkGetExecutionGraphPipelineScratchSizeAMDX; +#endif /* defined(VK_AMDX_shader_enqueue) */ +#if defined(VK_AMD_anti_lag) +extern PFN_vkAntiLagUpdateAMD vkAntiLagUpdateAMD; +#endif /* defined(VK_AMD_anti_lag) */ +#if defined(VK_AMD_buffer_marker) +extern PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD; +#endif /* defined(VK_AMD_buffer_marker) */ +#if defined(VK_AMD_display_native_hdr) +extern PFN_vkSetLocalDimmingAMD vkSetLocalDimmingAMD; +#endif /* defined(VK_AMD_display_native_hdr) */ +#if defined(VK_AMD_draw_indirect_count) +extern PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD; +extern PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD; +#endif /* defined(VK_AMD_draw_indirect_count) */ +#if defined(VK_AMD_shader_info) +extern PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD; +#endif /* defined(VK_AMD_shader_info) */ +#if defined(VK_ANDROID_external_memory_android_hardware_buffer) +extern PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID; +extern PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBufferANDROID; +#endif /* defined(VK_ANDROID_external_memory_android_hardware_buffer) */ +#if defined(VK_EXT_acquire_drm_display) +extern PFN_vkAcquireDrmDisplayEXT vkAcquireDrmDisplayEXT; +extern PFN_vkGetDrmDisplayEXT vkGetDrmDisplayEXT; +#endif /* defined(VK_EXT_acquire_drm_display) */ +#if defined(VK_EXT_acquire_xlib_display) +extern PFN_vkAcquireXlibDisplayEXT vkAcquireXlibDisplayEXT; +extern PFN_vkGetRandROutputDisplayEXT vkGetRandROutputDisplayEXT; +#endif /* defined(VK_EXT_acquire_xlib_display) */ +#if defined(VK_EXT_attachment_feedback_loop_dynamic_state) +extern PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT vkCmdSetAttachmentFeedbackLoopEnableEXT; +#endif /* defined(VK_EXT_attachment_feedback_loop_dynamic_state) */ +#if defined(VK_EXT_buffer_device_address) +extern PFN_vkGetBufferDeviceAddressEXT vkGetBufferDeviceAddressEXT; +#endif /* defined(VK_EXT_buffer_device_address) */ +#if defined(VK_EXT_calibrated_timestamps) +extern PFN_vkGetCalibratedTimestampsEXT vkGetCalibratedTimestampsEXT; +extern PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT vkGetPhysicalDeviceCalibrateableTimeDomainsEXT; +#endif /* defined(VK_EXT_calibrated_timestamps) */ +#if defined(VK_EXT_color_write_enable) +extern PFN_vkCmdSetColorWriteEnableEXT vkCmdSetColorWriteEnableEXT; +#endif /* defined(VK_EXT_color_write_enable) */ +#if defined(VK_EXT_conditional_rendering) +extern PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT; +extern PFN_vkCmdEndConditionalRenderingEXT vkCmdEndConditionalRenderingEXT; +#endif /* defined(VK_EXT_conditional_rendering) */ +#if defined(VK_EXT_debug_marker) +extern PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT; +extern PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT; +extern PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT; +extern PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT; +extern PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT; +#endif /* defined(VK_EXT_debug_marker) */ +#if defined(VK_EXT_debug_report) +extern PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT; +extern PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT; +extern PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT; +#endif /* defined(VK_EXT_debug_report) */ +#if defined(VK_EXT_debug_utils) +extern PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT; +extern PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT; +extern PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT; +extern PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT; +extern PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT; +extern PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT; +extern PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT; +extern PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT; +extern PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT; +extern PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT; +extern PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT; +#endif /* defined(VK_EXT_debug_utils) */ +#if defined(VK_EXT_depth_bias_control) +extern PFN_vkCmdSetDepthBias2EXT vkCmdSetDepthBias2EXT; +#endif /* defined(VK_EXT_depth_bias_control) */ +#if defined(VK_EXT_descriptor_buffer) +extern PFN_vkCmdBindDescriptorBufferEmbeddedSamplersEXT vkCmdBindDescriptorBufferEmbeddedSamplersEXT; +extern PFN_vkCmdBindDescriptorBuffersEXT vkCmdBindDescriptorBuffersEXT; +extern PFN_vkCmdSetDescriptorBufferOffsetsEXT vkCmdSetDescriptorBufferOffsetsEXT; +extern PFN_vkGetBufferOpaqueCaptureDescriptorDataEXT vkGetBufferOpaqueCaptureDescriptorDataEXT; +extern PFN_vkGetDescriptorEXT vkGetDescriptorEXT; +extern PFN_vkGetDescriptorSetLayoutBindingOffsetEXT vkGetDescriptorSetLayoutBindingOffsetEXT; +extern PFN_vkGetDescriptorSetLayoutSizeEXT vkGetDescriptorSetLayoutSizeEXT; +extern PFN_vkGetImageOpaqueCaptureDescriptorDataEXT vkGetImageOpaqueCaptureDescriptorDataEXT; +extern PFN_vkGetImageViewOpaqueCaptureDescriptorDataEXT vkGetImageViewOpaqueCaptureDescriptorDataEXT; +extern PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT vkGetSamplerOpaqueCaptureDescriptorDataEXT; +#endif /* defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) +extern PFN_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT; +#endif /* defined(VK_EXT_descriptor_buffer) && (defined(VK_KHR_acceleration_structure) || defined(VK_NV_ray_tracing)) */ +#if defined(VK_EXT_device_fault) +extern PFN_vkGetDeviceFaultInfoEXT vkGetDeviceFaultInfoEXT; +#endif /* defined(VK_EXT_device_fault) */ +#if defined(VK_EXT_direct_mode_display) +extern PFN_vkReleaseDisplayEXT vkReleaseDisplayEXT; +#endif /* defined(VK_EXT_direct_mode_display) */ +#if defined(VK_EXT_directfb_surface) +extern PFN_vkCreateDirectFBSurfaceEXT vkCreateDirectFBSurfaceEXT; +extern PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT vkGetPhysicalDeviceDirectFBPresentationSupportEXT; +#endif /* defined(VK_EXT_directfb_surface) */ +#if defined(VK_EXT_discard_rectangles) +extern PFN_vkCmdSetDiscardRectangleEXT vkCmdSetDiscardRectangleEXT; +#endif /* defined(VK_EXT_discard_rectangles) */ +#if defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 +extern PFN_vkCmdSetDiscardRectangleEnableEXT vkCmdSetDiscardRectangleEnableEXT; +extern PFN_vkCmdSetDiscardRectangleModeEXT vkCmdSetDiscardRectangleModeEXT; +#endif /* defined(VK_EXT_discard_rectangles) && VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION >= 2 */ +#if defined(VK_EXT_display_control) +extern PFN_vkDisplayPowerControlEXT vkDisplayPowerControlEXT; +extern PFN_vkGetSwapchainCounterEXT vkGetSwapchainCounterEXT; +extern PFN_vkRegisterDeviceEventEXT vkRegisterDeviceEventEXT; +extern PFN_vkRegisterDisplayEventEXT vkRegisterDisplayEventEXT; +#endif /* defined(VK_EXT_display_control) */ +#if defined(VK_EXT_display_surface_counter) +extern PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT; +#endif /* defined(VK_EXT_display_surface_counter) */ +#if defined(VK_EXT_external_memory_host) +extern PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT; +#endif /* defined(VK_EXT_external_memory_host) */ +#if defined(VK_EXT_full_screen_exclusive) +extern PFN_vkAcquireFullScreenExclusiveModeEXT vkAcquireFullScreenExclusiveModeEXT; +extern PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT vkGetPhysicalDeviceSurfacePresentModes2EXT; +extern PFN_vkReleaseFullScreenExclusiveModeEXT vkReleaseFullScreenExclusiveModeEXT; +#endif /* defined(VK_EXT_full_screen_exclusive) */ +#if defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) +extern PFN_vkGetDeviceGroupSurfacePresentModes2EXT vkGetDeviceGroupSurfacePresentModes2EXT; +#endif /* defined(VK_EXT_full_screen_exclusive) && (defined(VK_KHR_device_group) || defined(VK_VERSION_1_1)) */ +#if defined(VK_EXT_hdr_metadata) +extern PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT; +#endif /* defined(VK_EXT_hdr_metadata) */ +#if defined(VK_EXT_headless_surface) +extern PFN_vkCreateHeadlessSurfaceEXT vkCreateHeadlessSurfaceEXT; +#endif /* defined(VK_EXT_headless_surface) */ +#if defined(VK_EXT_host_image_copy) +extern PFN_vkCopyImageToImageEXT vkCopyImageToImageEXT; +extern PFN_vkCopyImageToMemoryEXT vkCopyImageToMemoryEXT; +extern PFN_vkCopyMemoryToImageEXT vkCopyMemoryToImageEXT; +extern PFN_vkTransitionImageLayoutEXT vkTransitionImageLayoutEXT; +#endif /* defined(VK_EXT_host_image_copy) */ +#if defined(VK_EXT_host_query_reset) +extern PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT; +#endif /* defined(VK_EXT_host_query_reset) */ +#if defined(VK_EXT_image_drm_format_modifier) +extern PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT; +#endif /* defined(VK_EXT_image_drm_format_modifier) */ +#if defined(VK_EXT_line_rasterization) +extern PFN_vkCmdSetLineStippleEXT vkCmdSetLineStippleEXT; +#endif /* defined(VK_EXT_line_rasterization) */ +#if defined(VK_EXT_mesh_shader) +extern PFN_vkCmdDrawMeshTasksEXT vkCmdDrawMeshTasksEXT; +extern PFN_vkCmdDrawMeshTasksIndirectCountEXT vkCmdDrawMeshTasksIndirectCountEXT; +extern PFN_vkCmdDrawMeshTasksIndirectEXT vkCmdDrawMeshTasksIndirectEXT; +#endif /* defined(VK_EXT_mesh_shader) */ +#if defined(VK_EXT_metal_objects) +extern PFN_vkExportMetalObjectsEXT vkExportMetalObjectsEXT; +#endif /* defined(VK_EXT_metal_objects) */ +#if defined(VK_EXT_metal_surface) +extern PFN_vkCreateMetalSurfaceEXT vkCreateMetalSurfaceEXT; +#endif /* defined(VK_EXT_metal_surface) */ +#if defined(VK_EXT_multi_draw) +extern PFN_vkCmdDrawMultiEXT vkCmdDrawMultiEXT; +extern PFN_vkCmdDrawMultiIndexedEXT vkCmdDrawMultiIndexedEXT; +#endif /* defined(VK_EXT_multi_draw) */ +#if defined(VK_EXT_opacity_micromap) +extern PFN_vkBuildMicromapsEXT vkBuildMicromapsEXT; +extern PFN_vkCmdBuildMicromapsEXT vkCmdBuildMicromapsEXT; +extern PFN_vkCmdCopyMemoryToMicromapEXT vkCmdCopyMemoryToMicromapEXT; +extern PFN_vkCmdCopyMicromapEXT vkCmdCopyMicromapEXT; +extern PFN_vkCmdCopyMicromapToMemoryEXT vkCmdCopyMicromapToMemoryEXT; +extern PFN_vkCmdWriteMicromapsPropertiesEXT vkCmdWriteMicromapsPropertiesEXT; +extern PFN_vkCopyMemoryToMicromapEXT vkCopyMemoryToMicromapEXT; +extern PFN_vkCopyMicromapEXT vkCopyMicromapEXT; +extern PFN_vkCopyMicromapToMemoryEXT vkCopyMicromapToMemoryEXT; +extern PFN_vkCreateMicromapEXT vkCreateMicromapEXT; +extern PFN_vkDestroyMicromapEXT vkDestroyMicromapEXT; +extern PFN_vkGetDeviceMicromapCompatibilityEXT vkGetDeviceMicromapCompatibilityEXT; +extern PFN_vkGetMicromapBuildSizesEXT vkGetMicromapBuildSizesEXT; +extern PFN_vkWriteMicromapsPropertiesEXT vkWriteMicromapsPropertiesEXT; +#endif /* defined(VK_EXT_opacity_micromap) */ +#if defined(VK_EXT_pageable_device_local_memory) +extern PFN_vkSetDeviceMemoryPriorityEXT vkSetDeviceMemoryPriorityEXT; +#endif /* defined(VK_EXT_pageable_device_local_memory) */ +#if defined(VK_EXT_pipeline_properties) +extern PFN_vkGetPipelinePropertiesEXT vkGetPipelinePropertiesEXT; +#endif /* defined(VK_EXT_pipeline_properties) */ +#if defined(VK_EXT_private_data) +extern PFN_vkCreatePrivateDataSlotEXT vkCreatePrivateDataSlotEXT; +extern PFN_vkDestroyPrivateDataSlotEXT vkDestroyPrivateDataSlotEXT; +extern PFN_vkGetPrivateDataEXT vkGetPrivateDataEXT; +extern PFN_vkSetPrivateDataEXT vkSetPrivateDataEXT; +#endif /* defined(VK_EXT_private_data) */ +#if defined(VK_EXT_sample_locations) +extern PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT; +extern PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT; +#endif /* defined(VK_EXT_sample_locations) */ +#if defined(VK_EXT_shader_module_identifier) +extern PFN_vkGetShaderModuleCreateInfoIdentifierEXT vkGetShaderModuleCreateInfoIdentifierEXT; +extern PFN_vkGetShaderModuleIdentifierEXT vkGetShaderModuleIdentifierEXT; +#endif /* defined(VK_EXT_shader_module_identifier) */ +#if defined(VK_EXT_shader_object) +extern PFN_vkCmdBindShadersEXT vkCmdBindShadersEXT; +extern PFN_vkCreateShadersEXT vkCreateShadersEXT; +extern PFN_vkDestroyShaderEXT vkDestroyShaderEXT; +extern PFN_vkGetShaderBinaryDataEXT vkGetShaderBinaryDataEXT; +#endif /* defined(VK_EXT_shader_object) */ +#if defined(VK_EXT_swapchain_maintenance1) +extern PFN_vkReleaseSwapchainImagesEXT vkReleaseSwapchainImagesEXT; +#endif /* defined(VK_EXT_swapchain_maintenance1) */ +#if defined(VK_EXT_tooling_info) +extern PFN_vkGetPhysicalDeviceToolPropertiesEXT vkGetPhysicalDeviceToolPropertiesEXT; +#endif /* defined(VK_EXT_tooling_info) */ +#if defined(VK_EXT_transform_feedback) +extern PFN_vkCmdBeginQueryIndexedEXT vkCmdBeginQueryIndexedEXT; +extern PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT; +extern PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT; +extern PFN_vkCmdDrawIndirectByteCountEXT vkCmdDrawIndirectByteCountEXT; +extern PFN_vkCmdEndQueryIndexedEXT vkCmdEndQueryIndexedEXT; +extern PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT; +#endif /* defined(VK_EXT_transform_feedback) */ +#if defined(VK_EXT_validation_cache) +extern PFN_vkCreateValidationCacheEXT vkCreateValidationCacheEXT; +extern PFN_vkDestroyValidationCacheEXT vkDestroyValidationCacheEXT; +extern PFN_vkGetValidationCacheDataEXT vkGetValidationCacheDataEXT; +extern PFN_vkMergeValidationCachesEXT vkMergeValidationCachesEXT; +#endif /* defined(VK_EXT_validation_cache) */ +#if defined(VK_FUCHSIA_buffer_collection) +extern PFN_vkCreateBufferCollectionFUCHSIA vkCreateBufferCollectionFUCHSIA; +extern PFN_vkDestroyBufferCollectionFUCHSIA vkDestroyBufferCollectionFUCHSIA; +extern PFN_vkGetBufferCollectionPropertiesFUCHSIA vkGetBufferCollectionPropertiesFUCHSIA; +extern PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA vkSetBufferCollectionBufferConstraintsFUCHSIA; +extern PFN_vkSetBufferCollectionImageConstraintsFUCHSIA vkSetBufferCollectionImageConstraintsFUCHSIA; +#endif /* defined(VK_FUCHSIA_buffer_collection) */ +#if defined(VK_FUCHSIA_external_memory) +extern PFN_vkGetMemoryZirconHandleFUCHSIA vkGetMemoryZirconHandleFUCHSIA; +extern PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA vkGetMemoryZirconHandlePropertiesFUCHSIA; +#endif /* defined(VK_FUCHSIA_external_memory) */ +#if defined(VK_FUCHSIA_external_semaphore) +extern PFN_vkGetSemaphoreZirconHandleFUCHSIA vkGetSemaphoreZirconHandleFUCHSIA; +extern PFN_vkImportSemaphoreZirconHandleFUCHSIA vkImportSemaphoreZirconHandleFUCHSIA; +#endif /* defined(VK_FUCHSIA_external_semaphore) */ +#if defined(VK_FUCHSIA_imagepipe_surface) +extern PFN_vkCreateImagePipeSurfaceFUCHSIA vkCreateImagePipeSurfaceFUCHSIA; +#endif /* defined(VK_FUCHSIA_imagepipe_surface) */ +#if defined(VK_GGP_stream_descriptor_surface) +extern PFN_vkCreateStreamDescriptorSurfaceGGP vkCreateStreamDescriptorSurfaceGGP; +#endif /* defined(VK_GGP_stream_descriptor_surface) */ +#if defined(VK_GOOGLE_display_timing) +extern PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE; +extern PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE; +#endif /* defined(VK_GOOGLE_display_timing) */ +#if defined(VK_HUAWEI_cluster_culling_shader) +extern PFN_vkCmdDrawClusterHUAWEI vkCmdDrawClusterHUAWEI; +extern PFN_vkCmdDrawClusterIndirectHUAWEI vkCmdDrawClusterIndirectHUAWEI; +#endif /* defined(VK_HUAWEI_cluster_culling_shader) */ +#if defined(VK_HUAWEI_invocation_mask) +extern PFN_vkCmdBindInvocationMaskHUAWEI vkCmdBindInvocationMaskHUAWEI; +#endif /* defined(VK_HUAWEI_invocation_mask) */ +#if defined(VK_HUAWEI_subpass_shading) +extern PFN_vkCmdSubpassShadingHUAWEI vkCmdSubpassShadingHUAWEI; +extern PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI; +#endif /* defined(VK_HUAWEI_subpass_shading) */ +#if defined(VK_INTEL_performance_query) +extern PFN_vkAcquirePerformanceConfigurationINTEL vkAcquirePerformanceConfigurationINTEL; +extern PFN_vkCmdSetPerformanceMarkerINTEL vkCmdSetPerformanceMarkerINTEL; +extern PFN_vkCmdSetPerformanceOverrideINTEL vkCmdSetPerformanceOverrideINTEL; +extern PFN_vkCmdSetPerformanceStreamMarkerINTEL vkCmdSetPerformanceStreamMarkerINTEL; +extern PFN_vkGetPerformanceParameterINTEL vkGetPerformanceParameterINTEL; +extern PFN_vkInitializePerformanceApiINTEL vkInitializePerformanceApiINTEL; +extern PFN_vkQueueSetPerformanceConfigurationINTEL vkQueueSetPerformanceConfigurationINTEL; +extern PFN_vkReleasePerformanceConfigurationINTEL vkReleasePerformanceConfigurationINTEL; +extern PFN_vkUninitializePerformanceApiINTEL vkUninitializePerformanceApiINTEL; +#endif /* defined(VK_INTEL_performance_query) */ +#if defined(VK_KHR_acceleration_structure) +extern PFN_vkBuildAccelerationStructuresKHR vkBuildAccelerationStructuresKHR; +extern PFN_vkCmdBuildAccelerationStructuresIndirectKHR vkCmdBuildAccelerationStructuresIndirectKHR; +extern PFN_vkCmdBuildAccelerationStructuresKHR vkCmdBuildAccelerationStructuresKHR; +extern PFN_vkCmdCopyAccelerationStructureKHR vkCmdCopyAccelerationStructureKHR; +extern PFN_vkCmdCopyAccelerationStructureToMemoryKHR vkCmdCopyAccelerationStructureToMemoryKHR; +extern PFN_vkCmdCopyMemoryToAccelerationStructureKHR vkCmdCopyMemoryToAccelerationStructureKHR; +extern PFN_vkCmdWriteAccelerationStructuresPropertiesKHR vkCmdWriteAccelerationStructuresPropertiesKHR; +extern PFN_vkCopyAccelerationStructureKHR vkCopyAccelerationStructureKHR; +extern PFN_vkCopyAccelerationStructureToMemoryKHR vkCopyAccelerationStructureToMemoryKHR; +extern PFN_vkCopyMemoryToAccelerationStructureKHR vkCopyMemoryToAccelerationStructureKHR; +extern PFN_vkCreateAccelerationStructureKHR vkCreateAccelerationStructureKHR; +extern PFN_vkDestroyAccelerationStructureKHR vkDestroyAccelerationStructureKHR; +extern PFN_vkGetAccelerationStructureBuildSizesKHR vkGetAccelerationStructureBuildSizesKHR; +extern PFN_vkGetAccelerationStructureDeviceAddressKHR vkGetAccelerationStructureDeviceAddressKHR; +extern PFN_vkGetDeviceAccelerationStructureCompatibilityKHR vkGetDeviceAccelerationStructureCompatibilityKHR; +extern PFN_vkWriteAccelerationStructuresPropertiesKHR vkWriteAccelerationStructuresPropertiesKHR; +#endif /* defined(VK_KHR_acceleration_structure) */ +#if defined(VK_KHR_android_surface) +extern PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR; +#endif /* defined(VK_KHR_android_surface) */ +#if defined(VK_KHR_bind_memory2) +extern PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR; +extern PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR; +#endif /* defined(VK_KHR_bind_memory2) */ +#if defined(VK_KHR_buffer_device_address) +extern PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR; +extern PFN_vkGetBufferOpaqueCaptureAddressKHR vkGetBufferOpaqueCaptureAddressKHR; +extern PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR vkGetDeviceMemoryOpaqueCaptureAddressKHR; +#endif /* defined(VK_KHR_buffer_device_address) */ +#if defined(VK_KHR_calibrated_timestamps) +extern PFN_vkGetCalibratedTimestampsKHR vkGetCalibratedTimestampsKHR; +extern PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR vkGetPhysicalDeviceCalibrateableTimeDomainsKHR; +#endif /* defined(VK_KHR_calibrated_timestamps) */ +#if defined(VK_KHR_cooperative_matrix) +extern PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR; +#endif /* defined(VK_KHR_cooperative_matrix) */ +#if defined(VK_KHR_copy_commands2) +extern PFN_vkCmdBlitImage2KHR vkCmdBlitImage2KHR; +extern PFN_vkCmdCopyBuffer2KHR vkCmdCopyBuffer2KHR; +extern PFN_vkCmdCopyBufferToImage2KHR vkCmdCopyBufferToImage2KHR; +extern PFN_vkCmdCopyImage2KHR vkCmdCopyImage2KHR; +extern PFN_vkCmdCopyImageToBuffer2KHR vkCmdCopyImageToBuffer2KHR; +extern PFN_vkCmdResolveImage2KHR vkCmdResolveImage2KHR; +#endif /* defined(VK_KHR_copy_commands2) */ +#if defined(VK_KHR_create_renderpass2) +extern PFN_vkCmdBeginRenderPass2KHR vkCmdBeginRenderPass2KHR; +extern PFN_vkCmdEndRenderPass2KHR vkCmdEndRenderPass2KHR; +extern PFN_vkCmdNextSubpass2KHR vkCmdNextSubpass2KHR; +extern PFN_vkCreateRenderPass2KHR vkCreateRenderPass2KHR; +#endif /* defined(VK_KHR_create_renderpass2) */ +#if defined(VK_KHR_deferred_host_operations) +extern PFN_vkCreateDeferredOperationKHR vkCreateDeferredOperationKHR; +extern PFN_vkDeferredOperationJoinKHR vkDeferredOperationJoinKHR; +extern PFN_vkDestroyDeferredOperationKHR vkDestroyDeferredOperationKHR; +extern PFN_vkGetDeferredOperationMaxConcurrencyKHR vkGetDeferredOperationMaxConcurrencyKHR; +extern PFN_vkGetDeferredOperationResultKHR vkGetDeferredOperationResultKHR; +#endif /* defined(VK_KHR_deferred_host_operations) */ +#if defined(VK_KHR_descriptor_update_template) +extern PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR; +extern PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR; +extern PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR; +#endif /* defined(VK_KHR_descriptor_update_template) */ +#if defined(VK_KHR_device_group) +extern PFN_vkCmdDispatchBaseKHR vkCmdDispatchBaseKHR; +extern PFN_vkCmdSetDeviceMaskKHR vkCmdSetDeviceMaskKHR; +extern PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR vkGetDeviceGroupPeerMemoryFeaturesKHR; +#endif /* defined(VK_KHR_device_group) */ +#if defined(VK_KHR_device_group_creation) +extern PFN_vkEnumeratePhysicalDeviceGroupsKHR vkEnumeratePhysicalDeviceGroupsKHR; +#endif /* defined(VK_KHR_device_group_creation) */ +#if defined(VK_KHR_display) +extern PFN_vkCreateDisplayModeKHR vkCreateDisplayModeKHR; +extern PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR; +extern PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR; +extern PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR; +extern PFN_vkGetDisplayPlaneSupportedDisplaysKHR vkGetDisplayPlaneSupportedDisplaysKHR; +extern PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR; +extern PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR; +#endif /* defined(VK_KHR_display) */ +#if defined(VK_KHR_display_swapchain) +extern PFN_vkCreateSharedSwapchainsKHR vkCreateSharedSwapchainsKHR; +#endif /* defined(VK_KHR_display_swapchain) */ +#if defined(VK_KHR_draw_indirect_count) +extern PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR; +extern PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR; +#endif /* defined(VK_KHR_draw_indirect_count) */ +#if defined(VK_KHR_dynamic_rendering) +extern PFN_vkCmdBeginRenderingKHR vkCmdBeginRenderingKHR; +extern PFN_vkCmdEndRenderingKHR vkCmdEndRenderingKHR; +#endif /* defined(VK_KHR_dynamic_rendering) */ +#if defined(VK_KHR_dynamic_rendering_local_read) +extern PFN_vkCmdSetRenderingAttachmentLocationsKHR vkCmdSetRenderingAttachmentLocationsKHR; +extern PFN_vkCmdSetRenderingInputAttachmentIndicesKHR vkCmdSetRenderingInputAttachmentIndicesKHR; +#endif /* defined(VK_KHR_dynamic_rendering_local_read) */ +#if defined(VK_KHR_external_fence_capabilities) +extern PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR vkGetPhysicalDeviceExternalFencePropertiesKHR; +#endif /* defined(VK_KHR_external_fence_capabilities) */ +#if defined(VK_KHR_external_fence_fd) +extern PFN_vkGetFenceFdKHR vkGetFenceFdKHR; +extern PFN_vkImportFenceFdKHR vkImportFenceFdKHR; +#endif /* defined(VK_KHR_external_fence_fd) */ +#if defined(VK_KHR_external_fence_win32) +extern PFN_vkGetFenceWin32HandleKHR vkGetFenceWin32HandleKHR; +extern PFN_vkImportFenceWin32HandleKHR vkImportFenceWin32HandleKHR; +#endif /* defined(VK_KHR_external_fence_win32) */ +#if defined(VK_KHR_external_memory_capabilities) +extern PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR; +#endif /* defined(VK_KHR_external_memory_capabilities) */ +#if defined(VK_KHR_external_memory_fd) +extern PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR; +extern PFN_vkGetMemoryFdPropertiesKHR vkGetMemoryFdPropertiesKHR; +#endif /* defined(VK_KHR_external_memory_fd) */ +#if defined(VK_KHR_external_memory_win32) +extern PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR; +extern PFN_vkGetMemoryWin32HandlePropertiesKHR vkGetMemoryWin32HandlePropertiesKHR; +#endif /* defined(VK_KHR_external_memory_win32) */ +#if defined(VK_KHR_external_semaphore_capabilities) +extern PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; +#endif /* defined(VK_KHR_external_semaphore_capabilities) */ +#if defined(VK_KHR_external_semaphore_fd) +extern PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR; +extern PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR; +#endif /* defined(VK_KHR_external_semaphore_fd) */ +#if defined(VK_KHR_external_semaphore_win32) +extern PFN_vkGetSemaphoreWin32HandleKHR vkGetSemaphoreWin32HandleKHR; +extern PFN_vkImportSemaphoreWin32HandleKHR vkImportSemaphoreWin32HandleKHR; +#endif /* defined(VK_KHR_external_semaphore_win32) */ +#if defined(VK_KHR_fragment_shading_rate) +extern PFN_vkCmdSetFragmentShadingRateKHR vkCmdSetFragmentShadingRateKHR; +extern PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR vkGetPhysicalDeviceFragmentShadingRatesKHR; +#endif /* defined(VK_KHR_fragment_shading_rate) */ +#if defined(VK_KHR_get_display_properties2) +extern PFN_vkGetDisplayModeProperties2KHR vkGetDisplayModeProperties2KHR; +extern PFN_vkGetDisplayPlaneCapabilities2KHR vkGetDisplayPlaneCapabilities2KHR; +extern PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR vkGetPhysicalDeviceDisplayPlaneProperties2KHR; +extern PFN_vkGetPhysicalDeviceDisplayProperties2KHR vkGetPhysicalDeviceDisplayProperties2KHR; +#endif /* defined(VK_KHR_get_display_properties2) */ +#if defined(VK_KHR_get_memory_requirements2) +extern PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR; +extern PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR; +extern PFN_vkGetImageSparseMemoryRequirements2KHR vkGetImageSparseMemoryRequirements2KHR; +#endif /* defined(VK_KHR_get_memory_requirements2) */ +#if defined(VK_KHR_get_physical_device_properties2) +extern PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; +extern PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR; +extern PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR; +extern PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR; +extern PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR; +extern PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR; +extern PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR vkGetPhysicalDeviceSparseImageFormatProperties2KHR; +#endif /* defined(VK_KHR_get_physical_device_properties2) */ +#if defined(VK_KHR_get_surface_capabilities2) +extern PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR; +extern PFN_vkGetPhysicalDeviceSurfaceFormats2KHR vkGetPhysicalDeviceSurfaceFormats2KHR; +#endif /* defined(VK_KHR_get_surface_capabilities2) */ +#if defined(VK_KHR_line_rasterization) +extern PFN_vkCmdSetLineStippleKHR vkCmdSetLineStippleKHR; +#endif /* defined(VK_KHR_line_rasterization) */ +#if defined(VK_KHR_maintenance1) +extern PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR; +#endif /* defined(VK_KHR_maintenance1) */ +#if defined(VK_KHR_maintenance3) +extern PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR; +#endif /* defined(VK_KHR_maintenance3) */ +#if defined(VK_KHR_maintenance4) +extern PFN_vkGetDeviceBufferMemoryRequirementsKHR vkGetDeviceBufferMemoryRequirementsKHR; +extern PFN_vkGetDeviceImageMemoryRequirementsKHR vkGetDeviceImageMemoryRequirementsKHR; +extern PFN_vkGetDeviceImageSparseMemoryRequirementsKHR vkGetDeviceImageSparseMemoryRequirementsKHR; +#endif /* defined(VK_KHR_maintenance4) */ +#if defined(VK_KHR_maintenance5) +extern PFN_vkCmdBindIndexBuffer2KHR vkCmdBindIndexBuffer2KHR; +extern PFN_vkGetDeviceImageSubresourceLayoutKHR vkGetDeviceImageSubresourceLayoutKHR; +extern PFN_vkGetImageSubresourceLayout2KHR vkGetImageSubresourceLayout2KHR; +extern PFN_vkGetRenderingAreaGranularityKHR vkGetRenderingAreaGranularityKHR; +#endif /* defined(VK_KHR_maintenance5) */ +#if defined(VK_KHR_maintenance6) +extern PFN_vkCmdBindDescriptorSets2KHR vkCmdBindDescriptorSets2KHR; +extern PFN_vkCmdPushConstants2KHR vkCmdPushConstants2KHR; +#endif /* defined(VK_KHR_maintenance6) */ +#if defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) +extern PFN_vkCmdPushDescriptorSet2KHR vkCmdPushDescriptorSet2KHR; +extern PFN_vkCmdPushDescriptorSetWithTemplate2KHR vkCmdPushDescriptorSetWithTemplate2KHR; +#endif /* defined(VK_KHR_maintenance6) && defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) +extern PFN_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT vkCmdBindDescriptorBufferEmbeddedSamplers2EXT; +extern PFN_vkCmdSetDescriptorBufferOffsets2EXT vkCmdSetDescriptorBufferOffsets2EXT; +#endif /* defined(VK_KHR_maintenance6) && defined(VK_EXT_descriptor_buffer) */ +#if defined(VK_KHR_map_memory2) +extern PFN_vkMapMemory2KHR vkMapMemory2KHR; +extern PFN_vkUnmapMemory2KHR vkUnmapMemory2KHR; +#endif /* defined(VK_KHR_map_memory2) */ +#if defined(VK_KHR_performance_query) +extern PFN_vkAcquireProfilingLockKHR vkAcquireProfilingLockKHR; +extern PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR; +extern PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR; +extern PFN_vkReleaseProfilingLockKHR vkReleaseProfilingLockKHR; +#endif /* defined(VK_KHR_performance_query) */ +#if defined(VK_KHR_pipeline_executable_properties) +extern PFN_vkGetPipelineExecutableInternalRepresentationsKHR vkGetPipelineExecutableInternalRepresentationsKHR; +extern PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR; +extern PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR; +#endif /* defined(VK_KHR_pipeline_executable_properties) */ +#if defined(VK_KHR_present_wait) +extern PFN_vkWaitForPresentKHR vkWaitForPresentKHR; +#endif /* defined(VK_KHR_present_wait) */ +#if defined(VK_KHR_push_descriptor) +extern PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR; +#endif /* defined(VK_KHR_push_descriptor) */ +#if defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) +extern PFN_vkCmdTraceRaysIndirect2KHR vkCmdTraceRaysIndirect2KHR; +#endif /* defined(VK_KHR_ray_tracing_maintenance1) && defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_ray_tracing_pipeline) +extern PFN_vkCmdSetRayTracingPipelineStackSizeKHR vkCmdSetRayTracingPipelineStackSizeKHR; +extern PFN_vkCmdTraceRaysIndirectKHR vkCmdTraceRaysIndirectKHR; +extern PFN_vkCmdTraceRaysKHR vkCmdTraceRaysKHR; +extern PFN_vkCreateRayTracingPipelinesKHR vkCreateRayTracingPipelinesKHR; +extern PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR vkGetRayTracingCaptureReplayShaderGroupHandlesKHR; +extern PFN_vkGetRayTracingShaderGroupHandlesKHR vkGetRayTracingShaderGroupHandlesKHR; +extern PFN_vkGetRayTracingShaderGroupStackSizeKHR vkGetRayTracingShaderGroupStackSizeKHR; +#endif /* defined(VK_KHR_ray_tracing_pipeline) */ +#if defined(VK_KHR_sampler_ycbcr_conversion) +extern PFN_vkCreateSamplerYcbcrConversionKHR vkCreateSamplerYcbcrConversionKHR; +extern PFN_vkDestroySamplerYcbcrConversionKHR vkDestroySamplerYcbcrConversionKHR; +#endif /* defined(VK_KHR_sampler_ycbcr_conversion) */ +#if defined(VK_KHR_shared_presentable_image) +extern PFN_vkGetSwapchainStatusKHR vkGetSwapchainStatusKHR; +#endif /* defined(VK_KHR_shared_presentable_image) */ +#if defined(VK_KHR_surface) +extern PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; +extern PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR; +extern PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR; +extern PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR; +extern PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; +#endif /* defined(VK_KHR_surface) */ +#if defined(VK_KHR_swapchain) +extern PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR; +extern PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR; +extern PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR; +extern PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR; +extern PFN_vkQueuePresentKHR vkQueuePresentKHR; +#endif /* defined(VK_KHR_swapchain) */ +#if defined(VK_KHR_synchronization2) +extern PFN_vkCmdPipelineBarrier2KHR vkCmdPipelineBarrier2KHR; +extern PFN_vkCmdResetEvent2KHR vkCmdResetEvent2KHR; +extern PFN_vkCmdSetEvent2KHR vkCmdSetEvent2KHR; +extern PFN_vkCmdWaitEvents2KHR vkCmdWaitEvents2KHR; +extern PFN_vkCmdWriteTimestamp2KHR vkCmdWriteTimestamp2KHR; +extern PFN_vkQueueSubmit2KHR vkQueueSubmit2KHR; +#endif /* defined(VK_KHR_synchronization2) */ +#if defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) +extern PFN_vkCmdWriteBufferMarker2AMD vkCmdWriteBufferMarker2AMD; +#endif /* defined(VK_KHR_synchronization2) && defined(VK_AMD_buffer_marker) */ +#if defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) +extern PFN_vkGetQueueCheckpointData2NV vkGetQueueCheckpointData2NV; +#endif /* defined(VK_KHR_synchronization2) && defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_KHR_timeline_semaphore) +extern PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValueKHR; +extern PFN_vkSignalSemaphoreKHR vkSignalSemaphoreKHR; +extern PFN_vkWaitSemaphoresKHR vkWaitSemaphoresKHR; +#endif /* defined(VK_KHR_timeline_semaphore) */ +#if defined(VK_KHR_video_decode_queue) +extern PFN_vkCmdDecodeVideoKHR vkCmdDecodeVideoKHR; +#endif /* defined(VK_KHR_video_decode_queue) */ +#if defined(VK_KHR_video_encode_queue) +extern PFN_vkCmdEncodeVideoKHR vkCmdEncodeVideoKHR; +extern PFN_vkGetEncodedVideoSessionParametersKHR vkGetEncodedVideoSessionParametersKHR; +extern PFN_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR; +#endif /* defined(VK_KHR_video_encode_queue) */ +#if defined(VK_KHR_video_queue) +extern PFN_vkBindVideoSessionMemoryKHR vkBindVideoSessionMemoryKHR; +extern PFN_vkCmdBeginVideoCodingKHR vkCmdBeginVideoCodingKHR; +extern PFN_vkCmdControlVideoCodingKHR vkCmdControlVideoCodingKHR; +extern PFN_vkCmdEndVideoCodingKHR vkCmdEndVideoCodingKHR; +extern PFN_vkCreateVideoSessionKHR vkCreateVideoSessionKHR; +extern PFN_vkCreateVideoSessionParametersKHR vkCreateVideoSessionParametersKHR; +extern PFN_vkDestroyVideoSessionKHR vkDestroyVideoSessionKHR; +extern PFN_vkDestroyVideoSessionParametersKHR vkDestroyVideoSessionParametersKHR; +extern PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR; +extern PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR vkGetPhysicalDeviceVideoFormatPropertiesKHR; +extern PFN_vkGetVideoSessionMemoryRequirementsKHR vkGetVideoSessionMemoryRequirementsKHR; +extern PFN_vkUpdateVideoSessionParametersKHR vkUpdateVideoSessionParametersKHR; +#endif /* defined(VK_KHR_video_queue) */ +#if defined(VK_KHR_wayland_surface) +extern PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR; +extern PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR vkGetPhysicalDeviceWaylandPresentationSupportKHR; +#endif /* defined(VK_KHR_wayland_surface) */ +#if defined(VK_KHR_win32_surface) +extern PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR; +extern PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR; +#endif /* defined(VK_KHR_win32_surface) */ +#if defined(VK_KHR_xcb_surface) +extern PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR; +extern PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR; +#endif /* defined(VK_KHR_xcb_surface) */ +#if defined(VK_KHR_xlib_surface) +extern PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR; +extern PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPhysicalDeviceXlibPresentationSupportKHR; +#endif /* defined(VK_KHR_xlib_surface) */ +#if defined(VK_MVK_ios_surface) +extern PFN_vkCreateIOSSurfaceMVK vkCreateIOSSurfaceMVK; +#endif /* defined(VK_MVK_ios_surface) */ +#if defined(VK_MVK_macos_surface) +extern PFN_vkCreateMacOSSurfaceMVK vkCreateMacOSSurfaceMVK; +#endif /* defined(VK_MVK_macos_surface) */ +#if defined(VK_NN_vi_surface) +extern PFN_vkCreateViSurfaceNN vkCreateViSurfaceNN; +#endif /* defined(VK_NN_vi_surface) */ +#if defined(VK_NVX_binary_import) +extern PFN_vkCmdCuLaunchKernelNVX vkCmdCuLaunchKernelNVX; +extern PFN_vkCreateCuFunctionNVX vkCreateCuFunctionNVX; +extern PFN_vkCreateCuModuleNVX vkCreateCuModuleNVX; +extern PFN_vkDestroyCuFunctionNVX vkDestroyCuFunctionNVX; +extern PFN_vkDestroyCuModuleNVX vkDestroyCuModuleNVX; +#endif /* defined(VK_NVX_binary_import) */ +#if defined(VK_NVX_image_view_handle) +extern PFN_vkGetImageViewAddressNVX vkGetImageViewAddressNVX; +extern PFN_vkGetImageViewHandleNVX vkGetImageViewHandleNVX; +#endif /* defined(VK_NVX_image_view_handle) */ +#if defined(VK_NV_acquire_winrt_display) +extern PFN_vkAcquireWinrtDisplayNV vkAcquireWinrtDisplayNV; +extern PFN_vkGetWinrtDisplayNV vkGetWinrtDisplayNV; +#endif /* defined(VK_NV_acquire_winrt_display) */ +#if defined(VK_NV_clip_space_w_scaling) +extern PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV; +#endif /* defined(VK_NV_clip_space_w_scaling) */ +#if defined(VK_NV_cooperative_matrix) +extern PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV vkGetPhysicalDeviceCooperativeMatrixPropertiesNV; +#endif /* defined(VK_NV_cooperative_matrix) */ +#if defined(VK_NV_copy_memory_indirect) +extern PFN_vkCmdCopyMemoryIndirectNV vkCmdCopyMemoryIndirectNV; +extern PFN_vkCmdCopyMemoryToImageIndirectNV vkCmdCopyMemoryToImageIndirectNV; +#endif /* defined(VK_NV_copy_memory_indirect) */ +#if defined(VK_NV_coverage_reduction_mode) +extern PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV; +#endif /* defined(VK_NV_coverage_reduction_mode) */ +#if defined(VK_NV_cuda_kernel_launch) +extern PFN_vkCmdCudaLaunchKernelNV vkCmdCudaLaunchKernelNV; +extern PFN_vkCreateCudaFunctionNV vkCreateCudaFunctionNV; +extern PFN_vkCreateCudaModuleNV vkCreateCudaModuleNV; +extern PFN_vkDestroyCudaFunctionNV vkDestroyCudaFunctionNV; +extern PFN_vkDestroyCudaModuleNV vkDestroyCudaModuleNV; +extern PFN_vkGetCudaModuleCacheNV vkGetCudaModuleCacheNV; +#endif /* defined(VK_NV_cuda_kernel_launch) */ +#if defined(VK_NV_device_diagnostic_checkpoints) +extern PFN_vkCmdSetCheckpointNV vkCmdSetCheckpointNV; +extern PFN_vkGetQueueCheckpointDataNV vkGetQueueCheckpointDataNV; +#endif /* defined(VK_NV_device_diagnostic_checkpoints) */ +#if defined(VK_NV_device_generated_commands) +extern PFN_vkCmdBindPipelineShaderGroupNV vkCmdBindPipelineShaderGroupNV; +extern PFN_vkCmdExecuteGeneratedCommandsNV vkCmdExecuteGeneratedCommandsNV; +extern PFN_vkCmdPreprocessGeneratedCommandsNV vkCmdPreprocessGeneratedCommandsNV; +extern PFN_vkCreateIndirectCommandsLayoutNV vkCreateIndirectCommandsLayoutNV; +extern PFN_vkDestroyIndirectCommandsLayoutNV vkDestroyIndirectCommandsLayoutNV; +extern PFN_vkGetGeneratedCommandsMemoryRequirementsNV vkGetGeneratedCommandsMemoryRequirementsNV; +#endif /* defined(VK_NV_device_generated_commands) */ +#if defined(VK_NV_device_generated_commands_compute) +extern PFN_vkCmdUpdatePipelineIndirectBufferNV vkCmdUpdatePipelineIndirectBufferNV; +extern PFN_vkGetPipelineIndirectDeviceAddressNV vkGetPipelineIndirectDeviceAddressNV; +extern PFN_vkGetPipelineIndirectMemoryRequirementsNV vkGetPipelineIndirectMemoryRequirementsNV; +#endif /* defined(VK_NV_device_generated_commands_compute) */ +#if defined(VK_NV_external_memory_capabilities) +extern PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV vkGetPhysicalDeviceExternalImageFormatPropertiesNV; +#endif /* defined(VK_NV_external_memory_capabilities) */ +#if defined(VK_NV_external_memory_rdma) +extern PFN_vkGetMemoryRemoteAddressNV vkGetMemoryRemoteAddressNV; +#endif /* defined(VK_NV_external_memory_rdma) */ +#if defined(VK_NV_external_memory_win32) +extern PFN_vkGetMemoryWin32HandleNV vkGetMemoryWin32HandleNV; +#endif /* defined(VK_NV_external_memory_win32) */ +#if defined(VK_NV_fragment_shading_rate_enums) +extern PFN_vkCmdSetFragmentShadingRateEnumNV vkCmdSetFragmentShadingRateEnumNV; +#endif /* defined(VK_NV_fragment_shading_rate_enums) */ +#if defined(VK_NV_low_latency2) +extern PFN_vkGetLatencyTimingsNV vkGetLatencyTimingsNV; +extern PFN_vkLatencySleepNV vkLatencySleepNV; +extern PFN_vkQueueNotifyOutOfBandNV vkQueueNotifyOutOfBandNV; +extern PFN_vkSetLatencyMarkerNV vkSetLatencyMarkerNV; +extern PFN_vkSetLatencySleepModeNV vkSetLatencySleepModeNV; +#endif /* defined(VK_NV_low_latency2) */ +#if defined(VK_NV_memory_decompression) +extern PFN_vkCmdDecompressMemoryIndirectCountNV vkCmdDecompressMemoryIndirectCountNV; +extern PFN_vkCmdDecompressMemoryNV vkCmdDecompressMemoryNV; +#endif /* defined(VK_NV_memory_decompression) */ +#if defined(VK_NV_mesh_shader) +extern PFN_vkCmdDrawMeshTasksIndirectCountNV vkCmdDrawMeshTasksIndirectCountNV; +extern PFN_vkCmdDrawMeshTasksIndirectNV vkCmdDrawMeshTasksIndirectNV; +extern PFN_vkCmdDrawMeshTasksNV vkCmdDrawMeshTasksNV; +#endif /* defined(VK_NV_mesh_shader) */ +#if defined(VK_NV_optical_flow) +extern PFN_vkBindOpticalFlowSessionImageNV vkBindOpticalFlowSessionImageNV; +extern PFN_vkCmdOpticalFlowExecuteNV vkCmdOpticalFlowExecuteNV; +extern PFN_vkCreateOpticalFlowSessionNV vkCreateOpticalFlowSessionNV; +extern PFN_vkDestroyOpticalFlowSessionNV vkDestroyOpticalFlowSessionNV; +extern PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV vkGetPhysicalDeviceOpticalFlowImageFormatsNV; +#endif /* defined(VK_NV_optical_flow) */ +#if defined(VK_NV_ray_tracing) +extern PFN_vkBindAccelerationStructureMemoryNV vkBindAccelerationStructureMemoryNV; +extern PFN_vkCmdBuildAccelerationStructureNV vkCmdBuildAccelerationStructureNV; +extern PFN_vkCmdCopyAccelerationStructureNV vkCmdCopyAccelerationStructureNV; +extern PFN_vkCmdTraceRaysNV vkCmdTraceRaysNV; +extern PFN_vkCmdWriteAccelerationStructuresPropertiesNV vkCmdWriteAccelerationStructuresPropertiesNV; +extern PFN_vkCompileDeferredNV vkCompileDeferredNV; +extern PFN_vkCreateAccelerationStructureNV vkCreateAccelerationStructureNV; +extern PFN_vkCreateRayTracingPipelinesNV vkCreateRayTracingPipelinesNV; +extern PFN_vkDestroyAccelerationStructureNV vkDestroyAccelerationStructureNV; +extern PFN_vkGetAccelerationStructureHandleNV vkGetAccelerationStructureHandleNV; +extern PFN_vkGetAccelerationStructureMemoryRequirementsNV vkGetAccelerationStructureMemoryRequirementsNV; +extern PFN_vkGetRayTracingShaderGroupHandlesNV vkGetRayTracingShaderGroupHandlesNV; +#endif /* defined(VK_NV_ray_tracing) */ +#if defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 +extern PFN_vkCmdSetExclusiveScissorEnableNV vkCmdSetExclusiveScissorEnableNV; +#endif /* defined(VK_NV_scissor_exclusive) && VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION >= 2 */ +#if defined(VK_NV_scissor_exclusive) +extern PFN_vkCmdSetExclusiveScissorNV vkCmdSetExclusiveScissorNV; +#endif /* defined(VK_NV_scissor_exclusive) */ +#if defined(VK_NV_shading_rate_image) +extern PFN_vkCmdBindShadingRateImageNV vkCmdBindShadingRateImageNV; +extern PFN_vkCmdSetCoarseSampleOrderNV vkCmdSetCoarseSampleOrderNV; +extern PFN_vkCmdSetViewportShadingRatePaletteNV vkCmdSetViewportShadingRatePaletteNV; +#endif /* defined(VK_NV_shading_rate_image) */ +#if defined(VK_QCOM_tile_properties) +extern PFN_vkGetDynamicRenderingTilePropertiesQCOM vkGetDynamicRenderingTilePropertiesQCOM; +extern PFN_vkGetFramebufferTilePropertiesQCOM vkGetFramebufferTilePropertiesQCOM; +#endif /* defined(VK_QCOM_tile_properties) */ +#if defined(VK_QNX_external_memory_screen_buffer) +extern PFN_vkGetScreenBufferPropertiesQNX vkGetScreenBufferPropertiesQNX; +#endif /* defined(VK_QNX_external_memory_screen_buffer) */ +#if defined(VK_QNX_screen_surface) +extern PFN_vkCreateScreenSurfaceQNX vkCreateScreenSurfaceQNX; +extern PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX vkGetPhysicalDeviceScreenPresentationSupportQNX; +#endif /* defined(VK_QNX_screen_surface) */ +#if defined(VK_VALVE_descriptor_set_host_mapping) +extern PFN_vkGetDescriptorSetHostMappingVALVE vkGetDescriptorSetHostMappingVALVE; +extern PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE vkGetDescriptorSetLayoutHostMappingInfoVALVE; +#endif /* defined(VK_VALVE_descriptor_set_host_mapping) */ +#if (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) +extern PFN_vkCmdBindVertexBuffers2EXT vkCmdBindVertexBuffers2EXT; +extern PFN_vkCmdSetCullModeEXT vkCmdSetCullModeEXT; +extern PFN_vkCmdSetDepthBoundsTestEnableEXT vkCmdSetDepthBoundsTestEnableEXT; +extern PFN_vkCmdSetDepthCompareOpEXT vkCmdSetDepthCompareOpEXT; +extern PFN_vkCmdSetDepthTestEnableEXT vkCmdSetDepthTestEnableEXT; +extern PFN_vkCmdSetDepthWriteEnableEXT vkCmdSetDepthWriteEnableEXT; +extern PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT; +extern PFN_vkCmdSetPrimitiveTopologyEXT vkCmdSetPrimitiveTopologyEXT; +extern PFN_vkCmdSetScissorWithCountEXT vkCmdSetScissorWithCountEXT; +extern PFN_vkCmdSetStencilOpEXT vkCmdSetStencilOpEXT; +extern PFN_vkCmdSetStencilTestEnableEXT vkCmdSetStencilTestEnableEXT; +extern PFN_vkCmdSetViewportWithCountEXT vkCmdSetViewportWithCountEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) +extern PFN_vkCmdSetDepthBiasEnableEXT vkCmdSetDepthBiasEnableEXT; +extern PFN_vkCmdSetLogicOpEXT vkCmdSetLogicOpEXT; +extern PFN_vkCmdSetPatchControlPointsEXT vkCmdSetPatchControlPointsEXT; +extern PFN_vkCmdSetPrimitiveRestartEnableEXT vkCmdSetPrimitiveRestartEnableEXT; +extern PFN_vkCmdSetRasterizerDiscardEnableEXT vkCmdSetRasterizerDiscardEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state2)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) +extern PFN_vkCmdSetAlphaToCoverageEnableEXT vkCmdSetAlphaToCoverageEnableEXT; +extern PFN_vkCmdSetAlphaToOneEnableEXT vkCmdSetAlphaToOneEnableEXT; +extern PFN_vkCmdSetColorBlendEnableEXT vkCmdSetColorBlendEnableEXT; +extern PFN_vkCmdSetColorBlendEquationEXT vkCmdSetColorBlendEquationEXT; +extern PFN_vkCmdSetColorWriteMaskEXT vkCmdSetColorWriteMaskEXT; +extern PFN_vkCmdSetDepthClampEnableEXT vkCmdSetDepthClampEnableEXT; +extern PFN_vkCmdSetLogicOpEnableEXT vkCmdSetLogicOpEnableEXT; +extern PFN_vkCmdSetPolygonModeEXT vkCmdSetPolygonModeEXT; +extern PFN_vkCmdSetRasterizationSamplesEXT vkCmdSetRasterizationSamplesEXT; +extern PFN_vkCmdSetSampleMaskEXT vkCmdSetSampleMaskEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3)) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) +extern PFN_vkCmdSetTessellationDomainOriginEXT vkCmdSetTessellationDomainOriginEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && (defined(VK_KHR_maintenance2) || defined(VK_VERSION_1_1))) || (defined(VK_EXT_shader_object)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) +extern PFN_vkCmdSetRasterizationStreamEXT vkCmdSetRasterizationStreamEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_transform_feedback)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_transform_feedback)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) +extern PFN_vkCmdSetConservativeRasterizationModeEXT vkCmdSetConservativeRasterizationModeEXT; +extern PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT vkCmdSetExtraPrimitiveOverestimationSizeEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_conservative_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_conservative_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) +extern PFN_vkCmdSetDepthClipEnableEXT vkCmdSetDepthClipEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_enable)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_enable)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) +extern PFN_vkCmdSetSampleLocationsEnableEXT vkCmdSetSampleLocationsEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_sample_locations)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_sample_locations)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) +extern PFN_vkCmdSetColorBlendAdvancedEXT vkCmdSetColorBlendAdvancedEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_blend_operation_advanced)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_blend_operation_advanced)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) +extern PFN_vkCmdSetProvokingVertexModeEXT vkCmdSetProvokingVertexModeEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_provoking_vertex)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_provoking_vertex)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) +extern PFN_vkCmdSetLineRasterizationModeEXT vkCmdSetLineRasterizationModeEXT; +extern PFN_vkCmdSetLineStippleEnableEXT vkCmdSetLineStippleEnableEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_line_rasterization)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_line_rasterization)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) +extern PFN_vkCmdSetDepthClipNegativeOneToOneEXT vkCmdSetDepthClipNegativeOneToOneEXT; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_EXT_depth_clip_control)) || (defined(VK_EXT_shader_object) && defined(VK_EXT_depth_clip_control)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) +extern PFN_vkCmdSetViewportWScalingEnableNV vkCmdSetViewportWScalingEnableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_clip_space_w_scaling)) || (defined(VK_EXT_shader_object) && defined(VK_NV_clip_space_w_scaling)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) +extern PFN_vkCmdSetViewportSwizzleNV vkCmdSetViewportSwizzleNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_viewport_swizzle)) || (defined(VK_EXT_shader_object) && defined(VK_NV_viewport_swizzle)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) +extern PFN_vkCmdSetCoverageToColorEnableNV vkCmdSetCoverageToColorEnableNV; +extern PFN_vkCmdSetCoverageToColorLocationNV vkCmdSetCoverageToColorLocationNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_fragment_coverage_to_color)) || (defined(VK_EXT_shader_object) && defined(VK_NV_fragment_coverage_to_color)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) +extern PFN_vkCmdSetCoverageModulationModeNV vkCmdSetCoverageModulationModeNV; +extern PFN_vkCmdSetCoverageModulationTableEnableNV vkCmdSetCoverageModulationTableEnableNV; +extern PFN_vkCmdSetCoverageModulationTableNV vkCmdSetCoverageModulationTableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_framebuffer_mixed_samples)) || (defined(VK_EXT_shader_object) && defined(VK_NV_framebuffer_mixed_samples)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) +extern PFN_vkCmdSetShadingRateImageEnableNV vkCmdSetShadingRateImageEnableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_shading_rate_image)) || (defined(VK_EXT_shader_object) && defined(VK_NV_shading_rate_image)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) +extern PFN_vkCmdSetRepresentativeFragmentTestEnableNV vkCmdSetRepresentativeFragmentTestEnableNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_representative_fragment_test)) || (defined(VK_EXT_shader_object) && defined(VK_NV_representative_fragment_test)) */ +#if (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) +extern PFN_vkCmdSetCoverageReductionModeNV vkCmdSetCoverageReductionModeNV; +#endif /* (defined(VK_EXT_extended_dynamic_state3) && defined(VK_NV_coverage_reduction_mode)) || (defined(VK_EXT_shader_object) && defined(VK_NV_coverage_reduction_mode)) */ +#if (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) +extern PFN_vkGetImageSubresourceLayout2EXT vkGetImageSubresourceLayout2EXT; +#endif /* (defined(VK_EXT_host_image_copy)) || (defined(VK_EXT_image_compression_control)) */ +#if (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) +extern PFN_vkCmdSetVertexInputEXT vkCmdSetVertexInputEXT; +#endif /* (defined(VK_EXT_shader_object)) || (defined(VK_EXT_vertex_input_dynamic_state)) */ +#if (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) +extern PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR; +#endif /* (defined(VK_KHR_descriptor_update_template) && defined(VK_KHR_push_descriptor)) || (defined(VK_KHR_push_descriptor) && (defined(VK_VERSION_1_1) || defined(VK_KHR_descriptor_update_template))) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) +extern PFN_vkGetDeviceGroupPresentCapabilitiesKHR vkGetDeviceGroupPresentCapabilitiesKHR; +extern PFN_vkGetDeviceGroupSurfacePresentModesKHR vkGetDeviceGroupSurfacePresentModesKHR; +extern PFN_vkGetPhysicalDevicePresentRectanglesKHR vkGetPhysicalDevicePresentRectanglesKHR; +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_surface)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ +#if (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) +extern PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR; +#endif /* (defined(VK_KHR_device_group) && defined(VK_KHR_swapchain)) || (defined(VK_KHR_swapchain) && defined(VK_VERSION_1_1)) */ +/* VOLK_GENERATE_PROTOTYPES_H */ + +#ifdef __cplusplus +} +#endif + +#endif + +#ifdef VOLK_IMPLEMENTATION +#undef VOLK_IMPLEMENTATION +/* Prevent tools like dependency checkers from detecting a cyclic dependency */ +#define VOLK_SOURCE "volk.c" +#include VOLK_SOURCE +#endif + +/** + * Copyright (c) 2018-2024 Arseny Kapoulkine + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ +/* clang-format on */ diff --git a/include/RGL/Common.hpp b/include/RGL/Common.hpp index 37d7ddc..9739734 100644 --- a/include/RGL/Common.hpp +++ b/include/RGL/Common.hpp @@ -9,6 +9,7 @@ #undef NotEqual #undef GreaterOrEqual #undef Always +#undef None namespace RGL { enum class DepthCompareFunction : uint8_t { diff --git a/include/RGL/Core.hpp b/include/RGL/Core.hpp index 8d55711..ab5da37 100644 --- a/include/RGL/Core.hpp +++ b/include/RGL/Core.hpp @@ -41,13 +41,14 @@ namespace RGL { Fatal }; - using callback_t = std::function; - using fatal_callback_t = std::function; + using callback_t = void(*)(MessageSeverity, const std::string&, void*); + using fatal_callback_t = void(*)(const std::string&, void*); struct InitOptions { API api = API::PlatformDefault; // what graphics API to use - callback_t callback; // what function to invoke with debug messages - fatal_callback_t fatal_callback; // what function to invoke when a non-recoverable error occurs + callback_t callback = nullptr; // what function to invoke with debug messages + fatal_callback_t fatal_callback = nullptr; // what function to invoke when a non-recoverable error occurs + void* callbackUserData = nullptr; std::string appName; // Name of your app. Used only on Vulkan. std::string engineName; // Name of your game engine. Used only on Vulkan. diff --git a/include/RGL/RenderPass.hpp b/include/RGL/RenderPass.hpp index 450b4ad..5050de1 100644 --- a/include/RGL/RenderPass.hpp +++ b/include/RGL/RenderPass.hpp @@ -19,7 +19,7 @@ struct RenderPassConfig { LoadAccessOperation stencilLoadOp = LoadAccessOperation::DontCare; StoreAccessOperation stencilStoreOp = StoreAccessOperation::DontCare; - std::array clearColor{ 0,0,0, 1 }; + std::array clearColor{ 0,0,0,0}; }; std::vector attachments; diff --git a/include/RGL/Texture.hpp b/include/RGL/Texture.hpp index ad1b99d..d80597f 100644 --- a/include/RGL/Texture.hpp +++ b/include/RGL/Texture.hpp @@ -8,7 +8,7 @@ #include "SubresourceRange.hpp" #if RGL_VK_AVAILABLE -#include +#include #endif #if RGL_WEBGPU_AVAILABLE diff --git a/include/RGL/TextureFormat.hpp b/include/RGL/TextureFormat.hpp index b0246c1..f09acd3 100644 --- a/include/RGL/TextureFormat.hpp +++ b/include/RGL/TextureFormat.hpp @@ -25,9 +25,9 @@ namespace RGL { }; - enum class TextureFormat { - Undefined, - BGRA8_Unorm, + enum class TextureFormat { + Undefined, + BGRA8_Unorm, RGBA8_Uint, RGBA8_Unorm, RGBA16_Unorm, @@ -35,6 +35,8 @@ namespace RGL { RGBA16_Sfloat, RGBA32_Sfloat, + R8_Uint, + R16_Float, R32_Uint, R32_Float, diff --git a/src/D3D12Buffer.cpp b/src/D3D12Buffer.cpp index b46932f..34c4b6e 100644 --- a/src/D3D12Buffer.cpp +++ b/src/D3D12Buffer.cpp @@ -49,6 +49,7 @@ namespace RGL { // decide the heap type if (config.access == RGL::BufferAccess::Shared) { + heapProperties = CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_UPLOAD); canBeTransitioned = false; nativeState = D3D12_RESOURCE_STATE_GENERIC_READ; // UPLOAD requires this state, and resources cannot leave this state @@ -117,7 +118,6 @@ namespace RGL { }; buffer->Unmap(0, &range); mappedMemory.data = nullptr; - mappedMemory.size = 0; } void BufferD3D12::UpdateBufferData(untyped_span data, decltype(BufferConfig::nElements) offset) { diff --git a/src/D3D12Buffer.hpp b/src/D3D12Buffer.hpp index aabe796..668e403 100644 --- a/src/D3D12Buffer.hpp +++ b/src/D3D12Buffer.hpp @@ -2,9 +2,9 @@ #define NOMINMAX #include #include +#include #include "RGLD3D12.hpp" #include "D3D12TrackedResource.hpp" -#include #include #include diff --git a/src/D3D12CommandBuffer.cpp b/src/D3D12CommandBuffer.cpp index 67b337c..46c37d9 100644 --- a/src/D3D12CommandBuffer.cpp +++ b/src/D3D12CommandBuffer.cpp @@ -255,14 +255,15 @@ namespace RGL { { SetFragmentTexture(texture, index); } + + constexpr static auto depthReadState = D3D12_RESOURCE_STATE_DEPTH_READ | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE; + + constexpr static auto colorReadState = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE; + void CommandBufferD3D12::SetFragmentTexture(const TextureView& texture, uint32_t index) { auto& thisTexture = texture.texture.dx; - constexpr static auto depthReadState = D3D12_RESOURCE_STATE_DEPTH_READ | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE; - - constexpr static auto colorReadState = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE; - auto neededState = thisTexture.dsvAllocated() ? depthReadState : colorReadState; @@ -299,6 +300,11 @@ namespace RGL { } void CommandBufferD3D12::UseResource(const TextureView& view){ + auto& thisTexture = view.texture.dx; + + auto neededState = thisTexture.dsvAllocated() ? depthReadState : colorReadState; + + SyncIfNeeded(thisTexture, neededState, false); } diff --git a/src/D3D12CommandBuffer.hpp b/src/D3D12CommandBuffer.hpp index 9937d62..ba4eda1 100644 --- a/src/D3D12CommandBuffer.hpp +++ b/src/D3D12CommandBuffer.hpp @@ -4,7 +4,7 @@ #include #include "RGLD3D12.hpp" #include "D3D12TrackedResource.hpp" -#include +#include #include #include diff --git a/src/D3D12CommandQueue.hpp b/src/D3D12CommandQueue.hpp index d80aafb..2b52bcf 100644 --- a/src/D3D12CommandQueue.hpp +++ b/src/D3D12CommandQueue.hpp @@ -3,7 +3,7 @@ #include #include -#include // For ID3D12CommandQueue, ID3D12Device2, and ID3D12Fence +#include // For ID3D12CommandQueue, ID3D12Device2, and ID3D12Fence #include // For Microsoft::WRL::ComPtr #include // For uint64_t diff --git a/src/D3D12ComputePipeline.hpp b/src/D3D12ComputePipeline.hpp index 2d31064..179a903 100644 --- a/src/D3D12ComputePipeline.hpp +++ b/src/D3D12ComputePipeline.hpp @@ -2,7 +2,7 @@ #define NOMINMAX #include #include -#include +#include #include #include "RGLD3D12.hpp" #include "D3D12PipelineShared.hpp" diff --git a/src/D3D12Device.cpp b/src/D3D12Device.cpp index e5dd028..0ff2429 100644 --- a/src/D3D12Device.cpp +++ b/src/D3D12Device.cpp @@ -16,6 +16,11 @@ #include #include +#if __has_include() +#include +#define PIX_ENABLED 1 +#endif + #define WIN32_LEAN_AND_MEAN #include @@ -82,9 +87,11 @@ namespace RGL { ComPtr pInfoQueue; if (SUCCEEDED(d3d12Device2.As(&pInfoQueue))) { - pInfoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_CORRUPTION, TRUE); - pInfoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_ERROR, TRUE); - pInfoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_WARNING, TRUE); + if (!PIXIsAttachedForGpuCapture()) { // these can screw with PIX captures + pInfoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_CORRUPTION, TRUE); + pInfoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_ERROR, TRUE); + pInfoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_WARNING, TRUE); + } // Suppress whole categories of messages // uncomment to provide some //D3D12_MESSAGE_CATEGORY Categories[] = {}; diff --git a/src/D3D12Device.hpp b/src/D3D12Device.hpp index 69ab9bf..2c79114 100644 --- a/src/D3D12Device.hpp +++ b/src/D3D12Device.hpp @@ -4,7 +4,7 @@ #include #include #include "D3D12DynamicDescriptorHeap.hpp" -#include +#include #include #include diff --git a/src/D3D12DynamicDescriptorHeap.hpp b/src/D3D12DynamicDescriptorHeap.hpp index c6364cf..ce61137 100644 --- a/src/D3D12DynamicDescriptorHeap.hpp +++ b/src/D3D12DynamicDescriptorHeap.hpp @@ -2,7 +2,7 @@ #define NOMINMAX #include #include -#include +#include #include #include "FreeList.hpp" diff --git a/src/D3D12RenderPipeline.cpp b/src/D3D12RenderPipeline.cpp index b2c32cd..f6151ce 100644 --- a/src/D3D12RenderPipeline.cpp +++ b/src/D3D12RenderPipeline.cpp @@ -203,12 +203,12 @@ namespace RGL { auto& range = ranges.emplace_back(D3D12_DESCRIPTOR_RANGE1{ .RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV, .NumDescriptors = item.count, - .BaseShaderRegister = item.binding, - .RegisterSpace = item.isBindless ? 1u : 0u, + .BaseShaderRegister = item.isBindless ? 0 : item.binding, + .RegisterSpace = item.isBindless ? item.binding : 0u, .Flags = D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE, .OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND, }); - textureBindingToRootSlot[{item.binding, item.isBindless ? 1u : 0u}] = { uint32_t(rootParameters.size()), false }; + textureBindingToRootSlot[{item.binding, item.isBindless ? item.binding : 0u}] = { uint32_t(rootParameters.size()), false }; rootParameters.emplace_back().InitAsDescriptorTable(1, &range); } break; @@ -238,11 +238,11 @@ namespace RGL { case decltype(item.type)::UniformBuffer: if (item.writable){ bufferBindingToRootSlot[item.binding] = { static_cast(rootParameters.size()), true }; - rootParameters.emplace_back().InitAsUnorderedAccessView(item.binding, 0); + rootParameters.emplace_back().InitAsUnorderedAccessView(item.binding, 0, D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE); } else { bufferBindingToRootSlot[item.binding] = { static_cast(rootParameters.size()), false }; - rootParameters.emplace_back().InitAsShaderResourceView(item.binding, 0); + rootParameters.emplace_back().InitAsShaderResourceView(item.binding, 0, D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE); } break; diff --git a/src/D3D12RenderPipeline.hpp b/src/D3D12RenderPipeline.hpp index 1114cdf..36f8956 100644 --- a/src/D3D12RenderPipeline.hpp +++ b/src/D3D12RenderPipeline.hpp @@ -3,7 +3,7 @@ #include #include #include "RGLD3D12.hpp" -#include +#include #include #include #include @@ -66,7 +66,7 @@ namespace RGL { } auto slotForTextureIdx(uint32_t bindingPos, bool isBindless) { - return textureBindingToRootSlot.at({ bindingPos, isBindless? 1u : 0u }); + return textureBindingToRootSlot.at({ bindingPos, isBindless? bindingPos : 0u }); } bool bufferIdxIsUAV(uint32_t bindingPos) { diff --git a/src/D3D12ShaderLibrary.hpp b/src/D3D12ShaderLibrary.hpp index 6362c4a..9ef644e 100644 --- a/src/D3D12ShaderLibrary.hpp +++ b/src/D3D12ShaderLibrary.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include "RGLD3D12.hpp" #include "D3D12PipelineShared.hpp" diff --git a/src/D3D12Swapchain.cpp b/src/D3D12Swapchain.cpp index 1a1344c..d5cc0a3 100644 --- a/src/D3D12Swapchain.cpp +++ b/src/D3D12Swapchain.cpp @@ -2,7 +2,7 @@ #include "D3D12Swapchain.hpp" #include "D3D12Surface.hpp" #include -#include +#include #include "D3D12Device.hpp" #include "D3D12CommandQueue.hpp" #include diff --git a/src/D3D12Swapchain.hpp b/src/D3D12Swapchain.hpp index d3d5057..b0df0a8 100644 --- a/src/D3D12Swapchain.hpp +++ b/src/D3D12Swapchain.hpp @@ -4,7 +4,7 @@ #include #include "D3D12DynamicDescriptorHeap.hpp" #include "RGLD3D12.hpp" -#include +#include #include namespace RGL { diff --git a/src/D3D12Synchronization.hpp b/src/D3D12Synchronization.hpp index 31571fc..0ced4d3 100644 --- a/src/D3D12Synchronization.hpp +++ b/src/D3D12Synchronization.hpp @@ -3,7 +3,7 @@ #include #include #include "RGLD3D12.hpp" -#include +#include namespace RGL { struct DeviceD3D12; diff --git a/src/D3D12Texture.hpp b/src/D3D12Texture.hpp index 62be175..35c4680 100644 --- a/src/D3D12Texture.hpp +++ b/src/D3D12Texture.hpp @@ -1,10 +1,9 @@ #pragma once -#define NOMINMAX #include #include #include "RGLD3D12.hpp" #include "D3D12TrackedResource.hpp" -#include +#include #include #undef max diff --git a/src/D3D12TrackedResource.hpp b/src/D3D12TrackedResource.hpp index 0b6ffe3..fba7243 100644 --- a/src/D3D12TrackedResource.hpp +++ b/src/D3D12TrackedResource.hpp @@ -1,5 +1,5 @@ #pragma once -#include +#include namespace RGL { diff --git a/src/MTLCommandBuffer.mm b/src/MTLCommandBuffer.mm index f81f82b..d770d16 100644 --- a/src/MTLCommandBuffer.mm +++ b/src/MTLCommandBuffer.mm @@ -136,8 +136,15 @@ uint32_t bytesPerPixel(MTLPixelFormat format){ indexBuffer = nullptr; } +// avoid allocating this every frame +static MTLCommandBufferDescriptor* desc = [MTLCommandBufferDescriptor new]; + + void CommandBufferMTL::Begin(){ - currentCommandBuffer = [owningQueue->commandQueue commandBuffer]; +#ifndef NDEBUG +desc.errorOptions = MTLCommandBufferErrorOptionEncoderExecutionStatus; +#endif + currentCommandBuffer = [owningQueue->commandQueue commandBufferWithDescriptor:desc]; } void CommandBufferMTL::End(){ @@ -286,7 +293,7 @@ uint32_t bytesPerPixel(MTLPixelFormat format){ void CommandBufferMTL::SetVertexTexture(const TextureView& view, uint32_t index){ if (view.texture.mtl.representsBindless){ - [currentCommandEncoder setVertexBuffer:owningQueue->owningDevice->globalTextureBuffer offset:0 atIndex:bindlessOffset]; + [currentCommandEncoder setVertexBuffer:owningQueue->owningDevice->globalTextureBuffer offset:0 atIndex:index]; return; } @@ -295,7 +302,7 @@ uint32_t bytesPerPixel(MTLPixelFormat format){ } void CommandBufferMTL::SetFragmentTexture(const TextureView& view, uint32_t index){ if (view.texture.mtl.representsBindless){ - [currentCommandEncoder setFragmentBuffer:owningQueue->owningDevice->globalTextureBuffer offset:0 atIndex:bindlessOffset]; + [currentCommandEncoder setFragmentBuffer:owningQueue->owningDevice->globalTextureBuffer offset:0 atIndex:index]; return; } @@ -304,7 +311,7 @@ uint32_t bytesPerPixel(MTLPixelFormat format){ } void CommandBufferMTL::SetComputeTexture(const TextureView& view, uint32_t index){ if (view.texture.mtl.representsBindless){ - [currentComputeCommandEncoder setBuffer:owningQueue->owningDevice->globalTextureBuffer offset:0 atIndex:bindlessOffset]; + [currentComputeCommandEncoder setBuffer:owningQueue->owningDevice->globalTextureBuffer offset:0 atIndex:index]; return; } @@ -427,6 +434,13 @@ uint32_t bytesPerPixel(MTLPixelFormat format){ void CommandBufferMTL::BlockUntilCompleted() { [currentCommandBuffer waitUntilCompleted]; + if (auto err = currentCommandBuffer.error){ + if (NSArray* encoderInfos = err.userInfo[MTLCommandBufferEncoderInfoErrorKey]){ + for(auto info in encoderInfos){ + + } + } + } } } diff --git a/src/RGL.cpp b/src/RGL.cpp index 6c3f3ff..5915470 100644 --- a/src/RGL.cpp +++ b/src/RGL.cpp @@ -38,7 +38,9 @@ STATIC(RGL::currentAPI) = API::Uninitialized; namespace RGL { - static callback_t callbackFn = [](MessageSeverity severity, const std::string& message) { + static void* callbackUserData = nullptr; + + static void defaultCallbackFn(MessageSeverity severity, const std::string& message, void* userData) { constexpr auto severityToStr = [](MessageSeverity severity) { switch (severity) { case MessageSeverity::Info: @@ -51,17 +53,20 @@ namespace RGL { return "Fatal"; } }; - std::cout << "RGL [" << severityToStr(severity) << "] - " << message << "\n"; #if _WIN32 std::string str = std::format("RGL [{}] - {}\n", severityToStr(severity), message); OutputDebugStringA(str.c_str()); #endif - }; + } + + static callback_t callbackFn = defaultCallbackFn; - static fatal_callback_t fatalCallbackFn = [](const std::string& message) { + static void defaultFatalCallbackFn(const std::string& message, void* userData) { throw std::runtime_error(message); - }; + } + + static fatal_callback_t fatalCallbackFn = defaultFatalCallbackFn; RGLDevicePtr RGL::IDevice::CreateSystemDefaultDevice() { @@ -95,6 +100,8 @@ namespace RGL { void Init(const InitOptions& options) { + callbackUserData = options.callbackUserData; + if (options.callback) { callbackFn = options.callback; } @@ -204,12 +211,12 @@ namespace RGL { } void LogMessage(MessageSeverity severity, const std::string& str) { - callbackFn(severity, str); + callbackFn(severity, str, callbackUserData); // crash the program // the user should not try to catch this, UB lies beyond if (severity == MessageSeverity::Fatal) { - fatalCallbackFn(str); + fatalCallbackFn(str, callbackUserData); } } void FatalError(const std::string& str) { diff --git a/src/RGLD3D12.hpp b/src/RGLD3D12.hpp index f2f2767..fd5150a 100644 --- a/src/RGLD3D12.hpp +++ b/src/RGLD3D12.hpp @@ -1,5 +1,4 @@ #pragma once -#define NOMINMAX #include #include #include @@ -9,7 +8,7 @@ #include #include #include -#include +#include //#define REFL_ENABLED diff --git a/src/RGLD3D12Common.cpp b/src/RGLD3D12Common.cpp index 6b09611..ad96ab1 100644 --- a/src/RGLD3D12Common.cpp +++ b/src/RGLD3D12Common.cpp @@ -11,8 +11,15 @@ #include #include +#if __has_include() +#include +#define PIX_ENABLED 1 +#endif + #define DX12_USE_AGILITY 1 +#define TDR_PIX_CAPTURE 0 + // Exports for the Agility SDK. For Windows 10 users, Go here: https://www.nuget.org/packages/Microsoft.Direct3D.D3D12/1.614.0 then unzip it, and place // D3D12Core.dll and d3d12SDKLayers.dll in a folder named D3D12 next to the executable. @@ -130,8 +137,7 @@ constexpr std::string_view D3D12AutoBreadcrumbOpToString(D3D12_AUTO_BREADCRUMB_O case D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA: return "RESOLVEENCODEROUTPUTMETADATA"; default: - FatalError("Invalid D3D12_AUTO_BREADCRUMB_OP"); - return ""; + return "Unknown D3D12_AUTO_BREADCRUMB_OP"; } } @@ -197,8 +203,7 @@ constexpr std::string_view D3D12_DRED_ALLOCATION_TYPE_to_string(D3D12_DRED_ALLOC case D3D12_DRED_ALLOCATION_TYPE_INVALID: return "INVALID"; default: - FatalError("Invalid D3D12_DRED_ALLOCATION_TYPE"); - return ""; + return "Unknown D3D12_DRED_ALLOCATION_TYPE"; } } @@ -210,13 +215,18 @@ void debugLog(const std::string_view str) { namespace RGL { void RGLDeviceRemovedHandler(PVOID context, BOOLEAN) { -#if defined(_DEBUG) ID3D12Device* pDevice = (ID3D12Device*)context; auto reason = pDevice->GetDeviceRemovedReason(); if (reason == S_OK) { return; // proper shutdown, no need to go further } + +#if PIX_ENABLED && TDR_PIX_CAPTURE + PIXEndCapture(FALSE); +#endif +#if defined(_DEBUG) + #if _UWP OutputDebugStringW(_com_error(reason, nullptr).ErrorMessage()); #else @@ -328,6 +338,17 @@ namespace RGL { #ifdef REFL_ENABLED DxcCreateInstance(CLSID_DxcUtils, IID_PPV_ARGS(&dxcUtilsPtr)); #endif + +#if PIX_ENABLED && TDR_PIX_CAPTURE + auto lib = PIXLoadLatestWinPixGpuCapturerLibrary(); + Assert(lib != nullptr, "Failed to load PIX library"); + PIXCaptureParameters params{ + .GpuCaptureParameters = { + .FileName = L"TDRCap.pix", + } + }; + DX_CHECK(PIXBeginCapture(PIX_CAPTURE_GPU, ¶ms)); +#endif } void RGL::DeintD3D12() @@ -364,6 +385,8 @@ namespace RGL { case decltype(format)::RGBA16_Sfloat: return DXGI_FORMAT_R16G16B16A16_FLOAT; case decltype(format)::RGBA32_Sfloat: return DXGI_FORMAT_R32G32B32A32_FLOAT; + case decltype(format)::R8_Uint: return DXGI_FORMAT_R8_UINT; + case decltype(format)::R16_Float: return DXGI_FORMAT_R16_FLOAT; case decltype(format)::R32_Uint: return DXGI_FORMAT_R32_UINT; case decltype(format)::R32_Float: return DXGI_FORMAT_R32_FLOAT; diff --git a/src/RGLMTLCommon.mm b/src/RGLMTLCommon.mm index 84da1bd..5b86385 100644 --- a/src/RGLMTLCommon.mm +++ b/src/RGLMTLCommon.mm @@ -28,6 +28,8 @@ MTLPixelFormat rgl2mtlformat(TextureFormat format){ case decltype(format)::RGBA32_Sfloat: return MTLPixelFormatRGBA32Float; case decltype(format)::RGBA16_Snorm: return MTLPixelFormatRGBA16Snorm; case decltype(format)::RGBA16_Sfloat: return MTLPixelFormatRGBA16Float; + case decltype(format)::R8_Uint: return MTLPixelFormatR8Uint; + case decltype(format)::R16_Float: return MTLPixelFormatR16Float; case decltype(format)::R32_Uint: return MTLPixelFormatR32Uint; case decltype(format)::R32_Float: return MTLPixelFormatR32Float; #if !TARGET_OS_IPHONE diff --git a/src/RGLVk.hpp b/src/RGLVk.hpp index 8cb6d51..3cebdc8 100644 --- a/src/RGLVk.hpp +++ b/src/RGLVk.hpp @@ -7,8 +7,7 @@ #include "RGLCommon.hpp" #include #include -#include -#include +#include #if __has_include() #include #endif @@ -17,11 +16,13 @@ #endif #include +struct VmaAllocation_T; + #define VK_CHECK(a) {auto VK_CHECK_RESULT = a; Assert(VK_CHECK_RESULT == VK_SUCCESS, std::string("Vulkan assertion failed: ") + # a + " -> " + string_VkResult(VK_CHECK_RESULT));} #define VK_VALID(a) {assert(a != VK_NULL_HANDLE);} constexpr bool enableValidationLayers = -#ifdef NDEBUG +#if defined(NDEBUG) || defined(ANDROID) // we don't use the built-in validation layers on Android. Use the external layers: https://developer.android.com/ndk/guides/graphics/validation-layer false; #else true; @@ -60,7 +61,7 @@ namespace RGL { uint32_t findMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties, VkPhysicalDevice physicalDevice); - VmaAllocation createBuffer(DeviceVk*, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer& buffer); + VmaAllocation_T* createBuffer(DeviceVk*, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer& buffer); VkCommandBuffer beginSingleTimeCommands(VkDevice device, VkCommandPool commandPool); void endSingleTimeCommands(VkCommandBuffer commandBuffer, VkQueue graphicsQueue, VkDevice device, VkCommandPool commandPool); diff --git a/src/RGLVkCommon.cpp b/src/RGLVkCommon.cpp index b0de73a..432112b 100644 --- a/src/RGLVkCommon.cpp +++ b/src/RGLVkCommon.cpp @@ -6,6 +6,7 @@ #include "VkDevice.hpp" #include #include +#include STATIC(RGL::instance) = VK_NULL_HANDLE; @@ -72,6 +73,9 @@ namespace RGL { Assert(CanInitAPI(RGL::API::Vulkan), "Vulkan cannot be initialized on this platform."); RGL::currentAPI = API::Vulkan; + // load Volk + VK_CHECK(volkInitialize()); + // create the vulkan instance VkApplicationInfo appInfo{ .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, @@ -104,7 +108,7 @@ namespace RGL { return strcmp(layerName, layerProperties.layerName) == 0; } ) == availableLayers.end()) { - throw std::runtime_error(std::string("required validation layer not found: ") + layerName); + FatalError(std::string("required validation layer not found: ") + layerName); } } instanceCreateInfo.enabledLayerCount = std::size(validationLayers); @@ -138,6 +142,8 @@ namespace RGL { // init vulkan VK_CHECK(vkCreateInstance(&instanceCreateInfo, nullptr, &instance)); + volkLoadInstance(instance); + // setup the debug messenger if constexpr (enableValidationLayers) { VkDebugUtilsMessengerCreateInfoEXT debugCreateInfo{ @@ -210,7 +216,7 @@ namespace RGL { } } - throw std::runtime_error("failed to find suitable memory type!"); + FatalError("findMemoryType(): failed to find suitable memory type!"); } VmaAllocation createBuffer(DeviceVk* rgldevice, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer& buffer) { @@ -292,6 +298,8 @@ namespace RGL { case decltype(format)::RGBA16_Sfloat: return VK_FORMAT_R16G16B16A16_SFLOAT; case decltype(format)::RGBA32_Sfloat: return VK_FORMAT_R16G16B16A16_SFLOAT; + case decltype(format)::R8_Uint: return VK_FORMAT_R8_UINT; + case decltype(format)::R16_Float: return VK_FORMAT_R16_SFLOAT; case decltype(format)::R32_Uint: return VK_FORMAT_R32_UINT; case decltype(format)::R32_Float: return VK_FORMAT_R32_SFLOAT; diff --git a/src/Texture.cpp b/src/Texture.cpp index 9d3ff94..a524a98 100644 --- a/src/Texture.cpp +++ b/src/Texture.cpp @@ -7,6 +7,7 @@ #include "MTLTexture.hpp" #endif #include +#include "RGLCommon.hpp" namespace RGL { uint32_t TextureView::GetReadonlyBindlessTextureHandle() { @@ -25,7 +26,7 @@ namespace RGL { return static_cast(texture.mtl.texture)->globalIndex; #endif default: - throw std::runtime_error("Current backend does not support bindless texturing."); + FatalError("Current backend does not support bindless texturing."); } return 0; } diff --git a/src/VkBuffer.cpp b/src/VkBuffer.cpp index 86ce412..c7771ec 100644 --- a/src/VkBuffer.cpp +++ b/src/VkBuffer.cpp @@ -2,6 +2,7 @@ #include "VkBuffer.hpp" #include "VkDevice.hpp" #include "RGLVk.hpp" +#include #include namespace RGL { @@ -52,7 +53,7 @@ namespace RGL { allocation = createBuffer(owningDevice.get(), config.nElements * config.stride, usage, memprop, buffer); if (config.options.debugName) { - owningDevice->SetDebugNameForResource((void*)buffer, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, config.options.debugName); + owningDevice->SetDebugNameForResource((void*)buffer, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, config.options.debugName); #ifndef NDEBUG debugName = config.options.debugName; #endif diff --git a/src/VkBuffer.hpp b/src/VkBuffer.hpp index a8150a8..de0cd0e 100644 --- a/src/VkBuffer.hpp +++ b/src/VkBuffer.hpp @@ -3,19 +3,20 @@ #include #include #include -#include -#include +#include #ifndef NDEBUG #include #endif +struct VmaAllocation_T; + namespace RGL { struct DeviceVk; struct BufferVk : public IBuffer { const std::shared_ptr owningDevice; VkBuffer buffer = VK_NULL_HANDLE; - VmaAllocation allocation = VK_NULL_HANDLE; + VmaAllocation_T* allocation = VK_NULL_HANDLE; const RGL::BufferAccess accessType; MutableSpan mappedMemory; diff --git a/src/VkCommandBuffer.cpp b/src/VkCommandBuffer.cpp index 160824d..f76f610 100644 --- a/src/VkCommandBuffer.cpp +++ b/src/VkCommandBuffer.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace RGL { VkAttachmentLoadOp RGL2LoadOp(LoadAccessOperation op) { @@ -216,6 +217,7 @@ namespace RGL { auto vktexture = static_cast(texture.parent); + // are we bindless? if (vktexture == nullptr) { EncodeCommand(CmdBindlessSetTexture{ @@ -702,12 +704,17 @@ namespace RGL { bool isCompute = currentRenderPipeline ? false : true; auto activeLayout = isCompute ? currentComputePipeline->pipelineLayout : currentRenderPipeline->pipelineLayout; + VkDescriptorSet sets[] = { + arg.set, + arg.set + }; + vkCmdBindDescriptorSets(commandBuffer, isCompute ? VK_PIPELINE_BIND_POINT_COMPUTE : VK_PIPELINE_BIND_POINT_GRAPHICS, activeLayout->layout, - 1, - 1, - & arg.set, + 1, // first set index + std::size(sets), // number of sets + sets, 0, nullptr ); diff --git a/src/VkCommandBuffer.hpp b/src/VkCommandBuffer.hpp index 20d9c4d..98bf683 100644 --- a/src/VkCommandBuffer.hpp +++ b/src/VkCommandBuffer.hpp @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include #include "RGLVk.hpp" #include #include diff --git a/src/VkCommandQueue.hpp b/src/VkCommandQueue.hpp index 879bdf6..3faafe9 100644 --- a/src/VkCommandQueue.hpp +++ b/src/VkCommandQueue.hpp @@ -2,7 +2,7 @@ #include #include #include "VkSynchronization.hpp" -#include +#include #include namespace RGL { diff --git a/src/VkDevice.cpp b/src/VkDevice.cpp index 12ac0d6..ded2590 100644 --- a/src/VkDevice.cpp +++ b/src/VkDevice.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include namespace RGL { @@ -30,7 +30,9 @@ namespace RGL { VK_KHR_SWAPCHAIN_EXTENSION_NAME, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, +#if !__ANDROID__ // only 5% of android devices have this extension so we have to go without it VK_EXT_MEMORY_BUDGET_EXTENSION_NAME, +#endif }; auto getMissingDeviceExtensions(const VkPhysicalDevice device) { @@ -243,6 +245,7 @@ namespace RGL { } #endif + //volkLoadDevice(device); // load extra functions loadVulkanFunction(device, vkCmdPushDescriptorSetKHR, "vkCmdPushDescriptorSetKHR"); @@ -262,6 +265,36 @@ namespace RGL { }; VK_CHECK(vkCreateCommandPool(device, &poolInfo, nullptr, &commandPool)); + // otherwise it doesn't know about volk + VmaVulkanFunctions volk_functions{ + vkGetInstanceProcAddr, + vkGetDeviceProcAddr, + vkGetPhysicalDeviceProperties, + vkGetPhysicalDeviceMemoryProperties, + vkAllocateMemory, + vkFreeMemory, + vkMapMemory, + vkUnmapMemory, + vkFlushMappedMemoryRanges, + vkInvalidateMappedMemoryRanges, + vkBindBufferMemory, + vkBindImageMemory, + vkGetBufferMemoryRequirements, + vkGetImageMemoryRequirements, + vkCreateBuffer, + vkDestroyBuffer, + vkCreateImage, + vkDestroyImage, + vkCmdCopyBuffer, + vkGetBufferMemoryRequirements2, + vkGetImageMemoryRequirements2, + vkBindBufferMemory2, + vkBindImageMemory2, + vkGetPhysicalDeviceMemoryProperties2, + vkGetDeviceBufferMemoryRequirements, + vkGetDeviceImageMemoryRequirements + }; + VmaAllocatorCreateInfo allocInfo{ .flags = VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT | VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT, .physicalDevice = physicalDevice, @@ -270,7 +303,7 @@ namespace RGL { .pAllocationCallbacks = nullptr, .pDeviceMemoryCallbacks = nullptr, .pHeapSizeLimit = nullptr, - .pVulkanFunctions = nullptr, + .pVulkanFunctions = &volk_functions, .instance = RGL::instance, .vulkanApiVersion = VK_API_VERSION_1_3, .pTypeExternalMemoryHandleTypes = nullptr, @@ -470,17 +503,34 @@ namespace RGL { } size_t DeviceVk::GetTotalVRAM() const { - VmaBudget budgets; - vmaGetHeapBudgets(vkallocator, &budgets); + VkPhysicalDeviceMemoryProperties memprop{}; + vkGetPhysicalDeviceMemoryProperties(physicalDevice, &memprop); + + stackarray(budgets, VmaBudget, memprop.memoryHeapCount); + + vmaGetHeapBudgets(vkallocator, budgets); - return budgets.budget; + size_t budget = 0; + for (int i = 0; i < memprop.memoryHeapCount; i++) { + budget += budgets[i].budget; + } + + return budget; } size_t DeviceVk::GetCurrentVRAMInUse() const { - VmaBudget budgets; - vmaGetHeapBudgets(vkallocator, &budgets); + VkPhysicalDeviceMemoryProperties memprop{}; + vkGetPhysicalDeviceMemoryProperties(physicalDevice, &memprop); + stackarray(budgets, VmaBudget, memprop.memoryHeapCount); + + vmaGetHeapBudgets(vkallocator, budgets); + + size_t budget = 0; + for (int i = 0; i < memprop.memoryHeapCount; i++) { + budget += budgets[i].usage; + } - return budgets.usage; + return budget; } } diff --git a/src/VkDevice.hpp b/src/VkDevice.hpp index 02930ad..9e5c7a8 100644 --- a/src/VkDevice.hpp +++ b/src/VkDevice.hpp @@ -3,13 +3,14 @@ #include #include #include -#include +#include #include -#include #include "FreeList.hpp" #undef CreateSemaphore +struct VmaAllocator_T; + namespace RGL { struct QueueFamilyIndices { std::optional graphicsFamily; @@ -25,7 +26,7 @@ namespace RGL { QueueFamilyIndices indices; VkQueue presentQueue = VK_NULL_HANDLE; // do not need to be destroyed VkCommandPool commandPool = VK_NULL_HANDLE; - VmaAllocator vkallocator; + VmaAllocator_T* vkallocator; PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR = nullptr; // device-tied extension function PFN_vkDebugMarkerSetObjectNameEXT rgl_vkDebugMarkerSetObjectNameEXT = nullptr; diff --git a/src/VkRenderPipeline.cpp b/src/VkRenderPipeline.cpp index 8fd01ed..2dbdbfc 100644 --- a/src/VkRenderPipeline.cpp +++ b/src/VkRenderPipeline.cpp @@ -270,12 +270,14 @@ namespace RGL { layoutbindings.reserve(desc.bindings.size()); bool bindlessNeeded = false; + uint32_t nBindless = 0; for (const auto& binding : desc.bindings) { const auto type = static_cast(binding.type); const auto stageFlags = static_cast(binding.stageFlags); if (binding.isBindless) { bindlessNeeded = true; + nBindless++; continue; } layoutbindings.push_back( @@ -312,11 +314,13 @@ namespace RGL { pushconstants[i].stageFlags = flags; } - uint32_t nLayouts = bindlessNeeded ? 2 : 1; + uint32_t nLayouts = bindlessNeeded ? nBindless + 1 : 1; stackarray(setLayouts, VkDescriptorSetLayout, nLayouts); setLayouts[0] = descriptorSetLayout; if (bindlessNeeded) { - setLayouts[1] = owningDevice->globalDescriptorSetLayout; + for (uint32_t i = 1; i < nBindless + 1; i++) { + setLayouts[i] = owningDevice->globalDescriptorSetLayout; + } } diff --git a/src/VkSampler.hpp b/src/VkSampler.hpp index 7822a1d..2ad77d8 100644 --- a/src/VkSampler.hpp +++ b/src/VkSampler.hpp @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include #include namespace RGL { struct DeviceVk; diff --git a/src/VkShaderLibrary.cpp b/src/VkShaderLibrary.cpp index 957115b..11aa972 100644 --- a/src/VkShaderLibrary.cpp +++ b/src/VkShaderLibrary.cpp @@ -13,7 +13,7 @@ static std::vector readFile(const std::filesystem::path& filename) { std::ifstream file(filename, std::ios::ate | std::ios::binary); if (!file.is_open()) { - throw std::runtime_error(std::string("failed to open {}") + filename.string()); + RGL::FatalError(std::string("failed to open {}") + filename.string()); } size_t fileSize = (size_t)file.tellg(); @@ -37,7 +37,7 @@ namespace RGL { SpvReflectShaderModule spvModule; SpvReflectResult result = spvReflectCreateShaderModule(code.size_bytes(), code.data(), &spvModule); if (result != SPV_REFLECT_RESULT_SUCCESS) { - throw std::runtime_error("SPIRV reflection capture failed"); + FatalError("SPIRV reflection capture failed"); } diff --git a/src/VkShaderLibrary.hpp b/src/VkShaderLibrary.hpp index 5b8a4ce..64074ab 100644 --- a/src/VkShaderLibrary.hpp +++ b/src/VkShaderLibrary.hpp @@ -2,7 +2,7 @@ #include #include #include "VkDevice.hpp" -#include +#include #include #include #include "VkPipelineLibraryShared.hpp" diff --git a/src/VkSurface.cpp b/src/VkSurface.cpp index 45771af..f1ec6c9 100644 --- a/src/VkSurface.cpp +++ b/src/VkSurface.cpp @@ -1,4 +1,13 @@ #if RGL_VK_AVAILABLE +#if _WIN32 +#define VK_USE_PLATFORM_WIN32_KHR +#elif __ANDROID__ +#define VK_USE_PLATFORM_ANDROID_KHR +#elif __linux__ +#define VK_USE_PLATFORM_XLIB_KHR +#define VK_USE_PLATFORM_WAYLAND_KHR +#endif + #include "VkSurface.hpp" #include "RGLVk.hpp" @@ -8,10 +17,8 @@ #include #elif __linux__ && !__ANDROID__ #include -#include #include #include -#include #elif __ANDROID__ #include #endif diff --git a/src/VkSurface.hpp b/src/VkSurface.hpp index 2503da0..028e8a0 100644 --- a/src/VkSurface.hpp +++ b/src/VkSurface.hpp @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include namespace RGL { diff --git a/src/VkSwapchain.cpp b/src/VkSwapchain.cpp index b91a2cf..fdd4af2 100644 --- a/src/VkSwapchain.cpp +++ b/src/VkSwapchain.cpp @@ -155,7 +155,7 @@ void RGL::SwapchainVK::Resize(uint32_t width, uint32_t height) VK_CHECK(vkCreateImageView(owningDevice->device, &createInfo, nullptr, &swapChainImageViews[i])); auto viewDebugName = std::string("swapchain image view ") + std::to_string(i); - owningDevice->SetDebugNameForResource((void*)swapChainImageViews[i], VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, viewDebugName.c_str()); + owningDevice->SetDebugNameForResource((void*)swapChainImageViews[i], VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT, viewDebugName.c_str()); auto& texture = RGLTextureResources.emplace_back(owningDevice, swapChainImageViews[i], swapChainImages[i], Dimension{ width,height }); texture.owningSwapchain = this; diff --git a/src/VkSynchronization.hpp b/src/VkSynchronization.hpp index 0eb3385..1b90bf9 100644 --- a/src/VkSynchronization.hpp +++ b/src/VkSynchronization.hpp @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include #include namespace RGL { diff --git a/src/VkTexture.cpp b/src/VkTexture.cpp index ac21e26..2029f34 100644 --- a/src/VkTexture.cpp +++ b/src/VkTexture.cpp @@ -3,6 +3,7 @@ #include "VkDevice.hpp" #include "RGLVk.hpp" #include +#include namespace RGL { @@ -263,7 +264,7 @@ namespace RGL { VkDescriptorImageInfo imginfo{ .sampler = VK_NULL_HANDLE, .imageView = vkImageView, - .imageLayout = nativeFormat, + .imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, }; VkWriteDescriptorSet bindlessDescriptorWrite{ diff --git a/src/VkTexture.hpp b/src/VkTexture.hpp index 782c4a2..2b053b8 100644 --- a/src/VkTexture.hpp +++ b/src/VkTexture.hpp @@ -2,12 +2,13 @@ #include #include #include -#include -#include +#include #include #include #include +struct VmaAllocation_T; + namespace RGL { struct DeviceVk; struct TextureVk : public ITexture, public std::enable_shared_from_this { @@ -28,7 +29,7 @@ namespace RGL { VkImageLayout nativeFormat = VK_IMAGE_LAYOUT_UNDEFINED; - VmaAllocation alloc = VK_NULL_HANDLE; + VmaAllocation_T* alloc = VK_NULL_HANDLE; TextureView GetDefaultView() const final; TextureView GetViewForMip(uint32_t mip) const final; diff --git a/src/VmaUsage.cpp b/src/VmaUsage.cpp new file mode 100644 index 0000000..541248a --- /dev/null +++ b/src/VmaUsage.cpp @@ -0,0 +1,4 @@ +#if RGL_VK_AVAILABLE +#define VMA_IMPLEMENTATION +#include +#endif \ No newline at end of file diff --git a/tools/librglc/librglc.cpp b/tools/librglc/librglc.cpp index 60c545c..c4cf3c9 100644 --- a/tools/librglc/librglc.cpp +++ b/tools/librglc/librglc.cpp @@ -46,19 +46,25 @@ namespace librglc { opt.debug = config.enableDebug; opt.entryPoint = config.entrypointOutputName; opt.mtlDeviceAddressSettings = { - .descSet = 1, - .deviceStorage = true + { + .descSet = 1, + .deviceStorage = true + }, + { + .descSet = 2, + .deviceStorage = true + }, }; if (toAPI == API::Vulkan) { opt.version = 15; opt.preambleContent = "#define RGL_SL_VK 1"; } else if (toAPI == API::Direct3D12) { - opt.version = 64; + opt.version = 68; opt.preambleContent = "#define RGL_SL_DX 1"; } else if (toAPI == API::Metal) { - opt.version = 30; + opt.version = 31; opt.pushConstantSettings.firstIndex = MTL_FIRST_BUFFER; // the [[stage_input]] consumes slot 0, extra vertex buffers consume the next slots opt.preambleContent = "#define RGL_SL_MTL 1"; }