diff --git a/include/amd_ags.h b/include/amd_ags.h new file mode 100644 index 00000000..76938fc4 --- /dev/null +++ b/include/amd_ags.h @@ -0,0 +1,1285 @@ +// +// Copyright (c) 2020 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. +// + +/// \file +/// \mainpage +/// AGS Library Overview +/// -------------------- +/// This document provides an overview of the AGS (AMD GPU Services) library. The AGS library provides software developers with the ability to query +/// AMD GPU software and hardware state information that is not normally available through standard operating systems or graphic APIs. +/// +/// The latest version of the API is publicly hosted here: https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/. +/// It is also worth checking http://gpuopen.com/gaming-product/amd-gpu-services-ags-library/ for any updates and articles on AGS. +/// \internal +/// Online documentation is publicly hosted here: http://gpuopen-librariesandsdks.github.io/ags/ +/// \endinternal +/// +/// --------------------------------------- +/// What's new in AGS 5.4.1 since version 5.4.0 +/// --------------------------------------- +/// AGS 5.4.1 includes the following updates: +/// * AsicFamily_Count to help with code maintenance. +/// * Visual Studio 2019 support. +/// * x86 support +/// * BaseInstance and BaseVertex intrinsics along with corresponding caps bits. +/// * GetWaveSize intrinsic along with corresponding caps bits. +/// +/// --------------------------------------- +/// What's new in AGS 5.4 since version 5.3 +/// --------------------------------------- +/// AGS 5.4 includes the following updates: +/// * A more detailed description of the GPU architecture, now including RDNA GPUs. +/// * Radeon 7 core and memory speeds returned. +/// * Draw index and Atomic U64 intrinsics for both DX11 and DX12. +/// +/// --------------------------------------- +/// What's new in AGS 5.3 since version 5.2 +/// --------------------------------------- +/// AGS 5.3 includes the following updates: +/// * DX11 deferred context support for Multi Draw Indirect and UAV Overlap extensions. +/// * A Radeon Software Version helper to determine whether the installed driver meets your game's minimum driver version requirements. +/// * Freesync HDR Gamma 2.2 mode which uses a 1010102 swapchain and can be considered as an alternative to using the 64 bit swapchain required for Freesync HDR scRGB. +/// +/// Using the AGS library +/// --------------------- +/// It is recommended to take a look at the source code for the samples that come with the AGS SDK: +/// * AGSSample +/// * CrossfireSample +/// * EyefinitySample +/// The AGSSample application is the simplest of the three examples and demonstrates the code required to initialize AGS and use it to query the GPU and Eyefinity state. +/// The CrossfireSample application demonstrates the use of the new API to transfer resources on GPUs in Crossfire mode. Lastly, the EyefinitySample application provides a more +/// extensive example of Eyefinity setup than the basic example provided in AGSSample. +/// There are other samples on Github that demonstrate the DirectX shader extensions, such as the Barycentrics11 and Barycentrics12 samples. +/// +/// To add AGS support to an existing project, follow these steps: +/// * Link your project against the correct import library. Choose from either the 32 bit or 64 bit version. +/// * Copy the AGS dll into the same directory as your game executable. +/// * Include the amd_ags.h header file from your source code. +/// * Include the AGS hlsl files if you are using the shader intrinsics. +/// * Declare a pointer to an AGSContext and make this available for all subsequent calls to AGS. +/// * On game initialization, call \ref agsInit passing in the address of the context. On success, this function will return a valid context pointer. +/// +/// Don't forget to cleanup AGS by calling \ref agsDeInit when the app exits, after the device has been destroyed. +#include "d3dcommon.h" +#include "d3dcompiler.h" +#ifndef AMD_AGS_H +#define AMD_AGS_H + +#define AMD_AGS_VERSION_MAJOR 5 ///< AGS major version +#define AMD_AGS_VERSION_MINOR 4 ///< AGS minor version +#define AMD_AGS_VERSION_PATCH 1 ///< AGS patch version + +#ifdef __cplusplus +extern "C" { +#endif + +/// \defgroup Defines AGS defines +/// @{ +#define AMD_AGS_API __declspec(dllexport) ///< AGS exported functions + +#define AGS_MAKE_VERSION( major, minor, patch ) ( ( major << 22 ) | ( minor << 12 ) | patch ) ///< Macro to create the app and engine versions for the fields in \ref AGSDX12ExtensionParams and \ref AGSDX11ExtensionParams and the Radeon Software Version +#define AGS_UNSPECIFIED_VERSION 0xFFFFAD00 ///< Use this to specify no version +/// @} + +#if !defined (AGS_DIRECTX_TYPES_INCLUDED) +// Forward declaration of D3D11 types +struct IDXGIAdapter; +enum D3D_DRIVER_TYPE; +enum D3D_FEATURE_LEVEL; +struct DXGI_SWAP_CHAIN_DESC; +struct ID3D11Device; +struct ID3D11DeviceContext; +struct IDXGISwapChain; +struct ID3D11Resource; +struct ID3D11Buffer; +struct ID3D11Texture1D; +struct ID3D11Texture2D; +struct ID3D11Texture3D; +struct D3D11_BUFFER_DESC; +struct D3D11_TEXTURE1D_DESC; +struct D3D11_TEXTURE2D_DESC; +struct D3D11_TEXTURE3D_DESC; +struct D3D11_SUBRESOURCE_DATA; +struct tagRECT; +typedef tagRECT D3D11_RECT; ///< typedef this ourselves so we don't have to drag d3d11.h in + +// Forward declaration of D3D12 types +struct ID3D12Device; +struct ID3D12GraphicsCommandList; +#endif + +/// \defgroup enums General enumerations +/// @{ + +/// The return codes +enum AGSReturnCode +{ + AGS_SUCCESS, ///< Successful function call + AGS_FAILURE, ///< Failed to complete call for some unspecified reason + AGS_INVALID_ARGS, ///< Invalid arguments into the function + AGS_OUT_OF_MEMORY, ///< Out of memory when allocating space internally + AGS_MISSING_D3D_DLL, ///< Returned when a D3D dll fails to load + AGS_LEGACY_DRIVER, ///< Returned if a feature is not present in the installed driver + AGS_NO_AMD_DRIVER_INSTALLED, ///< Returned if the AMD GPU driver does not appear to be installed + AGS_EXTENSION_NOT_SUPPORTED, ///< Returned if the driver does not support the requested driver extension + AGS_ADL_FAILURE, ///< Failure in ADL (the AMD Display Library) + AGS_DX_FAILURE ///< Failure from DirectX runtime +}; + +/// The DirectX11 extension support bits +enum AGSDriverExtensionDX11 +{ + AGS_DX11_EXTENSION_QUADLIST = 1 << 0, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_SCREENRECTLIST = 1 << 1, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_UAV_OVERLAP = 1 << 2, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_DEPTH_BOUNDS_TEST = 1 << 3, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_MULTIDRAWINDIRECT = 1 << 4, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_MULTIDRAWINDIRECT_COUNTINDIRECT = 1 << 5, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_CROSSFIRE_API = 1 << 6, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 7, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_READLANE = 1 << 8, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_LANEID = 1 << 9, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_SWIZZLE = 1 << 10, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BALLOT = 1 << 11, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_MBCOUNT = 1 << 12, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_MED3 = 1 << 13, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 14, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 15, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 16, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_CREATE_SHADER_CONTROLS = 1 << 17, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX11_EXTENSION_MULTIVIEW = 1 << 18, ///< Supported in Radeon Software Version 16.12.1 onwards. + AGS_DX11_EXTENSION_APP_REGISTRATION = 1 << 19, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX11_EXTENSION_BREADCRUMB_MARKERS = 1 << 20, ///< Supported in Radeon Software Version 17.11.1 onwards. + AGS_DX11_EXTENSION_MDI_DEFERRED_CONTEXTS = 1 << 21, ///< Supported in Radeon Software Version 18.8.1 onwards. + AGS_DX11_EXTENSION_UAV_OVERLAP_DEFERRED_CONTEXTS = 1 << 22, ///< Supported in Radeon Software Version 18.8.1 onwards. + AGS_DX11_EXTENSION_DEPTH_BOUNDS_DEFERRED_CONTEXTS = 1 << 23, ///< Supported in Radeon Software Version 18.8.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_DRAW_INDEX = 1 << 24, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 25, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX11_EXTENSION_INTRINSIC_GET_WAVE_SIZE = 1 << 26, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BASE_VERTEX = 1 << 27, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX11_EXTENSION_INTRINSIC_BASE_INSTANCE = 1 << 28 ///< Supported in Radeon Software Version 20.2.1 onwards. +}; + +/// The DirectX12 extension support bits +enum AGSDriverExtensionDX12 +{ + AGS_DX12_EXTENSION_INTRINSIC_READFIRSTLANE = 1 << 0, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_READLANE = 1 << 1, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_LANEID = 1 << 2, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_SWIZZLE = 1 << 3, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BALLOT = 1 << 4, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_MBCOUNT = 1 << 5, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_MED3 = 1 << 6, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BARYCENTRICS = 1 << 7, ///< Supported in Radeon Software Version 16.9.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_WAVE_REDUCE = 1 << 8, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_WAVE_SCAN = 1 << 9, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_USER_MARKERS = 1 << 10, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_APP_REGISTRATION = 1 << 11, ///< Supported in Radeon Software Version 17.9.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_UAV_BIND_SLOT = 1 << 12, ///< Supported in Radeon Software Version 19.5.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_DRAW_INDEX = 1 << 13, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_ATOMIC_U64 = 1 << 14, ///< Supported in Radeon Software Version 19.12.2 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BASE_VERTEX = 1 << 15, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_BASE_INSTANCE = 1 << 16, ///< Supported in Radeon Software Version 20.2.1 onwards. + AGS_DX12_EXTENSION_INTRINSIC_GET_WAVE_SIZE = 1 << 17 ///< Supported in Radeon Software Version 20.5.1 onwards. +}; + +/// The space id for DirectX12 intrinsic support +const unsigned int AGS_DX12_SHADER_INSTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420894 + + +/// Additional topologies supported via extensions +enum AGSPrimitiveTopology +{ + AGS_PRIMITIVE_TOPOLOGY_QUADLIST = 7, ///< Quad list + AGS_PRIMITIVE_TOPOLOGY_SCREENRECTLIST = 9 ///< Screen rect list +}; + +/// The display flags describing various properties of the display. +enum AGSDisplayFlags +{ + AGS_DISPLAYFLAG_PRIMARY_DISPLAY = 1 << 0, ///< Whether this display is marked as the primary display. Not set on the WACK version. + AGS_DISPLAYFLAG_HDR10 = 1 << 1, ///< HDR10 is supported on this display + AGS_DISPLAYFLAG_DOLBYVISION = 1 << 2, ///< Dolby Vision is supported on this display + AGS_DISPLAYFLAG_FREESYNC = 1 << 3, ///< Freesync is supported on this display + AGS_DISPLAYFLAG_FREESYNC_HDR = 1 << 4, ///< Freesync HDR is supported on this display + AGS_DISPLAYFLAG_EYEFINITY_IN_GROUP = 1 << 5, ///< The display is part of the Eyefinity group + AGS_DISPLAYFLAG_EYEFINITY_PREFERRED_DISPLAY = 1 << 6, ///< The display is the preferred display in the Eyefinity group for displaying the UI + AGS_DISPLAYFLAG_EYEFINITY_IN_PORTRAIT_MODE = 1 << 7 ///< The display is in the Eyefinity group but in portrait mode +}; + +/// The display settings flags. +enum AGSDisplaySettingsFlags +{ + AGS_DISPLAYSETTINGSFLAG_DISABLE_LOCAL_DIMMING = 1 << 0, ///< Disables local dimming if possible +}; + +/// @} + +struct AGSContext; ///< All function calls in AGS require a pointer to a context. This is generated via \ref agsInit + +/// The rectangle struct used by AGS. +struct AGSRect +{ + int offsetX; ///< Offset on X axis + int offsetY; ///< Offset on Y axis + int width; ///< Width of rectangle + int height; ///< Height of rectangle +}; + +/// The clip rectangle struct used by \ref agsDriverExtensionsDX11_SetClipRects +struct AGSClipRect +{ + /// The inclusion mode for the rect + enum Mode + { + ClipRectIncluded = 0, ///< Include the rect + ClipRectExcluded = 1 ///< Exclude the rect + }; + + Mode mode; ///< Include/exclude rect region + AGSRect rect; ///< The rect to include/exclude +}; + +/// The display info struct used to describe a display enumerated by AGS +struct AGSDisplayInfo +{ + char name[ 256 ]; ///< The name of the display + char displayDeviceName[ 32 ]; ///< The display device name, i.e. DISPLAY_DEVICE::DeviceName + + unsigned int displayFlags; ///< Bitfield of \ref AGSDisplayFlags + + int maxResolutionX; ///< The maximum supported resolution of the unrotated display + int maxResolutionY; ///< The maximum supported resolution of the unrotated display + float maxRefreshRate; ///< The maximum supported refresh rate of the display + + AGSRect currentResolution; ///< The current resolution and position in the desktop, ignoring Eyefinity bezel compensation + AGSRect visibleResolution; ///< The visible resolution and position. When Eyefinity bezel compensation is enabled this will + ///< be the sub region in the Eyefinity single large surface (SLS) + float currentRefreshRate; ///< The current refresh rate + + int eyefinityGridCoordX; ///< The X coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + int eyefinityGridCoordY; ///< The Y coordinate in the Eyefinity grid. -1 if not in an Eyefinity group + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double screenDiffuseReflectance; ///< Percentage expressed between 0 - 1 + double screenSpecularReflectance; ///< Percentage expressed between 0 - 1 + + double minLuminance; ///< The minimum luminance of the display in nits + double maxLuminance; ///< The maximum luminance of the display in nits + double avgLuminance; ///< The average luminance of the display in nits + + int logicalDisplayIndex; ///< The internally used index of this display + int adlAdapterIndex; ///< The internally used ADL adapter index +}; + +/// The device info struct used to describe a physical GPU enumerated by AGS +struct AGSDeviceInfo +{ + /// The ASIC family + enum AsicFamily + { + AsicFamily_Unknown, ///< Unknown architecture, potentially from another IHV. Check \ref AGSDeviceInfo::vendorId + AsicFamily_PreGCN, ///< Pre GCN architecture. + AsicFamily_GCN1, ///< AMD GCN 1 architecture: Oland, Cape Verde, Pitcairn & Tahiti. + AsicFamily_GCN2, ///< AMD GCN 2 architecture: Hawaii & Bonaire. This also includes APUs Kaveri and Carrizo. + AsicFamily_GCN3, ///< AMD GCN 3 architecture: Tonga & Fiji. + AsicFamily_GCN4, ///< AMD GCN 4 architecture: Polaris. + AsicFamily_Vega, ///< AMD Vega architecture, including Raven Ridge (ie AMD Ryzen CPU + AMD Vega GPU). + AsicFamily_RDNA, ///< AMD RDNA architecture + + AsicFamily_Count ///< Number of enumerated ASIC families + }; + + const char* adapterString; ///< The adapter name string + AsicFamily asicFamily; ///< Set to Unknown if not AMD hardware + int isAPU; ///< Whether or not this is an APU + int vendorId; ///< The vendor id + int deviceId; ///< The device id + int revisionId; ///< The revision id + + int numCUs; ///< Number of compute units. + int numWGPs; ///< Number of RDNA Work Group Processors. Only valid if ASIC is RDNA onwards. + + int numROPs; ///< Number of ROPs + int coreClock; ///< Core clock speed at 100% power in MHz + int memoryClock; ///< Memory clock speed at 100% power in MHz + int memoryBandwidth; ///< Memory bandwidth in MB/s + float teraFlops; ///< Teraflops of GPU. Zero if not GCN onwards. Calculated from iCoreClock * iNumCUs * 64 Pixels/clk * 2 instructions/MAD + + int isPrimaryDevice; ///< Whether or not this is the primary adapter in the system. Not set on the WACK version. + long long localMemoryInBytes; ///< The size of local memory in bytes. 0 for non AMD hardware. + + int numDisplays; ///< The number of active displays found to be attached to this adapter. + AGSDisplayInfo* displays; ///< List of displays allocated by AGS to be numDisplays in length. + + int eyefinityEnabled; ///< Indicates if Eyefinity is active + int eyefinityGridWidth; ///< Contains width of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityGridHeight; ///< Contains height of the multi-monitor grid that makes up the Eyefinity Single Large Surface. + int eyefinityResolutionX; ///< Contains width in pixels of the multi-monitor Single Large Surface. + int eyefinityResolutionY; ///< Contains height in pixels of the multi-monitor Single Large Surface. + int eyefinityBezelCompensated; ///< Indicates if bezel compensation is used for the current SLS display area. 1 if enabled, and 0 if disabled. + + int adlAdapterIndex; ///< Internally used index into the ADL list of adapters +}; + +/// \defgroup general General API functions +/// API for initialization, cleanup, HDR display modes and Crossfire GPU count +/// @{ + +typedef void* (__stdcall *AGS_ALLOC_CALLBACK)( size_t allocationSize ); ///< AGS user defined allocation prototype +typedef void (__stdcall *AGS_FREE_CALLBACK)( void* allocationPtr ); ///< AGS user defined free prototype + +/// The configuration options that can be passed in to \ref agsInit +struct AGSConfiguration +{ + AGS_ALLOC_CALLBACK allocCallback; ///< Optional memory allocation callback. If not supplied, malloc() is used + AGS_FREE_CALLBACK freeCallback; ///< Optional memory freeing callback. If not supplied, free() is used +}; + +/// The top level GPU information returned from \ref agsInit +struct AGSGPUInfo +{ + int agsVersionMajor; ///< Major field of Major.Minor.Patch AGS version number + int agsVersionMinor; ///< Minor field of Major.Minor.Patch AGS version number + int agsVersionPatch; ///< Patch field of Major.Minor.Patch AGS version number + int isWACKCompliant; ///< 1 if WACK compliant. + + const char* driverVersion; ///< The AMD driver package version + const char* radeonSoftwareVersion; ///< The Radeon Software Version + + int numDevices; ///< Number of GPUs in the system + AGSDeviceInfo* devices; ///< List of GPUs in the system +}; + +/// The struct to specify the display settings to the driver. +struct AGSDisplaySettings +{ + /// The display mode + enum Mode + { + Mode_SDR, ///< SDR mode + Mode_HDR10_PQ, ///< HDR10 PQ encoding, requiring a 1010102 UNORM swapchain and PQ encoding in the output shader. + Mode_HDR10_scRGB, ///< HDR10 scRGB, requiring an FP16 swapchain. Values of 1.0 == 80 nits, 125.0 == 10000 nits. + Mode_FreesyncHDR_scRGB, ///< Freesync HDR scRGB, requiring an FP16 swapchain. A value of 1.0 == 80 nits. + Mode_FreesyncHDR_Gamma22, ///< Freesync HDR Gamma 2.2, requiring a 1010102 UNORM swapchain. The output needs to be encoded to gamma 2.2. + Mode_DolbyVision, ///< Dolby Vision, requiring an 8888 UNORM swapchain + + Mode_Count ///< Number of enumerated display modes + }; + + Mode mode; ///< The display mode to set the display into + + double chromaticityRedX; ///< Red display primary X coord + double chromaticityRedY; ///< Red display primary Y coord + + double chromaticityGreenX; ///< Green display primary X coord + double chromaticityGreenY; ///< Green display primary Y coord + + double chromaticityBlueX; ///< Blue display primary X coord + double chromaticityBlueY; ///< Blue display primary Y coord + + double chromaticityWhitePointX; ///< White point X coord + double chromaticityWhitePointY; ///< White point Y coord + + double minLuminance; ///< The minimum scene luminance in nits + double maxLuminance; ///< The maximum scene luminance in nits + + double maxContentLightLevel; ///< The maximum content light level in nits (MaxCLL) + double maxFrameAverageLightLevel; ///< The maximum frame average light level in nits (MaxFALL) + + int flags; ///< Bitfield of \ref AGSDisplaySettingsFlags +}; + + +/// The result returned from \ref agsCheckDriverVersion +enum AGSDriverVersionResult +{ + AGS_SOFTWAREVERSIONCHECK_OK, ///< The reported Radeon Software Version is newer or the same as the required version + AGS_SOFTWAREVERSIONCHECK_OLDER, ///< The reported Radeon Software Version is older than the required version + AGS_SOFTWAREVERSIONCHECK_UNDEFINED ///< The check could not determine as result. This could be because it is a private or custom driver or just invalid arguments. +}; + +/// +/// Helper function to check the installed software version against the required software version. +/// +/// \param [in] radeonSoftwareVersionReported The Radeon Software Version returned from \ref AGSGPUInfo::radeonSoftwareVersion. +/// \param [in] radeonSoftwareVersionRequired The Radeon Software Version to check against. This is specificed using \ref AGS_MAKE_VERSION. +/// \return The result of the check. +/// +AMD_AGS_API AGSDriverVersionResult agsCheckDriverVersion( const char* radeonSoftwareVersionReported, unsigned int radeonSoftwareVersionRequired ); + + +/// +/// Function used to initialize the AGS library. +/// Must be called prior to any of the subsequent AGS API calls. +/// Must be called prior to ID3D11Device or ID3D12Device creation. +/// \note The caller of this function should handle the possibility of the call failing in the cases below. One option is to do a vendor id check and only call \ref agsInit if there is an AMD GPU present. +/// \note This function will fail with \ref AGS_NO_AMD_DRIVER_INSTALLED if there is no AMD driver found on the system. +/// \note This function will fail with \ref AGS_LEGACY_DRIVER in Catalyst versions before 12.20. +/// \note It is good practice to check the AGS version returned from AGSGPUInfo against the version defined in the header in case a mismatch between the dll and header has occurred. +/// +/// \param [in, out] context Address of a pointer to a context. This function allocates a context on the heap which is then required for all subsequent API calls. +/// \param [in] config Optional pointer to a AGSConfiguration struct to override the default library configuration. +/// \param [out] gpuInfo Optional pointer to a AGSGPUInfo struct which will get filled in for all the GPUs in the system. +/// +AMD_AGS_API AGSReturnCode agsInit( AGSContext** context, const AGSConfiguration* config, AGSGPUInfo* gpuInfo ); + +/// +/// Function used to clean up the AGS library. +/// +/// \param [in] context Pointer to a context. This function will deallocate the context from the heap. +/// +AMD_AGS_API AGSReturnCode agsDeInit( AGSContext* context ); + +/// +/// Function used to set a specific display into HDR mode +/// \note Setting all of the values apart from color space and transfer function to zero will cause the display to use defaults. +/// \note Call this function after each mode change (switch to fullscreen, any change in swapchain etc). +/// \note HDR10 PQ mode requires a 1010102 swapchain. +/// \note HDR10 scRGB mode requires an FP16 swapchain. +/// \note Freesync HDR scRGB mode requires an FP16 swapchain. +/// \note Freesync HDR Gamma 2.2 mode requires a 1010102 swapchain. +/// \note Dolby Vision requires a 8888 UNORM swapchain. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] deviceIndex The index of the device listed in \ref AGSGPUInfo::devices. +/// \param [in] displayIndex The index of the display listed in \ref AGSDeviceInfo::displays. +/// \param [in] settings Pointer to the display settings to use. +/// +AMD_AGS_API AGSReturnCode agsSetDisplayMode( AGSContext* context, int deviceIndex, int displayIndex, const AGSDisplaySettings* settings ); + +/// @} + +/// \defgroup dx12 DirectX12 Extensions +/// DirectX12 driver extensions +/// @{ + +/// \defgroup dx12init Device and device object creation and cleanup +/// It is now mandatory to call \ref agsDriverExtensionsDX12_CreateDevice when creating a device if the user wants to access any future DX12 AMD extensions. +/// The corresponding \ref agsDriverExtensionsDX12_DestroyDevice call must be called to release the device and free up the internal resources allocated by the create call. +/// @{ + +/// The struct to specify the DX12 device creation parameters +struct AGSDX12DeviceCreationParams +{ + IDXGIAdapter* pAdapter; ///< Pointer to the adapter to use when creating the device. This may be null. + IID iid; ///< The interface ID for the type of device to be created. + D3D_FEATURE_LEVEL FeatureLevel; ///< The minimum feature level to create the device with. +}; + +/// The struct to specify DX12 additional device creation parameters +struct AGSDX12ExtensionParams +{ + const WCHAR* pAppName; ///< Application name + const WCHAR* pEngineName; ///< Engine name + unsigned int appVersion; ///< Application version + unsigned int engineVersion; ///< Engine version + unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. Refer to the \ref agsDriverExtensionsDX12_CreateDevice documentation for more details. +}; + +/// The struct to hold all the returned parameters from the device creation call +struct AGSDX12ReturnedParams +{ + ID3D12Device* pDevice; ///< The newly created device + unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX12_CreateDevice will fill in to indicate which extensions are supported. See \ref AGSDriverExtensionDX12 +}; + + +/// +/// Function used to create a D3D12 device with additional AMD-specific initialization parameters. +/// +/// When using the HLSL shader extensions please note: +/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION (/Od) option, otherwise it will not work. +/// * The shader compiler needs D3DCOMPILE_ENABLE_STRICTNESS (/Ges) enabled. +/// * The intrinsic instructions require a 5.1 shader model. +/// * The Root Signature will need to reserve an extra UAV resource slot. This is not a real resource that requires allocating, it is just used to encode the intrinsic instructions. +/// +/// The easiest way to set up the reserved UAV slot is to specify it at u0. The register space id will automatically be assumed to be \ref AGS_DX12_SHADER_INSTRINSICS_SPACE_ID. +/// The HLSL expects this as default and the set up code would look similar to this: +/// \code{.cpp} +/// CD3DX12_DESCRIPTOR_RANGE range[]; +/// ... +/// range[ 0 ].Init( D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, AGS_DX12_SHADER_INSTRINSICS_SPACE_ID ); // u0 at driver-reserved space id +/// \endcode +/// +/// Newer drivers also support a user-specified slot in which case the register space id is assumed to be 0. It is important that the \ref AGS_DX12_EXTENSION_INTRINSIC_UAV_BIND_SLOT bit is set +/// to ensure the driver can support this. If not, then u0 and \ref AGS_DX12_SHADER_INSTRINSICS_SPACE_ID must be used. +/// If the driver does support this feature and a non zero slot is required, then the HLSL must also define AMD_EXT_SHADER_INTRINSIC_UAV_OVERRIDE as the matching slot value. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] creationParams Pointer to the struct to specify the existing DX12 device creation parameters. +/// \param [in] extensionParams Optional pointer to the struct to specify DX12 additional device creation parameters. +/// \param [out] returnedParams Pointer to struct to hold all the returned parameters from the call. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_CreateDevice( AGSContext* context, const AGSDX12DeviceCreationParams* creationParams, const AGSDX12ExtensionParams* extensionParams, AGSDX12ReturnedParams* returnedParams ); + +/// +/// Function to destroy the D3D12 device. +/// This call will also cleanup any AMD-specific driver extensions for D3D12. +/// +/// \param [in] context Pointer to a context. +/// \param [in] device Pointer to the D3D12 device. +/// \param [out] deviceReferences Optional pointer to an unsigned int that will be set to the value returned from device->Release(). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_DestroyDevice( AGSContext* context, ID3D12Device* device, unsigned int* deviceReferences ); + +/// @} + +/// \defgroup dx12usermarkers User Markers +/// @{ + +/// +/// Function used to push an AMD user marker onto the command list. +/// This is only has an effect if \ref AGS_DX12_EXTENSION_USER_MARKERS is present in the extensionsSupported bitfield of \ref agsDriverExtensionsDX12_CreateDevice +/// Supported in Radeon Software Version 17.9.1 onwards. +/// +/// \param [in] context Pointer to a context. +/// \param [in] commandList Pointer to the command list. +/// \param [in] data The marker string. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_PushMarker( AGSContext* context, ID3D12GraphicsCommandList* commandList, const char* data ); + +/// +/// Function used to pop an AMD user marker on the command list. +/// Supported in Radeon Software Version 17.9.1 onwards. +/// +/// \param [in] context Pointer to a context. +/// \param [in] commandList Pointer to the command list. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_PopMarker( AGSContext* context, ID3D12GraphicsCommandList* commandList ); + +/// +/// Function used to insert an single event AMD user marker onto the command list. +/// Supported in Radeon Software Version 17.9.1 onwards. +/// +/// \param [in] context Pointer to a context. +/// \param [in] commandList Pointer to the command list. +/// \param [in] data The marker string. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX12_SetMarker( AGSContext* context, ID3D12GraphicsCommandList* commandList, const char* data ); + +/// @} + +/// @} + +/// \defgroup dx11 DirectX11 Extensions +/// DirectX11 driver extensions +/// @{ + +/// \defgroup dx11init Device creation and cleanup +/// It is now mandatory to call \ref agsDriverExtensionsDX11_CreateDevice when creating a device if the user wants to access any DX11 AMD extensions. +/// The corresponding \ref agsDriverExtensionsDX11_DestroyDevice call must be called to release the device and free up the internal resources allocated by the create call. +/// @{ + +/// The different modes to control Crossfire behavior. +enum AGSCrossfireMode +{ + AGS_CROSSFIRE_MODE_DRIVER_AFR = 0, ///< Use the default driver-based AFR rendering. If this mode is specified, do NOT use the agsDriverExtensionsDX11_Create*() APIs to create resources + AGS_CROSSFIRE_MODE_EXPLICIT_AFR, ///< Use the AGS Crossfire API functions to perform explicit AFR rendering without requiring a CF driver profile + AGS_CROSSFIRE_MODE_DISABLE ///< Completely disable AFR rendering +}; + +/// The struct to specify the existing DX11 device creation parameters +struct AGSDX11DeviceCreationParams +{ + IDXGIAdapter* pAdapter; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + D3D_DRIVER_TYPE DriverType; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + HMODULE Software; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + UINT Flags; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + const D3D_FEATURE_LEVEL* pFeatureLevels; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + UINT FeatureLevels; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + UINT SDKVersion; ///< Consult the DX documentation on D3D11CreateDevice for this parameter + const DXGI_SWAP_CHAIN_DESC* pSwapChainDesc; ///< Optional swapchain description. Specify this to invoke D3D11CreateDeviceAndSwapChain instead of D3D11CreateDevice. This must be null on the WACK compliant version +}; + +/// The struct to specify DX11 additional device creation parameters +struct AGSDX11ExtensionParams +{ + const WCHAR* pAppName; ///< Application name + const WCHAR* pEngineName; ///< Engine name + unsigned int appVersion; ///< Application version + unsigned int engineVersion; ///< Engine version + unsigned int numBreadcrumbMarkers; ///< The number of breadcrumb markers to allocate. Each marker is a uint64 (ie 8 bytes). If 0, the system is disabled. + unsigned int uavSlot; ///< The UAV slot reserved for intrinsic support. This must match the slot defined in the HLSL, i.e. "#define AmdDxExtShaderIntrinsicsUAVSlot". + /// The default slot is 7, but the caller is free to use an alternative slot. + /// If 0 is specified, then the default of 7 will be used. + AGSCrossfireMode crossfireMode; ///< Desired Crossfire mode +}; + +/// The struct to hold all the returned parameters from the device creation call +struct AGSDX11ReturnedParams +{ + ID3D11Device* pDevice; ///< The newly created device + ID3D11DeviceContext* pImmediateContext; ///< The newly created immediate device context + IDXGISwapChain* pSwapChain; ///< The newly created swap chain. This is only created if a valid pSwapChainDesc is supplied in AGSDX11DeviceCreationParams. This is not supported on the WACK compliant version + D3D_FEATURE_LEVEL FeatureLevel; ///< The feature level supported by the newly created device + unsigned int extensionsSupported; ///< Bit mask that \ref agsDriverExtensionsDX11_CreateDevice will fill in to indicate which extensions are supported. See \ref AGSDriverExtensionDX11 + unsigned int crossfireGPUCount; ///< The number of GPUs that are active for this app + void* breadcrumbBuffer; ///< The CPU buffer returned if the initialization of the breadcrumb was successful. +}; + +/// +/// Function used to create a D3D11 device with additional AMD-specific initialization parameters. +/// +/// When using the HLSL shader extensions please note: +/// * The shader compiler should not use the D3DCOMPILE_SKIP_OPTIMIZATION (/Od) option, otherwise it will not work. +/// * The shader compiler needs D3DCOMPILE_ENABLE_STRICTNESS (/Ges) enabled. +/// +/// \param [in] context Pointer to a context. This is generated by \ref agsInit +/// \param [in] creationParams Pointer to the struct to specify the existing DX11 device creation parameters. +/// \param [in] extensionParams Optional pointer to the struct to specify DX11 additional device creation parameters. +/// \param [out] returnedParams Pointer to struct to hold all the returned parameters from the call. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateDevice( AGSContext* context, const AGSDX11DeviceCreationParams* creationParams, const AGSDX11ExtensionParams* extensionParams, AGSDX11ReturnedParams* returnedParams ); + +/// +/// Function to destroy the D3D11 device and its immediate context. +/// This call will also cleanup any AMD-specific driver extensions for D3D11. +/// +/// \param [in] context Pointer to a context. +/// \param [in] device Pointer to the D3D11 device. +/// \param [out] deviceReferences Optional pointer to an unsigned int that will be set to the value returned from device->Release(). +/// \param [in] immediateContext Pointer to the D3D11 immediate device context. +/// \param [out] immediateContextReferences Optional pointer to an unsigned int that will be set to the value returned from immediateContext->Release(). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_DestroyDevice( AGSContext* context, ID3D11Device* device, unsigned int* deviceReferences, ID3D11DeviceContext* immediateContext, unsigned int* immediateContextReferences ); + +/// @} + + +/// \defgroup dx11appreg App Registration +/// @{ +/// This extension allows an apllication to voluntarily register itself with the driver, providing a more robust app detection solution and avoid the issue of the driver +/// relying on exe names to match the app to a driver profile. +/// This feature is supported in Radeon Software Version 17.9.2 onwards. +/// Rules: +/// * AppName or EngineName must be set, but both are not required. Engine profiles will be used only if app specific profiles do not exist. +/// * In an engine, the EngineName should be set, so a default profile can be built. If an app modifies the engine, the AppName should be set, to allow a profile for the specific app. +/// * Version number is not mandatory, but heavily suggested. The use of which can prevent the use of profiles for incompatible versions (for instance engine versions that introduce or change features), and can help prevent older profiles from being used (and introducing new bugs) before the profile is tested with new app builds. +/// * If Version numbers are used and a new version is introduced, a new profile will not be enabled until an AMD engineer has been able to update a previous profile, or make a new one. +/// +/// The cases for profile selection are as follows: +/// +/// |Case|Profile Applied| +/// |----|---------------| +/// | App or Engine Version has profile | The profile is used. | +/// | App or Engine Version num < profile version num | The closest profile > the version number is used. | +/// | App or Engine Version num > profile version num | No profile selected/The previous method is used. | +/// | App and Engine Version have profile | The App's profile is used. | +/// | App and Engine Version num < profile version | The closest App profile > the version number is used. | +/// | App and Engine Version, no App profile found | The Engine profile will be used. | +/// | App/Engine name but no Version, has profile | The latest profile is used. | +/// | No name or version, or no profile | The previous app detection method is used. | +/// +/// As shown above, if an App name is given, and a profile is found for that app, that will be prioritized. The Engine name and profile will be used only if no app name is given, or no viable profile is found for the app name. +/// In the case that App nor Engine have a profile, the previous app detection methods will be used. If given a version number that is larger than any profile version number, no profile will be selected. +/// This is specifically to prevent cases where an update to an engine or app will cause catastrophic breaks in the profile, allowing an engineer to test the profile before clearing it for public use with the new engine/app update. +/// +/// @} + +/// \defgroup breadcrumbs Breadcrumb API +/// API for writing top-of-pipe and bottom-of-pipe markers to help track down GPU hangs. +/// +/// The API is available if the \ref AGS_DX11_EXTENSION_BREADCRUMB_MARKERS is present in \ref AGSDX11ReturnedParams::extensionsSupported. +/// +/// To use the API, a non zero value needs to be specificed in \ref AGSDX11ExtensionParams::numBreadcrumbMarkers. This enables the API (if available) and allocates a system memory buffer +/// which is returned to the user in \ref AGSDX11ReturnedParams::breadcrumbBuffer. +/// +/// The user can now write markers before and after draw calls using \ref agsDriverExtensionsDX11_WriteBreadcrumb. +/// +/// \section background Background +/// +/// A top-of-pipe (TOP) command is scheduled for execution as soon as the command processor (CP) reaches the command. +/// A bottom-of-pipe (BOP) command is scheduled for execution once the previous rendering commands (draw and dispatch) finish execution. +/// TOP and BOP commands do not block CP. i.e. the CP schedules the command for execution then proceeds to the next command without waiting. +/// To effectively use TOP and BOP commands, it is important to understand how they interact with rendering commands: +/// +/// When the CP encounters a rendering command it queues it for execution and moves to the next command. The queued rendering commands are issued in order. +/// There can be multiple rendering commands running in parallel. When a rendering command is issued we say it is at the top of the pipe. When a rendering command +/// finishes execution we say it has reached the bottom of the pipe. +/// +/// A BOP command remains in a waiting queue and is executed once prior rendering commands finish. The queue of BOP commands is limited to 64 entries in GCN generation 1, 2, 3, 4 and 5. +/// If the 64 limit is reached the CP will stop queueing BOP commands and also rendering commands. Developers should limit the number of BOP commands that write markers to avoid contention. +/// In general, developers should limit both TOP and BOP commands to avoid stalling the CP. +/// +/// \subsection eg1 Example 1: +/// +/// \code{.cpp} +/// // Start of a command buffer +/// WriteMarker(TopOfPipe, 1) +/// WriteMarker(BottomOfPipe, 2) +/// WriteMarker(BottomOfPipe, 3) +/// DrawX +/// WriteMarker(BottomOfPipe, 4) +/// WriteMarker(BottomOfPipe, 5) +/// WriteMarker(TopOfPipe, 6) +/// // End of command buffer +/// \endcode +/// +/// In the above example, the CP writes markers 1, 2 and 3 without waiting: +/// Marker 1 is TOP so it's independent from other commands +/// There's no wait for marker 2 and 3 because there are no draws preceding the BOP commands +/// Marker 4 is only written once DrawX finishes execution +/// Marker 5 doesn't wait for additional draws so it is written right after marker 4 +/// Marker 6 can be written as soon as the CP reaches the command. For instance, it is very possible that CP writes marker 6 while DrawX +/// is running and therefore marker 6 gets written before markers 4 and 5 +/// +/// \subsection eg2 Example 2: +/// +/// \code{.cpp} +/// WriteMarker(TopOfPipe, 1) +/// DrawX +/// WriteMarker(BottomOfPipe, 2) +/// WriteMarker(TopOfPipe, 3) +/// DrawY +/// WriteMarker(BottomOfPipe, 4) +/// \endcode +/// +/// In this example marker 1 is written before the start of DrawX +/// Marker 2 is written once DrawX finishes execution +/// Similarly marker 3 is written before the start of DrawY +/// Marker 4 is written once DrawY finishes execution +/// In case of a GPU hang, if markers 1 and 3 are written but markers 2 and 4 are missing we can conclude that: +/// The CP has reached both DrawX and DrawY commands since marker 1 and 3 are present +/// The fact that marker 2 and 4 are missing means that either DrawX is hanging while DrawY is at the top of the pipe or both DrawX and DrawY +/// started and both are simultaneously hanging +/// +/// \subsection eg3 Example 3: +/// +/// \code{.cpp} +/// // Start of a command buffer +/// WriteMarker(BottomOfPipe, 1) +/// DrawX +/// WriteMarker(BottomOfPipe, 2) +/// DrawY +/// WriteMarker(BottomOfPipe, 3) +/// DrawZ +/// WriteMarker(BottomOfPipe, 4) +/// // End of command buffer +/// \endcode +/// +/// In this example marker 1 is written before the start of DrawX +/// Marker 2 is written once DrawX finishes +/// Marker 3 is written once DrawY finishes +/// Marker 4 is written once DrawZ finishes +/// If the GPU hangs and only marker 1 is written we can conclude that the hang is happening in either DrawX, DrawY or DrawZ +/// If the GPU hangs and only marker 1 and 2 are written we can conclude that the hang is happening in DrawY or DrawZ +/// If the GPU hangs and only marker 4 is missing we can conclude that the hang is happening in DrawZ +/// +/// \subsection eg4 Example 4: +/// +/// \code{.cpp} +/// Start of a command buffer +/// WriteMarker(TopOfPipe, 1) +/// DrawX +/// WriteMarker(TopOfPipe, 2) +/// DrawY +/// WriteMarker(TopOfPipe, 3) +/// DrawZ +/// // End of command buffer +/// \endcode +/// +/// In this example, in case the GPU hangs and only marker 1 is written we can conclude that the hang is happening in DrawX +/// In case the GPU hangs and only marker 1 and 2 are written we can conclude that the hang is happening in DrawX or DrawY +/// In case the GPU hangs and all 3 markers are written we can conclude that the hang is happening in any of DrawX, DrawY or DrawZ +/// +/// \subsection eg5 Example 5: +/// +/// \code{.cpp} +/// DrawX +/// WriteMarker(TopOfPipe, 1) +/// WriteMarker(BottomOfPipe, 2) +/// DrawY +/// WriteMarker(TopOfPipe, 3) +/// WriteMarker(BottomOfPipe, 4) +/// \endcode +/// +/// Marker 1 is written right after DrawX is queued for execution. +/// Marker 2 is only written once DrawX finishes execution. +/// Marker 3 is written right after DrawY is queued for execution. +/// Marker 4 is only written once DrawY finishes execution +/// If marker 1 is written we would know that the CP has reached the command DrawX (DrawX at the top of the pipe). +/// If marker 2 is written we can say that DrawX has finished execution (DrawX at the bottom of the pipe). +/// In case the GPU hangs and only marker 1 and 3 are written we can conclude that the hang is happening in DrawX or DrawY +/// In case the GPU hangs and only marker 1 is written we can conclude that the hang is happening in DrawX +/// In case the GPU hangs and only marker 4 is missing we can conclude that the hang is happening in DrawY +/// +/// \section data Retrieving GPU Data +/// +/// In the event of a GPU hang, the user can inspect the system memory buffer to determine which draw has caused the hang. +/// For example: +/// \code{.cpp} +/// // Force the work to be flushed to prevent CPU ahead of GPU +/// g_pImmediateContext->Flush(); +/// +/// // Present the information rendered to the back buffer to the front buffer (the screen) +/// HRESULT hr = g_pSwapChain->Present( 0, 0 ); +/// +/// // Read the marker data buffer once detect device lost +/// if ( hr != S_OK ) +/// { +/// for (UINT i = 0; i < g_NumMarkerWritten; i++) +/// { +/// UINT64* pTempData; +/// pTempData = static_cast(pMarkerBuffer); +/// +/// // Write the marker data to file +/// ofs << i << "\r\n"; +/// ofs << std::hex << *(pTempData + i * 2) << "\r\n"; +/// ofs << std::hex << *(pTempData + (i * 2 + 1)) << "\r\n"; +/// +/// WCHAR s1[256]; +/// setlocale(LC_NUMERIC, "en_US.iso88591"); +/// +/// // Output the marker data to console +/// swprintf(s1, 256, L" The Draw count is %d; The Top maker is % 016llX and the Bottom marker is % 016llX \r\n", i, *(pTempData + i * 2), *(pTempData + (i * 2 + 1))); +/// +/// OutputDebugStringW(s1); +/// } +/// } +/// \endcode +/// +/// The console output would resemble something like: +/// \code{.cpp} +/// D3D11: Removing Device. +/// D3D11 ERROR: ID3D11Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was executing commands when the hang occurred. The application may want to respawn and fallback to less aggressive use of the display hardware). [ EXECUTION ERROR #378: DEVICE_REMOVAL_PROCESS_AT_FAULT] +/// The Draw count is 0; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 1; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 2; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 3; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 4; The Top maker is 00000000DEADCAFE and the Bottom marker is 00000000DEADBEEF +/// The Draw count is 5; The Top maker is CDCDCDCDCDCDCDCD and the Bottom marker is CDCDCDCDCDCDCDCD +/// The Draw count is 6; The Top maker is CDCDCDCDCDCDCDCD and the Bottom marker is CDCDCDCDCDCDCDCD +/// The Draw count is 7; The Top maker is CDCDCDCDCDCDCDCD and the Bottom marker is CDCDCDCDCDCDCDCD +/// \endcode +/// +/// @{ + +/// The breadcrumb marker struct used by \ref agsDriverExtensionsDX11_WriteBreadcrumb +struct AGSBreadcrumbMarker +{ + /// The marker type + enum Type + { + TopOfPipe = 0, ///< Top-of-pipe marker + BottomOfPipe = 1 ///< Bottom-of-pipe marker + }; + + unsigned long long markerData; ///< The user data to write. + Type type; ///< Whether this marker is top or bottom of pipe. + unsigned int index; ///< The index of the marker. This should be less than the value specified in \ref AGSDX11ExtensionParams::numBreadcrumbMarkers +}; + +/// +/// Function to write a breadcrumb marker. +/// +/// This method inserts a write marker operation in the GPU command stream. In the case where the GPU is hanging the write +/// command will never be reached and the marker will never get written to memory. +/// +/// In order to use this function, \ref AGSDX11ExtensionParams::numBreadcrumbMarkers must be set to a non zero value. +/// +/// \param [in] context Pointer to a context. +/// \param [in] marker Pointer to a marker. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_WriteBreadcrumb( AGSContext* context, const AGSBreadcrumbMarker* marker ); + +/// @} + +/// \defgroup dx11Topology Extended Topology +/// API for primitive topologies +/// @{ + +/// +/// Function used to set the primitive topology. If you are using any of the extended topology types, then this function should +/// be called to set ALL topology types. +/// +/// The Quad List extension is a convenient way to submit quads without using an index buffer. Note that this still submits two triangles at the driver level. +/// In order to use this function, AGS must already be initialized and agsDriverExtensionsDX11_Init must have been called successfully. +/// +/// The Screen Rect extension, which is only available on GCN hardware, allows the user to pass in three of the four corners of a rectangle. +/// The hardware then uses the bounding box of the vertices to rasterize the rectangle primitive (i.e. as a rectangle rather than two triangles). +/// \note Note that this will not return valid interpolated values, only valid SV_Position values. +/// \note If either the Quad List or Screen Rect extension are used, then agsDriverExtensionsDX11_IASetPrimitiveTopology should be called in place of the native DirectX11 equivalent all the time. +/// +/// \param [in] context Pointer to a context. +/// \param [in] topology The topology to set on the D3D11 device. This can be either an AGS-defined topology such as AGS_PRIMITIVE_TOPOLOGY_QUADLIST +/// or a standard D3D-defined topology such as D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP. +/// NB. the AGS-defined types will require casting to a D3D_PRIMITIVE_TOPOLOGY type. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_IASetPrimitiveTopology( AGSContext* context, enum D3D_PRIMITIVE_TOPOLOGY topology ); + +/// @} + +/// \defgroup dx11UAVOverlap UAV Overlap +/// API for enabling overlapping UAV writes +/// @{ + +/// +/// Function used indicate to the driver that it doesn't need to sync the UAVs bound for the subsequent set of back-to-back dispatches. +/// When calling back-to-back draw calls or dispatch calls that write to the same UAV, the AMD DX11 driver will automatically insert a barrier to ensure there are no write after write (WAW) hazards. +/// If the app can guarantee there is no overlap between the writes between these calls, then this extension will remove those barriers allowing the work to run in parallel on the GPU. +/// +/// Usage would be as follows: +/// \code{.cpp} +/// m_device->Dispatch( ... ); // First call that writes to the UAV +/// +/// // Disable automatic WAW syncs +/// agsDriverExtensionsDX11_BeginUAVOverlap( m_agsContext ); +/// +/// // Submit other dispatches that write to the same UAV concurrently +/// m_device->Dispatch( ... ); +/// m_device->Dispatch( ... ); +/// m_device->Dispatch( ... ); +/// +/// // Reenable automatic WAW syncs +/// agsDriverExtensionsDX11_EndUAVOverlap( m_agsContext ); +/// \endcode +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// with the AGS_DX11_EXTENSION_DEFERRED_CONTEXTS bit. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_BeginUAVOverlap( AGSContext* context, ID3D11DeviceContext* dxContext ); + +/// +/// Function used indicate to the driver it can no longer overlap the batch of back-to-back dispatches that has been submitted. +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// with the AGS_DX11_EXTENSION_DEFERRED_CONTEXTS bit. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_EndUAVOverlap( AGSContext* context, ID3D11DeviceContext* dxContext ); + +/// @} + +/// \defgroup dx11DepthBoundsTest Depth Bounds Test +/// API for enabling depth bounds testing +/// @{ + +/// +/// Function used to set the depth bounds test extension +/// +/// \param [in] context Pointer to a context +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] enabled Whether to enable or disable the depth bounds testing. If disabled, the next two args are ignored. +/// \param [in] minDepth The near depth range to clip against. +/// \param [in] maxDepth The far depth range to clip against. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDepthBounds( AGSContext* context, ID3D11DeviceContext* dxContext, bool enabled, float minDepth, float maxDepth ); + +/// @} + +/// \defgroup mdi Multi Draw Indirect (MDI) +/// API for dispatching multiple instanced draw commands. +/// The multi draw indirect extensions allow multiple sets of DrawInstancedIndirect to be submitted in one API call. +/// The draw calls are issued on the GPU's command processor (CP), potentially saving the significant CPU overheads incurred by submitting the equivalent draw calls on the CPU. +/// +/// The extension allows the following code: +/// \code{.cpp} +/// // Submit n batches of DrawIndirect calls +/// for ( int i = 0; i < n; i++ ) +/// deviceContext->DrawIndexedInstancedIndirect( buffer, i * sizeof( cmd ) ); +/// \endcode +/// To be replaced by the following call: +/// \code{.cpp} +/// // Submit all n batches in one call +/// agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( m_agsContext, deviceContext, n, buffer, 0, sizeof( cmd ) ); +/// \endcode +/// +/// The buffer used for the indirect args must be of the following formats: +/// \code{.cpp} +/// // Buffer layout for agsDriverExtensions_MultiDrawInstancedIndirect +/// struct DrawInstancedIndirectArgs +/// { +/// UINT VertexCountPerInstance; +/// UINT InstanceCount; +/// UINT StartVertexLocation; +/// UINT StartInstanceLocation; +/// }; +/// +/// // Buffer layout for agsDriverExtensions_MultiDrawIndexedInstancedIndirect +/// struct DrawIndexedInstancedIndirectArgs +/// { +/// UINT IndexCountPerInstance; +/// UINT InstanceCount; +/// UINT StartIndexLocation; +/// UINT BaseVertexLocation; +/// UINT StartInstanceLocation; +/// }; +/// \endcode +/// +/// Example usage can be seen in AMD's GeometryFX (https://github.com/GPUOpen-Effects/GeometryFX). In particular, in this file: https://github.com/GPUOpen-Effects/GeometryFX/blob/master/amd_geometryfx/src/AMD_GeometryFX_Filtering.cpp +/// +/// @{ + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] drawCount The number of draws. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] drawCount The number of draws. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, unsigned int drawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] pBufferForDrawCount The draw count buffer. +/// \param [in] alignedByteOffsetForDrawCount The offset into the draw count buffer. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawInstancedIndirectCountIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// +/// Function used to submit a batch of draws via MultiDrawIndirect +/// +/// \param [in] context Pointer to a context. +/// \param [in] dxContext Pointer to the DirectX device context. If this is to work using the non-immediate context, then you need to check support. If nullptr is specified, then the immediate context is assumed. +/// \param [in] pBufferForDrawCount The draw count buffer. +/// \param [in] alignedByteOffsetForDrawCount The offset into the draw count buffer. +/// \param [in] pBufferForArgs The args buffer. +/// \param [in] alignedByteOffsetForArgs The offset into the args buffer. +/// \param [in] byteStrideForArgs The per element stride of the args buffer. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_MultiDrawIndexedInstancedIndirectCountIndirect( AGSContext* context, ID3D11DeviceContext* dxContext, ID3D11Buffer* pBufferForDrawCount, unsigned int alignedByteOffsetForDrawCount, ID3D11Buffer* pBufferForArgs, unsigned int alignedByteOffsetForArgs, unsigned int byteStrideForArgs ); + +/// @} + +/// \defgroup shadercompiler Shader Compiler Controls +/// API for controlling DirectX11 shader compilation. +/// Check support for this feature using the AGS_DX11_EXTENSION_CREATE_SHADER_CONTROLS bit. +/// Supported in Radeon Software Version 16.9.2 (driver version 16.40.2311) onwards. +/// @{ + +/// +/// This method can be used to limit the maximum number of threads the driver uses for asynchronous shader compilation. +/// Setting it to 0 will disable asynchronous compilation completely and force the shaders to be compiled "inline" on the threads that call Create*Shader. +/// +/// This method can only be called before any shaders are created and being compiled by the driver. +/// If this method is called after shaders have been created the function will return AGS_FAILURE. +/// This function only sets an upper limit.The driver may create fewer threads than allowed by this function. +/// +/// \param [in] context Pointer to a context. +/// \param [in] numberOfThreads The maximum number of threads to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetMaxAsyncCompileThreadCount( AGSContext* context, unsigned int numberOfThreads ); + +/// +/// This method can be used to determine the total number of asynchronous shader compile jobs that are either +/// queued for waiting for compilation or being compiled by the driver�s asynchronous compilation threads. +/// This method can be called at any during the lifetime of the driver. +/// +/// \param [in] context Pointer to a context. +/// \param [out] numberOfJobs Pointer to the number of jobs in flight currently. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NumPendingAsyncCompileJobs( AGSContext* context, unsigned int* numberOfJobs ); + +/// +/// This method can be used to enable or disable the disk based shader cache. +/// Enabling/disabling the disk cache is not supported if is it disabled explicitly via Radeon Settings or by an app profile. +/// Calling this method under these conditions will result in AGS_FAILURE being returned. +/// It is recommended that this method be called before any shaders are created by the application and being compiled by the driver. +/// Doing so at any other time may result in the cache being left in an inconsistent state. +/// +/// \param [in] context Pointer to a context. +/// \param [in] enable Whether to enable the disk cache. 0 to disable, 1 to enable. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetDiskShaderCacheEnabled( AGSContext* context, int enable ); + +/// @} + +/// \defgroup multiview Multiview +/// API for multiview broadcasting. +/// Check support for this feature using the AGS_DX11_EXTENSION_MULTIVIEW bit. +/// Supported in Radeon Software Version 16.12.1 (driver version 16.50.2001) onwards. +/// @{ + +/// +/// Function to control draw calls replication to multiple viewports and RT slices. +/// Setting any mask to 0 disables draw replication. +/// +/// \param [in] context Pointer to a context. +/// \param [in] vpMask Viewport control bit mask. +/// \param [in] rtSliceMask RT slice control bit mask. +/// \param [in] vpMaskPerRtSliceEnabled If 0, 16 lower bits of vpMask apply to all RT slices; if 1 each 16 bits of 64-bit mask apply to corresponding 4 RT slices. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetViewBroadcastMasks( AGSContext* context, unsigned long long vpMask, unsigned long long rtSliceMask, int vpMaskPerRtSliceEnabled ); + +/// +/// Function returns max number of supported clip rectangles. +/// +/// \param [in] context Pointer to a context. +/// \param [out] maxRectCount Returned max number of clip rectangles. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_GetMaxClipRects( AGSContext* context, unsigned int* maxRectCount ); + +/// +/// Function sets clip rectangles. +/// +/// \param [in] context Pointer to a context. +/// \param [in] clipRectCount Number of specified clip rectangles. Use 0 to disable clip rectangles. +/// \param [in] clipRects Array of clip rectangles. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_SetClipRects( AGSContext* context, unsigned int clipRectCount, const AGSClipRect* clipRects ); + +/// @} + +/// \defgroup cfxapi Explicit Crossfire API +/// API for explicit control over Crossfire +/// @{ + +/// The Crossfire API transfer types +enum AGSAfrTransferType +{ + AGS_AFR_TRANSFER_DEFAULT = 0, ///< Default Crossfire driver resource tracking + AGS_AFR_TRANSFER_DISABLE = 1, ///< Turn off driver resource tracking + AGS_AFR_TRANSFER_1STEP_P2P = 2, ///< App controlled GPU to next GPU transfer + AGS_AFR_TRANSFER_2STEP_NO_BROADCAST = 3, ///< App controlled GPU to next GPU transfer using intermediate system memory + AGS_AFR_TRANSFER_2STEP_WITH_BROADCAST = 4, ///< App controlled GPU to all render GPUs transfer using intermediate system memory +}; + +/// The Crossfire API transfer engines +enum AGSAfrTransferEngine +{ + AGS_AFR_TRANSFERENGINE_DEFAULT = 0, ///< Use default engine for Crossfire API transfers + AGS_AFR_TRANSFERENGINE_3D_ENGINE = 1, ///< Use 3D engine for Crossfire API transfers + AGS_AFR_TRANSFERENGINE_COPY_ENGINE = 2, ///< Use Copy engine for Crossfire API transfers +}; + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] buffer Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateBuffer( AGSContext* context, const D3D11_BUFFER_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Buffer** buffer, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] texture1D Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateTexture1D( AGSContext* context, const D3D11_TEXTURE1D_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Texture1D** texture1D, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] texture2D Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateTexture2D( AGSContext* context, const D3D11_TEXTURE2D_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Texture2D** texture2D, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to create a Direct3D11 resource with the specified AFR transfer type and specified transfer engine. +/// +/// \param [in] context Pointer to a context. +/// \param [in] desc Pointer to the D3D11 resource description. +/// \param [in] initialData Optional pointer to the initializing data for the resource. +/// \param [out] texture3D Returned pointer to the resource. +/// \param [in] transferType The transfer behavior. +/// \param [in] transferEngine The transfer engine to use. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_CreateTexture3D( AGSContext* context, const D3D11_TEXTURE3D_DESC* desc, const D3D11_SUBRESOURCE_DATA* initialData, ID3D11Texture3D** texture3D, AGSAfrTransferType transferType, AGSAfrTransferEngine transferEngine ); + +/// +/// Function to notify the driver that we have finished writing to the resource this frame. +/// This will initiate a transfer for AGS_AFR_TRANSFER_1STEP_P2P, +/// AGS_AFR_TRANSFER_2STEP_NO_BROADCAST, and AGS_AFR_TRANSFER_2STEP_WITH_BROADCAST. +/// +/// \param [in] context Pointer to a context. +/// \param [in] resource Pointer to the resource. +/// \param [in] transferRegions An array of transfer regions (can be null to specify the whole area). +/// \param [in] subresourceArray An array of subresource indices (can be null to specify all subresources). +/// \param [in] numSubresources The number of subresources in subresourceArray OR number of transferRegions. Use 0 to specify ALL subresources and one transferRegion (which may be null if specifying the whole area). +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceEndWrites( AGSContext* context, ID3D11Resource* resource, const D3D11_RECT* transferRegions, const unsigned int* subresourceArray, unsigned int numSubresources ); + +/// +/// This will notify the driver that the app will begin read/write access to the resource. +/// +/// \param [in] context Pointer to a context. +/// \param [in] resource Pointer to the resource. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceBeginAllAccess( AGSContext* context, ID3D11Resource* resource ); + +/// +/// This is used for AGS_AFR_TRANSFER_1STEP_P2P to notify when it is safe to initiate a transfer. +/// This call in frame N-(NumGpus-1) allows a 1 step P2P in frame N to start. +/// This should be called after agsDriverExtensionsDX11_NotifyResourceEndWrites. +/// +/// \param [in] context Pointer to a context. +/// \param [in] resource Pointer to the resource. +/// +AMD_AGS_API AGSReturnCode agsDriverExtensionsDX11_NotifyResourceEndAllAccess( AGSContext* context, ID3D11Resource* resource ); + +/// @} + +/// @} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // AMD_AGS_H diff --git a/include/d3d12.h b/include/d3d12.h new file mode 100644 index 00000000..46a8fe2f --- /dev/null +++ b/include/d3d12.h @@ -0,0 +1,5315 @@ +/*** Autogenerated by WIDL 5.10 from ../../wine-mirror-git/include/d3d12.idl - Do not edit ***/ + +#ifdef _WIN32 +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif +#include +#include +#endif + +#ifndef COM_NO_WINDOWS_H +#include +#include +#endif + +#ifndef __d3d12_h__ +#define __d3d12_h__ + +/* Forward declarations */ + +#ifndef __ID3D12Object_FWD_DEFINED__ +#define __ID3D12Object_FWD_DEFINED__ +typedef interface ID3D12Object ID3D12Object; +#ifdef __cplusplus +interface ID3D12Object; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12DeviceChild_FWD_DEFINED__ +#define __ID3D12DeviceChild_FWD_DEFINED__ +typedef interface ID3D12DeviceChild ID3D12DeviceChild; +#ifdef __cplusplus +interface ID3D12DeviceChild; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12Pageable_FWD_DEFINED__ +#define __ID3D12Pageable_FWD_DEFINED__ +typedef interface ID3D12Pageable ID3D12Pageable; +#ifdef __cplusplus +interface ID3D12Pageable; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12Resource_FWD_DEFINED__ +#define __ID3D12Resource_FWD_DEFINED__ +typedef interface ID3D12Resource ID3D12Resource; +#ifdef __cplusplus +interface ID3D12Resource; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12CommandList_FWD_DEFINED__ +#define __ID3D12CommandList_FWD_DEFINED__ +typedef interface ID3D12CommandList ID3D12CommandList; +#ifdef __cplusplus +interface ID3D12CommandList; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12DescriptorHeap_FWD_DEFINED__ +#define __ID3D12DescriptorHeap_FWD_DEFINED__ +typedef interface ID3D12DescriptorHeap ID3D12DescriptorHeap; +#ifdef __cplusplus +interface ID3D12DescriptorHeap; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12QueryHeap_FWD_DEFINED__ +#define __ID3D12QueryHeap_FWD_DEFINED__ +typedef interface ID3D12QueryHeap ID3D12QueryHeap; +#ifdef __cplusplus +interface ID3D12QueryHeap; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12CommandSignature_FWD_DEFINED__ +#define __ID3D12CommandSignature_FWD_DEFINED__ +typedef interface ID3D12CommandSignature ID3D12CommandSignature; +#ifdef __cplusplus +interface ID3D12CommandSignature; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12GraphicsCommandList_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList ID3D12GraphicsCommandList; +#ifdef __cplusplus +interface ID3D12GraphicsCommandList; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12CommandQueue_FWD_DEFINED__ +#define __ID3D12CommandQueue_FWD_DEFINED__ +typedef interface ID3D12CommandQueue ID3D12CommandQueue; +#ifdef __cplusplus +interface ID3D12CommandQueue; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12RootSignature_FWD_DEFINED__ +#define __ID3D12RootSignature_FWD_DEFINED__ +typedef interface ID3D12RootSignature ID3D12RootSignature; +#ifdef __cplusplus +interface ID3D12RootSignature; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12PipelineState_FWD_DEFINED__ +#define __ID3D12PipelineState_FWD_DEFINED__ +typedef interface ID3D12PipelineState ID3D12PipelineState; +#ifdef __cplusplus +interface ID3D12PipelineState; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12Fence_FWD_DEFINED__ +#define __ID3D12Fence_FWD_DEFINED__ +typedef interface ID3D12Fence ID3D12Fence; +#ifdef __cplusplus +interface ID3D12Fence; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12CommandAllocator_FWD_DEFINED__ +#define __ID3D12CommandAllocator_FWD_DEFINED__ +typedef interface ID3D12CommandAllocator ID3D12CommandAllocator; +#ifdef __cplusplus +interface ID3D12CommandAllocator; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12Device_FWD_DEFINED__ +#define __ID3D12Device_FWD_DEFINED__ +typedef interface ID3D12Device ID3D12Device; +#ifdef __cplusplus +interface ID3D12Device; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12Debug_FWD_DEFINED__ +#define __ID3D12Debug_FWD_DEFINED__ +typedef interface ID3D12Debug ID3D12Debug; +#ifdef __cplusplus +interface ID3D12Debug; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12RootSignatureDeserializer_FWD_DEFINED__ +#define __ID3D12RootSignatureDeserializer_FWD_DEFINED__ +typedef interface ID3D12RootSignatureDeserializer ID3D12RootSignatureDeserializer; +#ifdef __cplusplus +interface ID3D12RootSignatureDeserializer; +#endif /* __cplusplus */ +#endif + +/* Headers for imported files */ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _D3D12_CONSTANTS +#define _D3D12_CONSTANTS +#define D3D12_CS_TGSM_REGISTER_COUNT (8192) + +#define D3D12_MAX_ROOT_COST (64) + +#define D3D12_VIEWPORT_BOUNDS_MAX (32767) + +#define D3D12_VIEWPORT_BOUNDS_MIN (-32768) + +#define D3D12_APPEND_ALIGNED_ELEMENT (0xffffffff) + +#define D3D12_DEFAULT_BLEND_FACTOR_ALPHA (1.0f) +#define D3D12_DEFAULT_BLEND_FACTOR_BLUE (1.0f) +#define D3D12_DEFAULT_BLEND_FACTOR_GREEN (1.0f) +#define D3D12_DEFAULT_BLEND_FACTOR_RED (1.0f) +#define D3D12_DEFAULT_DEPTH_BIAS (0) + +#define D3D12_DEFAULT_DEPTH_BIAS_CLAMP (0.0f) +#define D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS (0.0f) +#define D3D12_DEFAULT_STENCIL_READ_MASK (0xff) + +#define D3D12_DEFAULT_STENCIL_WRITE_MASK (0xff) + +#define D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND (0xffffffff) + +#define D3D12_FLOAT32_MAX (3.402823466e+38f) +#define D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT (32) + +#define D3D12_REQ_MIP_LEVELS (15) + +#define D3D12_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION (2048) + +#define D3D12_REQ_TEXTURE1D_U_DIMENSION (16384) + +#define D3D12_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION (2048) + +#define D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION (16384) + +#define D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION (2048) + +#define D3D12_REQ_TEXTURECUBE_DIMENSION (16384) + +#define D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES (0xffffffff) + +#define D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT (8) + +#define D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT (256) + +#define D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT (65536) + +#define D3D12_TEXTURE_DATA_PITCH_ALIGNMENT (256) + +#define D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT (512) + +#define D3D12_VS_INPUT_REGISTER_COUNT (32) + +#define D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE (16) + +#endif +#define D3D12_SHADER_COMPONENT_MAPPING_MASK (0x7) + +#define D3D12_SHADER_COMPONENT_MAPPING_SHIFT (3) + +#define D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES (1 << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 4)) + +typedef enum D3D12_SHADER_MIN_PRECISION_SUPPORT { + D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE = 0x0, + D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT = 0x1, + D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT = 0x2 +} D3D12_SHADER_MIN_PRECISION_SUPPORT; +typedef enum D3D12_TILED_RESOURCES_TIER { + D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED = 0, + D3D12_TILED_RESOURCES_TIER_1 = 1, + D3D12_TILED_RESOURCES_TIER_2 = 2, + D3D12_TILED_RESOURCES_TIER_3 = 3 +} D3D12_TILED_RESOURCES_TIER; +typedef enum D3D12_RESOURCE_BINDING_TIER { + D3D12_RESOURCE_BINDING_TIER_1 = 1, + D3D12_RESOURCE_BINDING_TIER_2 = 2, + D3D12_RESOURCE_BINDING_TIER_3 = 3 +} D3D12_RESOURCE_BINDING_TIER; +typedef enum D3D12_CONSERVATIVE_RASTERIZATION_TIER { + D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED = 0, + D3D12_CONSERVATIVE_RASTERIZATION_TIER_1 = 1, + D3D12_CONSERVATIVE_RASTERIZATION_TIER_2 = 2, + D3D12_CONSERVATIVE_RASTERIZATION_TIER_3 = 3 +} D3D12_CONSERVATIVE_RASTERIZATION_TIER; +typedef enum D3D12_CROSS_NODE_SHARING_TIER { + D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED = 0, + D3D12_CROSS_NODE_SHARING_TIER_1_EMULATED = 1, + D3D12_CROSS_NODE_SHARING_TIER_1 = 2, + D3D12_CROSS_NODE_SHARING_TIER_2 = 3 +} D3D12_CROSS_NODE_SHARING_TIER; +typedef enum D3D12_RESOURCE_HEAP_TIER { + D3D12_RESOURCE_HEAP_TIER_1 = 1, + D3D12_RESOURCE_HEAP_TIER_2 = 2 +} D3D12_RESOURCE_HEAP_TIER; +typedef enum D3D12_FORMAT_SUPPORT1 { + D3D12_FORMAT_SUPPORT1_NONE = 0x0, + D3D12_FORMAT_SUPPORT1_BUFFER = 0x1, + D3D12_FORMAT_SUPPORT1_IA_VERTEX_BUFFER = 0x2, + D3D12_FORMAT_SUPPORT1_IA_INDEX_BUFFER = 0x4, + D3D12_FORMAT_SUPPORT1_SO_BUFFER = 0x8, + D3D12_FORMAT_SUPPORT1_TEXTURE1D = 0x10, + D3D12_FORMAT_SUPPORT1_TEXTURE2D = 0x20, + D3D12_FORMAT_SUPPORT1_TEXTURE3D = 0x40, + D3D12_FORMAT_SUPPORT1_TEXTURECUBE = 0x80, + D3D12_FORMAT_SUPPORT1_SHADER_LOAD = 0x100, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE = 0x200, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON = 0x400, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_MONO_TEXT = 0x800, + D3D12_FORMAT_SUPPORT1_MIP = 0x1000, + D3D12_FORMAT_SUPPORT1_RENDER_TARGET = 0x4000, + D3D12_FORMAT_SUPPORT1_BLENDABLE = 0x8000, + D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL = 0x10000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RESOLVE = 0x40000, + D3D12_FORMAT_SUPPORT1_DISPLAY = 0x80000, + D3D12_FORMAT_SUPPORT1_CAST_WITHIN_BIT_LAYOUT = 0x100000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RENDERTARGET = 0x200000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_LOAD = 0x400000, + D3D12_FORMAT_SUPPORT1_SHADER_GATHER = 0x800000, + D3D12_FORMAT_SUPPORT1_BACK_BUFFER_CAST = 0x1000000, + D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000, + D3D12_FORMAT_SUPPORT1_SHADER_GATHER_COMPARISON = 0x4000000, + D3D12_FORMAT_SUPPORT1_DECODER_OUTPUT = 0x8000000, + D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_OUTPUT = 0x10000000, + D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_INPUT = 0x20000000, + D3D12_FORMAT_SUPPORT1_VIDEO_ENCODER = 0x40000000 +} D3D12_FORMAT_SUPPORT1; +typedef enum D3D12_FORMAT_SUPPORT2 { + D3D12_FORMAT_SUPPORT2_NONE = 0x0, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20, + D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40, + D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80, + D3D12_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x100, + D3D12_FORMAT_SUPPORT2_TILED = 0x200, + D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000 +} D3D12_FORMAT_SUPPORT2; +#ifndef __ID3D12Fence_FWD_DEFINED__ +#define __ID3D12Fence_FWD_DEFINED__ +typedef interface ID3D12Fence ID3D12Fence; +#ifdef __cplusplus +interface ID3D12Fence; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12RootSignature_FWD_DEFINED__ +#define __ID3D12RootSignature_FWD_DEFINED__ +typedef interface ID3D12RootSignature ID3D12RootSignature; +#ifdef __cplusplus +interface ID3D12RootSignature; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12Heap_FWD_DEFINED__ +#define __ID3D12Heap_FWD_DEFINED__ +typedef interface ID3D12Heap ID3D12Heap; +#ifdef __cplusplus +interface ID3D12Heap; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12DescriptorHeap_FWD_DEFINED__ +#define __ID3D12DescriptorHeap_FWD_DEFINED__ +typedef interface ID3D12DescriptorHeap ID3D12DescriptorHeap; +#ifdef __cplusplus +interface ID3D12DescriptorHeap; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12Resource_FWD_DEFINED__ +#define __ID3D12Resource_FWD_DEFINED__ +typedef interface ID3D12Resource ID3D12Resource; +#ifdef __cplusplus +interface ID3D12Resource; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12CommandAllocator_FWD_DEFINED__ +#define __ID3D12CommandAllocator_FWD_DEFINED__ +typedef interface ID3D12CommandAllocator ID3D12CommandAllocator; +#ifdef __cplusplus +interface ID3D12CommandAllocator; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12GraphicsCommandList_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList ID3D12GraphicsCommandList; +#ifdef __cplusplus +interface ID3D12GraphicsCommandList; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12CommandQueue_FWD_DEFINED__ +#define __ID3D12CommandQueue_FWD_DEFINED__ +typedef interface ID3D12CommandQueue ID3D12CommandQueue; +#ifdef __cplusplus +interface ID3D12CommandQueue; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12PipelineState_FWD_DEFINED__ +#define __ID3D12PipelineState_FWD_DEFINED__ +typedef interface ID3D12PipelineState ID3D12PipelineState; +#ifdef __cplusplus +interface ID3D12PipelineState; +#endif /* __cplusplus */ +#endif + +#ifndef __ID3D12Device_FWD_DEFINED__ +#define __ID3D12Device_FWD_DEFINED__ +typedef interface ID3D12Device ID3D12Device; +#ifdef __cplusplus +interface ID3D12Device; +#endif /* __cplusplus */ +#endif + +typedef RECT D3D12_RECT; +typedef struct D3D12_BOX { + UINT left; + UINT top; + UINT front; + UINT right; + UINT bottom; + UINT back; +} D3D12_BOX; +typedef struct D3D12_VIEWPORT { + FLOAT TopLeftX; + FLOAT TopLeftY; + FLOAT Width; + FLOAT Height; + FLOAT MinDepth; + FLOAT MaxDepth; +} D3D12_VIEWPORT; +typedef struct D3D12_RANGE { + SIZE_T Begin; + SIZE_T End; +} D3D12_RANGE; +typedef struct D3D12_RESOURCE_ALLOCATION_INFO { + UINT64 SizeInBytes; + UINT64 Alignment; +} D3D12_RESOURCE_ALLOCATION_INFO; +typedef struct D3D12_DRAW_ARGUMENTS { + UINT VertexCountPerInstance; + UINT InstanceCount; + UINT StartVertexLocation; + UINT StartInstanceLocation; +} D3D12_DRAW_ARGUMENTS; +typedef struct D3D12_DRAW_INDEXED_ARGUMENTS { + UINT IndexCountPerInstance; + UINT InstanceCount; + UINT StartIndexLocation; + INT BaseVertexLocation; + UINT StartInstanceLocation; +} D3D12_DRAW_INDEXED_ARGUMENTS; +typedef struct D3D12_DISPATCH_ARGUMENTS { + UINT ThreadGroupCountX; + UINT ThreadGroupCountY; + UINT ThreadGroupCountZ; +} D3D12_DISPATCH_ARGUMENTS; +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS { + BOOL DoublePrecisionFloatShaderOps; + BOOL OutputMergerLogicOp; + D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport; + D3D12_TILED_RESOURCES_TIER TiledResourcesTier; + D3D12_RESOURCE_BINDING_TIER ResourceBindingTier; + BOOL PSSpecifiedStencilRefSupported; + BOOL TypedUAVLoadAdditionalFormats; + BOOL ROVsSupported; + D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier; + UINT MaxGPUVirtualAddressBitsPerResource; + BOOL StandardSwizzle64KBSupported; + D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier; + BOOL CrossAdapterRowMajorTextureSupported; + BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation; + D3D12_RESOURCE_HEAP_TIER ResourceHeapTier; +} D3D12_FEATURE_DATA_D3D12_OPTIONS; +typedef struct D3D12_FEATURE_DATA_FORMAT_SUPPORT { + DXGI_FORMAT Format; + D3D12_FORMAT_SUPPORT1 Support1; + D3D12_FORMAT_SUPPORT2 Support2; +} D3D12_FEATURE_DATA_FORMAT_SUPPORT; +typedef 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; +typedef enum D3D12_CPU_PAGE_PROPERTY { + D3D12_CPU_PAGE_PROPERTY_UNKNOWN = 0, + D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE = 2, + D3D12_CPU_PAGE_PROPERTY_WRITE_BACK = 3 +} D3D12_CPU_PAGE_PROPERTY; +typedef enum D3D12_MEMORY_POOL { + D3D12_MEMORY_POOL_UNKNOWN = 0, + D3D12_MEMORY_POOL_L0 = 1, + D3D12_MEMORY_POOL_L1 = 2 +} D3D12_MEMORY_POOL; +typedef struct D3D12_HEAP_PROPERTIES { + D3D12_HEAP_TYPE Type; + D3D12_CPU_PAGE_PROPERTY CPUPageProperty; + D3D12_MEMORY_POOL MemoryPoolPreference; + UINT CreationNodeMask; + UINT VisibleNodeMask; +} D3D12_HEAP_PROPERTIES; +typedef enum D3D12_HEAP_FLAGS { + D3D12_HEAP_FLAG_NONE = 0x0, + D3D12_HEAP_FLAG_SHARED = 0x1, + D3D12_HEAP_FLAG_DENY_BUFFERS = 0x4, + D3D12_HEAP_FLAG_ALLOW_DISPLAY = 0x8, + D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER = 0x20, + D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES = 0x40, + D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES = 0x80, + D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0x0, + 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; +typedef struct D3D12_HEAP_DESC { + UINT64 SizeInBytes; + D3D12_HEAP_PROPERTIES Properties; + UINT64 Alignment; + D3D12_HEAP_FLAGS Flags; +} D3D12_HEAP_DESC; +typedef struct D3D12_TILED_RESOURCE_COORDINATE { + UINT X; + UINT Y; + UINT Z; + UINT Subresource; +} D3D12_TILED_RESOURCE_COORDINATE; +typedef struct D3D12_TILE_REGION_SIZE { + UINT NumTiles; + BOOL UseBox; + UINT Width; + UINT16 Height; + UINT16 Depth; +} D3D12_TILE_REGION_SIZE; +typedef struct D3D12_SUBRESOURCE_TILING { + UINT WidthInTiles; + UINT16 HeightInTiles; + UINT16 DepthInTiles; + UINT StartTileIndexInOverallResource; +} D3D12_SUBRESOURCE_TILING; +typedef struct D3D12_TILE_SHAPE { + UINT WidthInTexels; + UINT HeightInTexels; + UINT DepthInTexels; +} D3D12_TILE_SHAPE; +typedef struct D3D12_SHADER_BYTECODE { + const void *pShaderBytecode; + SIZE_T BytecodeLength; +} D3D12_SHADER_BYTECODE; +typedef struct D3D12_DEPTH_STENCIL_VALUE { + FLOAT Depth; + UINT8 Stencil; +} D3D12_DEPTH_STENCIL_VALUE; +typedef struct D3D12_CLEAR_VALUE { + DXGI_FORMAT Format; + __C89_NAMELESS union { + FLOAT Color[4]; + D3D12_DEPTH_STENCIL_VALUE DepthStencil; + } __C89_NAMELESSUNIONNAME; +} D3D12_CLEAR_VALUE; +typedef struct D3D12_PACKED_MIP_INFO { + UINT8 NumStandardMips; + UINT8 NumPackedMips; + UINT NumTilesForPackedMips; + UINT StartTileIndexInOverallResource; +} D3D12_PACKED_MIP_INFO; +typedef enum D3D12_RESOURCE_STATES { + D3D12_RESOURCE_STATE_COMMON = 0, + D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER = 0x1, + D3D12_RESOURCE_STATE_INDEX_BUFFER = 0x2, + D3D12_RESOURCE_STATE_RENDER_TARGET = 0x4, + D3D12_RESOURCE_STATE_UNORDERED_ACCESS = 0x8, + D3D12_RESOURCE_STATE_DEPTH_WRITE = 0x10, + D3D12_RESOURCE_STATE_DEPTH_READ = 0x20, + D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE = 0x40, + D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE = 0x80, + D3D12_RESOURCE_STATE_STREAM_OUT = 0x100, + D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT = 0x200, + D3D12_RESOURCE_STATE_COPY_DEST = 0x400, + D3D12_RESOURCE_STATE_COPY_SOURCE = 0x800, + D3D12_RESOURCE_STATE_RESOLVE_DEST = 0x1000, + D3D12_RESOURCE_STATE_RESOLVE_SOURCE = 0x2000, + D3D12_RESOURCE_STATE_GENERIC_READ = ((((0x1 | 0x2) | 0x40) | 0x80) | 0x200) | 0x800, + D3D12_RESOURCE_STATE_PRESENT = 0x0, + D3D12_RESOURCE_STATE_PREDICATION = 0x200 +} D3D12_RESOURCE_STATES; +DEFINE_ENUM_FLAG_OPERATORS(D3D12_RESOURCE_STATES); +typedef enum D3D12_RESOURCE_BARRIER_TYPE { + D3D12_RESOURCE_BARRIER_TYPE_TRANSITION = 0, + D3D12_RESOURCE_BARRIER_TYPE_ALIASING = 1, + D3D12_RESOURCE_BARRIER_TYPE_UAV = 2 +} D3D12_RESOURCE_BARRIER_TYPE; +typedef enum D3D12_RESOURCE_BARRIER_FLAGS { + D3D12_RESOURCE_BARRIER_FLAG_NONE = 0x0, + D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY = 0x1, + D3D12_RESOURCE_BARRIER_FLAG_END_ONLY = 0x2 +} D3D12_RESOURCE_BARRIER_FLAGS; +typedef struct D3D12_RESOURCE_TRANSITION_BARRIER { + ID3D12Resource *pResource; + UINT Subresource; + D3D12_RESOURCE_STATES StateBefore; + D3D12_RESOURCE_STATES StateAfter; +} D3D12_RESOURCE_TRANSITION_BARRIER; +typedef struct D3D12_RESOURCE_ALIASING_BARRIER_ALIASING { + ID3D12Resource *pResourceBefore; + ID3D12Resource *pResourceAfter; +} D3D12_RESOURCE_ALIASING_BARRIER; +typedef struct D3D12_RESOURCE_UAV_BARRIER { + ID3D12Resource *pResource; +} D3D12_RESOURCE_UAV_BARRIER; +typedef struct D3D12_RESOURCE_BARRIER { + D3D12_RESOURCE_BARRIER_TYPE Type; + D3D12_RESOURCE_BARRIER_FLAGS Flags; + __C89_NAMELESS union { + D3D12_RESOURCE_TRANSITION_BARRIER Transition; + D3D12_RESOURCE_ALIASING_BARRIER Aliasing; + D3D12_RESOURCE_UAV_BARRIER UAV; + } __C89_NAMELESSUNIONNAME; +} D3D12_RESOURCE_BARRIER; +typedef enum D3D12_RESOURCE_DIMENSION { + D3D12_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D12_RESOURCE_DIMENSION_BUFFER = 1, + D3D12_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D12_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D12_RESOURCE_DIMENSION_TEXTURE3D = 4 +} D3D12_RESOURCE_DIMENSION; +typedef enum D3D12_TEXTURE_LAYOUT { + D3D12_TEXTURE_LAYOUT_UNKNOWN = 0, + D3D12_TEXTURE_LAYOUT_ROW_MAJOR = 1, + D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE = 2, + D3D12_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE = 3 +} D3D12_TEXTURE_LAYOUT; +typedef enum D3D12_RESOURCE_FLAGS { + D3D12_RESOURCE_FLAG_NONE = 0x0, + D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET = 0x1, + D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL = 0x2, + D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS = 0x4, + D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE = 0x8, + D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER = 0x10, + D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS = 0x20 +} D3D12_RESOURCE_FLAGS; +DEFINE_ENUM_FLAG_OPERATORS(D3D12_RESOURCE_FLAGS); +typedef struct D3D12_RESOURCE_DESC { + D3D12_RESOURCE_DIMENSION Dimension; + UINT64 Alignment; + UINT64 Width; + UINT Height; + UINT16 DepthOrArraySize; + UINT16 MipLevels; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; + D3D12_TEXTURE_LAYOUT Layout; + D3D12_RESOURCE_FLAGS Flags; +} D3D12_RESOURCE_DESC; +typedef enum D3D12_TEXTURE_COPY_TYPE { + D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX = 0, + D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT = 1 +} D3D12_TEXTURE_COPY_TYPE; +typedef struct D3D12_SUBRESOURCE_FOOTPRINT { + DXGI_FORMAT Format; + UINT Width; + UINT Height; + UINT Depth; + UINT RowPitch; +} D3D12_SUBRESOURCE_FOOTPRINT; +typedef struct D3D12_PLACED_SUBRESOURCE_FOOTPRINT { + UINT64 Offset; + D3D12_SUBRESOURCE_FOOTPRINT Footprint; +} D3D12_PLACED_SUBRESOURCE_FOOTPRINT; +typedef struct D3D12_TEXTURE_COPY_LOCATION { + ID3D12Resource *pResource; + D3D12_TEXTURE_COPY_TYPE Type; + __C89_NAMELESS union { + D3D12_PLACED_SUBRESOURCE_FOOTPRINT PlacedFootprint; + UINT SubresourceIndex; + } __C89_NAMELESSUNIONNAME; +} D3D12_TEXTURE_COPY_LOCATION; +typedef enum D3D12_DESCRIPTOR_RANGE_TYPE { + D3D12_DESCRIPTOR_RANGE_TYPE_SRV = 0, + D3D12_DESCRIPTOR_RANGE_TYPE_UAV = 1, + D3D12_DESCRIPTOR_RANGE_TYPE_CBV = 2, + D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER = 3 +} D3D12_DESCRIPTOR_RANGE_TYPE; +typedef struct D3D12_DESCRIPTOR_RANGE { + D3D12_DESCRIPTOR_RANGE_TYPE RangeType; + UINT NumDescriptors; + UINT BaseShaderRegister; + UINT RegisterSpace; + UINT OffsetInDescriptorsFromTableStart; +} D3D12_DESCRIPTOR_RANGE; +typedef enum D3D12_DESCRIPTOR_RANGE_FLAGS { + D3D12_DESCRIPTOR_RANGE_FLAG_NONE = 0 +} D3D12_DESCRIPTOR_RANGE_FLAGS; +typedef struct D3D12_DESCRIPTOR_RANGE1 { + D3D12_DESCRIPTOR_RANGE_TYPE RangeType; + UINT NumDescriptors; + UINT BaseShaderRegister; + UINT RegisterSpace; + D3D12_DESCRIPTOR_RANGE_FLAGS Flags; + UINT OffsetInDescriptorsFromTableStart; +} D3D12_DESCRIPTOR_RANGE1; +typedef struct D3D12_ROOT_DESCRIPTOR_TABLE { + UINT NumDescriptorRanges; + const D3D12_DESCRIPTOR_RANGE *pDescriptorRanges; +} D3D12_ROOT_DESCRIPTOR_TABLE; +typedef struct D3D12_ROOT_DESCRIPTOR_TABLE1 { + UINT NumDescriptorRanges; + const D3D12_DESCRIPTOR_RANGE1 *pDescriptorRanges; +} D3D12_ROOT_DESCRIPTOR_TABLE1; +typedef struct D3D12_ROOT_CONSTANTS { + UINT ShaderRegister; + UINT RegisterSpace; + UINT Num32BitValues; +} D3D12_ROOT_CONSTANTS; +typedef struct D3D12_ROOT_DESCRIPTOR { + UINT ShaderRegister; + UINT RegisterSpace; +} D3D12_ROOT_DESCRIPTOR; +typedef enum D3D12_ROOT_DESCRIPTOR_FLAGS { + D3D12_ROOT_DESCRIPTOR_FLAG_NONE = 0 +} D3D12_ROOT_DESCRIPTOR_FLAGS; +typedef struct D3D12_ROOT_DESCRIPTOR1 { + UINT ShaderRegister; + UINT RegisterSpace; + D3D12_ROOT_DESCRIPTOR_FLAGS Flags; +} D3D12_ROOT_DESCRIPTOR1; +typedef enum D3D12_ROOT_PARAMETER_TYPE { + D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE = 0, + D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS = 1, + D3D12_ROOT_PARAMETER_TYPE_CBV = 2, + D3D12_ROOT_PARAMETER_TYPE_SRV = 3, + D3D12_ROOT_PARAMETER_TYPE_UAV = 4 +} D3D12_ROOT_PARAMETER_TYPE; +typedef enum D3D12_SHADER_VISIBILITY { + D3D12_SHADER_VISIBILITY_ALL = 0, + D3D12_SHADER_VISIBILITY_VERTEX = 1, + D3D12_SHADER_VISIBILITY_HULL = 2, + D3D12_SHADER_VISIBILITY_DOMAIN = 3, + D3D12_SHADER_VISIBILITY_GEOMETRY = 4, + D3D12_SHADER_VISIBILITY_PIXEL = 5 +} D3D12_SHADER_VISIBILITY; +typedef struct D3D12_ROOT_PARAMETER { + D3D12_ROOT_PARAMETER_TYPE ParameterType; + __C89_NAMELESS union { + D3D12_ROOT_DESCRIPTOR_TABLE DescriptorTable; + D3D12_ROOT_CONSTANTS Constants; + D3D12_ROOT_DESCRIPTOR Descriptor; + } __C89_NAMELESSUNIONNAME; + D3D12_SHADER_VISIBILITY ShaderVisibility; +} D3D12_ROOT_PARAMETER; +typedef struct D3D12_ROOT_PARAMETER1 { + D3D12_ROOT_PARAMETER_TYPE ParameterType; + __C89_NAMELESS union { + D3D12_ROOT_DESCRIPTOR_TABLE1 DescriptorTable; + D3D12_ROOT_CONSTANTS Constants; + D3D12_ROOT_DESCRIPTOR1 Descriptor; + } __C89_NAMELESSUNIONNAME; + D3D12_SHADER_VISIBILITY ShaderVisibility; +} D3D12_ROOT_PARAMETER1; +typedef enum D3D12_STATIC_BORDER_COLOR { + D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK = 0, + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK = 1, + D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE = 2 +} D3D12_STATIC_BORDER_COLOR; +typedef enum D3D12_FILTER { + D3D12_FILTER_MIN_MAG_MIP_POINT = 0x0, + D3D12_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1, + D3D12_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4, + D3D12_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5, + D3D12_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, + 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_ANISOTROPIC = 0x55, + D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, + D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, + D3D12_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, + D3D12_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, + D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, + 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_ANISOTROPIC = 0xd5, + D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100, + D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101, + D3D12_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104, + D3D12_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105, + D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110, + 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_ANISOTROPIC = 0x155, + D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180, + D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181, + D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184, + D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185, + D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190, + 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_ANISOTROPIC = 0x1d5 +} D3D12_FILTER; +typedef enum D3D12_FILTER_TYPE { + D3D12_FILTER_TYPE_POINT = 0, + D3D12_FILTER_TYPE_LINEAR = 1 +} D3D12_FILTER_TYPE; +#define D3D12_MIP_FILTER_SHIFT (0) + +#define D3D12_MAG_FILTER_SHIFT (2) + +#define D3D12_MIN_FILTER_SHIFT (4) + +#define D3D12_FILTER_TYPE_MASK (0x3) + +#define D3D12_ANISOTROPIC_FILTERING_BIT (0x40) + +typedef enum D3D12_FILTER_REDUCTION_TYPE { + D3D12_FILTER_REDUCTION_TYPE_STANDARD = 0, + D3D12_FILTER_REDUCTION_TYPE_COMPARISON = 1, + D3D12_FILTER_REDUCTION_TYPE_MINIMUM = 2, + D3D12_FILTER_REDUCTION_TYPE_MAXIMUM = 3 +} D3D12_FILTER_REDUCTION_TYPE; +#define D3D12_FILTER_REDUCTION_TYPE_MASK (0x3) + +#define D3D12_FILTER_REDUCTION_TYPE_SHIFT (7) + +#define D3D12_DECODE_MAG_FILTER(filter) \ + ((D3D12_FILTER_TYPE)(((filter) >> D3D12_MAG_FILTER_SHIFT) & D3D12_FILTER_TYPE_MASK)) +#define D3D12_DECODE_MIN_FILTER(filter) \ + ((D3D12_FILTER_TYPE)(((filter) >> D3D12_MIN_FILTER_SHIFT) & D3D12_FILTER_TYPE_MASK)) +#define D3D12_DECODE_MIP_FILTER(filter) \ + ((D3D12_FILTER_TYPE)(((filter) >> D3D12_MIP_FILTER_SHIFT) & D3D12_FILTER_TYPE_MASK)) +#define D3D12_DECODE_IS_ANISOTROPIC_FILTER(filter) \ + (((filter) & D3D12_ANISOTROPIC_FILTERING_BIT) \ + && (D3D12_DECODE_MIN_FILTER(filter) == D3D12_FILTER_TYPE_LINEAR) \ + && (D3D12_DECODE_MAG_FILTER(filter) == D3D12_FILTER_TYPE_LINEAR) \ + && (D3D12_DECODE_MIP_FILTER(filter) == D3D12_FILTER_TYPE_LINEAR)) +#define D3D12_DECODE_FILTER_REDUCTION(filter) \ + ((D3D12_FILTER_REDUCTION_TYPE)(((filter) >> D3D12_FILTER_REDUCTION_TYPE_SHIFT) \ + & D3D12_FILTER_REDUCTION_TYPE_MASK)) +#define D3D12_DECODE_IS_COMPARISON_FILTER(filter) \ + (D3D12_DECODE_FILTER_REDUCTION(filter) == D3D12_FILTER_REDUCTION_TYPE_COMPARISON) +typedef enum D3D12_TEXTURE_ADDRESS_MODE { + D3D12_TEXTURE_ADDRESS_MODE_WRAP = 1, + D3D12_TEXTURE_ADDRESS_MODE_MIRROR = 2, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP = 3, + D3D12_TEXTURE_ADDRESS_MODE_BORDER = 4, + D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE = 5 +} D3D12_TEXTURE_ADDRESS_MODE; +typedef enum D3D12_COMPARISON_FUNC { + D3D12_COMPARISON_FUNC_NEVER = 1, + D3D12_COMPARISON_FUNC_LESS = 2, + D3D12_COMPARISON_FUNC_EQUAL = 3, + D3D12_COMPARISON_FUNC_LESS_EQUAL = 4, + D3D12_COMPARISON_FUNC_GREATER = 5, + D3D12_COMPARISON_FUNC_NOT_EQUAL = 6, + D3D12_COMPARISON_FUNC_GREATER_EQUAL = 7, + D3D12_COMPARISON_FUNC_ALWAYS = 8 +} D3D12_COMPARISON_FUNC; +typedef struct D3D12_STATIC_SAMPLER_DESC { + 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_STATIC_SAMPLER_DESC; +typedef enum D3D12_ROOT_SIGNATURE_FLAGS { + D3D12_ROOT_SIGNATURE_FLAG_NONE = 0x0, + D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT = 0x1, + D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS = 0x2, + D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS = 0x4, + D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS = 0x8, + D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS = 0x10, + D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS = 0x20, + D3D12_ROOT_SIGNATURE_FLAG_ALLOW_STREAM_OUTPUT = 0x40 +} D3D12_ROOT_SIGNATURE_FLAGS; +typedef struct D3D12_ROOT_SIGNATURE_DESC { + UINT NumParameters; + const D3D12_ROOT_PARAMETER *pParameters; + UINT NumStaticSamplers; + const D3D12_STATIC_SAMPLER_DESC *pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; +} D3D12_ROOT_SIGNATURE_DESC; +typedef struct D3D12_ROOT_SIGNATURE_DESC1 { + UINT NumParameters; + const D3D12_ROOT_PARAMETER1 *pParameters; + UINT NumStaticSamplers; + const D3D12_STATIC_SAMPLER_DESC *pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; +} D3D12_ROOT_SIGNATURE_DESC1; +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; +typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC { + D3D_ROOT_SIGNATURE_VERSION Version; + __C89_NAMELESS union { + D3D12_ROOT_SIGNATURE_DESC Desc_1_0; + D3D12_ROOT_SIGNATURE_DESC1 Desc_1_1; + } __C89_NAMELESSUNIONNAME; +} D3D12_VERSIONED_ROOT_SIGNATURE_DESC; +typedef enum D3D12_DESCRIPTOR_HEAP_TYPE { + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV = 0, + D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER = 1, + D3D12_DESCRIPTOR_HEAP_TYPE_RTV = 2, + D3D12_DESCRIPTOR_HEAP_TYPE_DSV = 3, + D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES = 4 +} D3D12_DESCRIPTOR_HEAP_TYPE; +typedef enum D3D12_DESCRIPTOR_HEAP_FLAGS { + D3D12_DESCRIPTOR_HEAP_FLAG_NONE = 0x0, + D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE = 0x1 +} D3D12_DESCRIPTOR_HEAP_FLAGS; +typedef struct D3D12_DESCRIPTOR_HEAP_DESC { + D3D12_DESCRIPTOR_HEAP_TYPE Type; + UINT NumDescriptors; + D3D12_DESCRIPTOR_HEAP_FLAGS Flags; + UINT NodeMask; +} D3D12_DESCRIPTOR_HEAP_DESC; +typedef UINT64 D3D12_GPU_VIRTUAL_ADDRESS; +typedef struct D3D12_CONSTANT_BUFFER_VIEW_DESC { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; +} D3D12_CONSTANT_BUFFER_VIEW_DESC; +typedef enum D3D12_SRV_DIMENSION { + D3D12_SRV_DIMENSION_UNKNOWN = 0, + D3D12_SRV_DIMENSION_BUFFER = 1, + D3D12_SRV_DIMENSION_TEXTURE1D = 2, + D3D12_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D12_SRV_DIMENSION_TEXTURE2D = 4, + D3D12_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D12_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D12_SRV_DIMENSION_TEXTURE3D = 8, + D3D12_SRV_DIMENSION_TEXTURECUBE = 9, + D3D12_SRV_DIMENSION_TEXTURECUBEARRAY = 10 +} D3D12_SRV_DIMENSION; +typedef enum D3D12_BUFFER_SRV_FLAGS { + D3D12_BUFFER_SRV_FLAG_NONE = 0x0, + D3D12_BUFFER_SRV_FLAG_RAW = 0x1 +} D3D12_BUFFER_SRV_FLAGS; +typedef enum D3D12_SHADER_COMPONENT_MAPPING { + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0 = 0, + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1 = 1, + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_2 = 2, + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_3 = 3, + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0 = 4, + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1 = 5 +} D3D12_SHADER_COMPONENT_MAPPING; +#define D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(x, y, z, w) \ + (((x) & D3D12_SHADER_COMPONENT_MAPPING_MASK) \ + | (((y) & D3D12_SHADER_COMPONENT_MAPPING_MASK) << D3D12_SHADER_COMPONENT_MAPPING_SHIFT) \ + | (((z) & D3D12_SHADER_COMPONENT_MAPPING_MASK) << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 2)) \ + | (((w) & D3D12_SHADER_COMPONENT_MAPPING_MASK) << (D3D12_SHADER_COMPONENT_MAPPING_SHIFT * 3)) \ + | D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES) +#define D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0, 1, 2, 3) +typedef struct D3D12_BUFFER_SRV { + UINT64 FirstElement; + UINT NumElements; + UINT StructureByteStride; + D3D12_BUFFER_SRV_FLAGS Flags; +} D3D12_BUFFER_SRV; +typedef struct D3D12_TEX1D_SRV { + UINT MostDetailedMip; + UINT MipLevels; + FLOAT ResourceMinLODClamp; +} D3D12_TEX1D_SRV; +typedef struct D3D12_TEX1D_ARRAY_SRV { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + FLOAT ResourceMinLODClamp; +} D3D12_TEX1D_ARRAY_SRV; +typedef struct D3D12_TEX2D_SRV { + UINT MostDetailedMip; + UINT MipLevels; + UINT PlaneSlice; + FLOAT ResourceMinLODClamp; +} D3D12_TEX2D_SRV; +typedef struct D3D12_TEX2D_ARRAY_SRV { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + UINT PlaneSlice; + FLOAT ResourceMinLODClamp; +} D3D12_TEX2D_ARRAY_SRV; +typedef struct D3D12_TEX2DMS_SRV { + UINT UnusedField_NothingToDefine; +} D3D12_TEX2DMS_SRV; +typedef struct D3D12_TEX2DMS_ARRAY_SRV { + UINT FirstArraySlice; + UINT ArraySize; +} D3D12_TEX2DMS_ARRAY_SRV; +typedef struct D3D12_TEX3D_SRV { + UINT MostDetailedMip; + UINT MipLevels; + FLOAT ResourceMinLODClamp; +} D3D12_TEX3D_SRV; +typedef struct D3D12_TEXCUBE_SRV { + UINT MostDetailedMip; + UINT MipLevels; + FLOAT ResourceMinLODClamp; +} D3D12_TEXCUBE_SRV; +typedef struct D3D12_TEXCUBE_ARRAY_SRV { + UINT MostDetailedMip; + UINT MipLevels; + UINT First2DArrayFace; + UINT NumCubes; + FLOAT ResourceMinLODClamp; +} D3D12_TEXCUBE_ARRAY_SRV; +typedef struct D3D12_SHADER_RESOURCE_VIEW_DESC { + DXGI_FORMAT Format; + D3D12_SRV_DIMENSION ViewDimension; + UINT Shader4ComponentMapping; + __C89_NAMELESS union { + D3D12_BUFFER_SRV Buffer; + D3D12_TEX1D_SRV Texture1D; + D3D12_TEX1D_ARRAY_SRV Texture1DArray; + D3D12_TEX2D_SRV Texture2D; + D3D12_TEX2D_ARRAY_SRV Texture2DArray; + D3D12_TEX2DMS_SRV Texture2DMS; + D3D12_TEX2DMS_ARRAY_SRV Texture2DMSArray; + D3D12_TEX3D_SRV Texture3D; + D3D12_TEXCUBE_SRV TextureCube; + D3D12_TEXCUBE_ARRAY_SRV TextureCubeArray; + } __C89_NAMELESSUNIONNAME; +} D3D12_SHADER_RESOURCE_VIEW_DESC; +typedef enum D3D12_UAV_DIMENSION { + D3D12_UAV_DIMENSION_UNKNOWN = 0, + D3D12_UAV_DIMENSION_BUFFER = 1, + D3D12_UAV_DIMENSION_TEXTURE1D = 2, + D3D12_UAV_DIMENSION_TEXTURE1DARRAY = 3, + D3D12_UAV_DIMENSION_TEXTURE2D = 4, + D3D12_UAV_DIMENSION_TEXTURE2DARRAY = 5, + D3D12_UAV_DIMENSION_TEXTURE3D = 8 +} D3D12_UAV_DIMENSION; +typedef enum D3D12_BUFFER_UAV_FLAGS { + D3D12_BUFFER_UAV_FLAG_NONE = 0x0, + D3D12_BUFFER_UAV_FLAG_RAW = 0x1 +} D3D12_BUFFER_UAV_FLAGS; +typedef struct D3D12_BUFFER_UAV { + UINT64 FirstElement; + UINT NumElements; + UINT StructureByteStride; + UINT64 CounterOffsetInBytes; + D3D12_BUFFER_UAV_FLAGS Flags; +} D3D12_BUFFER_UAV; +typedef struct D3D12_TEX1D_UAV { + UINT MipSlice; +} D3D12_TEX1D_UAV; +typedef struct D3D12_TEX1D_ARRAY_UAV { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; +} D3D12_TEX1D_ARRAY_UAV; +typedef struct D3D12_TEX2D_UAV { + UINT MipSlice; + UINT PlaneSlice; +} D3D12_TEX2D_UAV; +typedef struct D3D12_TEX2D_ARRAY_UAV { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + UINT PlaneSlice; +} D3D12_TEX2D_ARRAY_UAV; +typedef struct D3D12_TEX3D_UAV { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; +} D3D12_TEX3D_UAV; +typedef struct D3D12_UNORDERED_ACCESS_VIEW_DESC { + DXGI_FORMAT Format; + D3D12_UAV_DIMENSION ViewDimension; + __C89_NAMELESS union { + D3D12_BUFFER_UAV Buffer; + D3D12_TEX1D_UAV Texture1D; + D3D12_TEX1D_ARRAY_UAV Texture1DArray; + D3D12_TEX2D_UAV Texture2D; + D3D12_TEX2D_ARRAY_UAV Texture2DArray; + D3D12_TEX3D_UAV Texture3D; + } __C89_NAMELESSUNIONNAME; +} D3D12_UNORDERED_ACCESS_VIEW_DESC; +typedef enum D3D12_RTV_DIMENSION { + D3D12_RTV_DIMENSION_UNKNOWN = 0, + D3D12_RTV_DIMENSION_BUFFER = 1, + D3D12_RTV_DIMENSION_TEXTURE1D = 2, + D3D12_RTV_DIMENSION_TEXTURE1DARRAY = 3, + D3D12_RTV_DIMENSION_TEXTURE2D = 4, + D3D12_RTV_DIMENSION_TEXTURE2DARRAY = 5, + D3D12_RTV_DIMENSION_TEXTURE2DMS = 6, + D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D12_RTV_DIMENSION_TEXTURE3D = 8 +} D3D12_RTV_DIMENSION; +typedef struct D3D12_BUFFER_RTV { + UINT64 FirstElement; + UINT NumElements; +} D3D12_BUFFER_RTV; +typedef struct D3D12_TEX1D_RTV { + UINT MipSlice; +} D3D12_TEX1D_RTV; +typedef struct D3D12_TEX1D_ARRAY_RTV { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; +} D3D12_TEX1D_ARRAY_RTV; +typedef struct D3D12_TEX2D_RTV { + UINT MipSlice; + UINT PlaneSlice; +} D3D12_TEX2D_RTV; +typedef struct D3D12_TEX2D_ARRAY_RTV { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + UINT PlaneSlice; +} D3D12_TEX2D_ARRAY_RTV; +typedef struct D3D12_TEX2DMS_RTV { + UINT UnusedField_NothingToDefine; +} D3D12_TEX2DMS_RTV; +typedef struct D3D12_TEX2DMS_ARRAY_RTV { + UINT FirstArraySlice; + UINT ArraySize; +} D3D12_TEX2DMS_ARRAY_RTV; +typedef struct D3D12_TEX3D_RTV { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; +} D3D12_TEX3D_RTV; +typedef struct D3D12_RENDER_TARGET_VIEW_DESC { + DXGI_FORMAT Format; + D3D12_RTV_DIMENSION ViewDimension; + __C89_NAMELESS union { + D3D12_BUFFER_RTV Buffer; + D3D12_TEX1D_RTV Texture1D; + D3D12_TEX1D_ARRAY_RTV Texture1DArray; + D3D12_TEX2D_RTV Texture2D; + D3D12_TEX2D_ARRAY_RTV Texture2DArray; + D3D12_TEX2DMS_RTV Texture2DMS; + D3D12_TEX2DMS_ARRAY_RTV Texture2DMSArray; + D3D12_TEX3D_RTV Texture3D; + } __C89_NAMELESSUNIONNAME; +} D3D12_RENDER_TARGET_VIEW_DESC; +typedef enum D3D12_DSV_DIMENSION { + D3D12_DSV_DIMENSION_UNKNOWN = 0, + D3D12_DSV_DIMENSION_TEXTURE1D = 1, + D3D12_DSV_DIMENSION_TEXTURE1DARRAY = 2, + D3D12_DSV_DIMENSION_TEXTURE2D = 3, + D3D12_DSV_DIMENSION_TEXTURE2DARRAY = 4, + D3D12_DSV_DIMENSION_TEXTURE2DMS = 5, + D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY = 6 +} D3D12_DSV_DIMENSION; +typedef enum D3D12_DSV_FLAGS { + D3D12_DSV_FLAG_NONE = 0x0, + D3D12_DSV_FLAG_READ_ONLY_DEPTH = 0x1, + D3D12_DSV_FLAG_READ_ONLY_STENCIL = 0x2 +} D3D12_DSV_FLAGS; +DEFINE_ENUM_FLAG_OPERATORS(D3D12_DSV_FLAGS); +typedef struct D3D12_TEX1D_DSV { + UINT MipSlice; +} D3D12_TEX1D_DSV; +typedef struct D3D12_TEX1D_ARRAY_DSV { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; +} D3D12_TEX1D_ARRAY_DSV; +typedef struct D3D12_TEX2D_DSV { + UINT MipSlice; +} D3D12_TEX2D_DSV; +typedef struct D3D12_TEX2D_ARRAY_DSV { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; +} D3D12_TEX2D_ARRAY_DSV; +typedef struct D3D12_TEX2DMS_DSV { + UINT UnusedField_NothingToDefine; +} D3D12_TEX2DMS_DSV; +typedef struct D3D12_TEX2DMS_ARRAY_DSV { + UINT FirstArraySlice; + UINT ArraySize; +} D3D12_TEX2DMS_ARRAY_DSV; +typedef struct D3D12_DEPTH_STENCIL_VIEW_DESC { + DXGI_FORMAT Format; + D3D12_DSV_DIMENSION ViewDimension; + D3D12_DSV_FLAGS Flags; + __C89_NAMELESS union { + D3D12_TEX1D_DSV Texture1D; + D3D12_TEX1D_ARRAY_DSV Texture1DArray; + D3D12_TEX2D_DSV Texture2D; + D3D12_TEX2D_ARRAY_DSV Texture2DArray; + D3D12_TEX2DMS_DSV Texture2DMS; + D3D12_TEX2DMS_ARRAY_DSV Texture2DMSArray; + } __C89_NAMELESSUNIONNAME; +} D3D12_DEPTH_STENCIL_VIEW_DESC; +typedef struct D3D12_SAMPLER_DESC { + 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; + FLOAT BorderColor[4]; + FLOAT MinLOD; + FLOAT MaxLOD; +} D3D12_SAMPLER_DESC; +typedef struct D3D12_CPU_DESCRIPTOR_HANDLE { + SIZE_T ptr; +} D3D12_CPU_DESCRIPTOR_HANDLE; +typedef struct D3D12_GPU_DESCRIPTOR_HANDLE { + UINT64 ptr; +} D3D12_GPU_DESCRIPTOR_HANDLE; +typedef enum D3D12_STENCIL_OP { + D3D12_STENCIL_OP_KEEP = 1, + D3D12_STENCIL_OP_ZERO = 2, + D3D12_STENCIL_OP_REPLACE = 3, + D3D12_STENCIL_OP_INCR_SAT = 4, + D3D12_STENCIL_OP_DECR_SAT = 5, + D3D12_STENCIL_OP_INVERT = 6, + D3D12_STENCIL_OP_INCR = 7, + D3D12_STENCIL_OP_DECR = 8 +} D3D12_STENCIL_OP; +typedef struct D3D12_DEPTH_STENCILOP_DESC { + D3D12_STENCIL_OP StencilFailOp; + D3D12_STENCIL_OP StencilDepthFailOp; + D3D12_STENCIL_OP StencilPassOp; + D3D12_COMPARISON_FUNC StencilFunc; +} D3D12_DEPTH_STENCILOP_DESC; +typedef enum D3D12_DEPTH_WRITE_MASK { + D3D12_DEPTH_WRITE_MASK_ZERO = 0, + D3D12_DEPTH_WRITE_MASK_ALL = 1 +} D3D12_DEPTH_WRITE_MASK; +typedef struct D3D12_DEPTH_STENCIL_DESC { + BOOL DepthEnable; + D3D12_DEPTH_WRITE_MASK DepthWriteMask; + D3D12_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + D3D12_DEPTH_STENCILOP_DESC FrontFace; + D3D12_DEPTH_STENCILOP_DESC BackFace; +} D3D12_DEPTH_STENCIL_DESC; +typedef enum D3D12_BLEND { + D3D12_BLEND_ZERO = 1, + D3D12_BLEND_ONE = 2, + D3D12_BLEND_SRC_COLOR = 3, + D3D12_BLEND_INV_SRC_COLOR = 4, + D3D12_BLEND_SRC_ALPHA = 5, + D3D12_BLEND_INV_SRC_ALPHA = 6, + D3D12_BLEND_DEST_ALPHA = 7, + D3D12_BLEND_INV_DEST_ALPHA = 8, + D3D12_BLEND_DEST_COLOR = 9, + D3D12_BLEND_INV_DEST_COLOR = 10, + D3D12_BLEND_SRC_ALPHA_SAT = 11, + D3D12_BLEND_BLEND_FACTOR = 14, + D3D12_BLEND_INV_BLEND_FACTOR = 15, + D3D12_BLEND_SRC1_COLOR = 16, + D3D12_BLEND_INV_SRC1_COLOR = 17, + D3D12_BLEND_SRC1_ALPHA = 18, + D3D12_BLEND_INV_SRC1_ALPHA = 19 +} D3D12_BLEND; +typedef enum D3D12_BLEND_OP { + D3D12_BLEND_OP_ADD = 1, + D3D12_BLEND_OP_SUBTRACT = 2, + D3D12_BLEND_OP_REV_SUBTRACT = 3, + D3D12_BLEND_OP_MIN = 4, + D3D12_BLEND_OP_MAX = 5 +} D3D12_BLEND_OP; +typedef enum D3D12_LOGIC_OP { + D3D12_LOGIC_OP_CLEAR = 0, + D3D12_LOGIC_OP_SET = 1, + D3D12_LOGIC_OP_COPY = 2, + D3D12_LOGIC_OP_COPY_INVERTED = 3, + D3D12_LOGIC_OP_NOOP = 4 +} D3D12_LOGIC_OP; +typedef enum D3D12_COLOR_WRITE_ENABLE { + D3D12_COLOR_WRITE_ENABLE_RED = 0x1, + D3D12_COLOR_WRITE_ENABLE_GREEN = 0x2, + D3D12_COLOR_WRITE_ENABLE_BLUE = 0x4, + D3D12_COLOR_WRITE_ENABLE_ALPHA = 0x8, + D3D12_COLOR_WRITE_ENABLE_ALL = ((D3D12_COLOR_WRITE_ENABLE_RED | D3D12_COLOR_WRITE_ENABLE_GREEN) | D3D12_COLOR_WRITE_ENABLE_BLUE) | D3D12_COLOR_WRITE_ENABLE_ALPHA +} D3D12_COLOR_WRITE_ENABLE; +typedef struct D3D12_RENDER_TARGET_BLEND_DESC { + BOOL BlendEnable; + BOOL LogicOpEnable; + D3D12_BLEND SrcBlend; + D3D12_BLEND DestBlend; + D3D12_BLEND_OP BlendOp; + D3D12_BLEND SrcBlendAlpha; + D3D12_BLEND DestBlendAlpha; + D3D12_BLEND_OP BlendOpAlpha; + D3D12_LOGIC_OP LogicOp; + UINT8 RenderTargetWriteMask; +} D3D12_RENDER_TARGET_BLEND_DESC; +typedef struct D3D12_BLEND_DESC { + BOOL AlphaToCoverageEnable; + BOOL IndependentBlendEnable; + D3D12_RENDER_TARGET_BLEND_DESC RenderTarget[8]; +} D3D12_BLEND_DESC; +typedef enum D3D12_FILL_MODE { + D3D12_FILL_MODE_WIREFRAME = 2, + D3D12_FILL_MODE_SOLID = 3 +} D3D12_FILL_MODE; +typedef enum D3D12_CULL_MODE { + D3D12_CULL_MODE_NONE = 1, + D3D12_CULL_MODE_FRONT = 2, + D3D12_CULL_MODE_BACK = 3 +} D3D12_CULL_MODE; +typedef enum D3D12_CONSERVATIVE_RASTERIZATION_MODE { + D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0, + D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON = 1 +} D3D12_CONSERVATIVE_RASTERIZATION_MODE; +typedef struct D3D12_RASTERIZER_DESC { + D3D12_FILL_MODE FillMode; + D3D12_CULL_MODE CullMode; + BOOL FrontCounterClockwise; + INT DepthBias; + FLOAT DepthBiasClamp; + FLOAT SlopeScaledDepthBias; + BOOL DepthClipEnable; + BOOL MultisampleEnable; + BOOL AntialiasedLineEnable; + UINT ForcedSampleCount; + D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster; +} D3D12_RASTERIZER_DESC; +typedef struct D3D12_SO_DECLARATION_ENTRY { + UINT Stream; + const char *SemanticName; + UINT SemanticIndex; + BYTE StartComponent; + BYTE ComponentCount; + BYTE OutputSlot; +} D3D12_SO_DECLARATION_ENTRY; +typedef struct D3D12_STREAM_OUTPUT_DESC { + const D3D12_SO_DECLARATION_ENTRY *pSODeclaration; + UINT NumEntries; + const UINT *pBufferStrides; + UINT NumStrides; + UINT RasterizedStream; +} D3D12_STREAM_OUTPUT_DESC; +typedef enum D3D12_INPUT_CLASSIFICATION { + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA = 0, + D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA = 1 +} D3D12_INPUT_CLASSIFICATION; +typedef struct D3D12_INPUT_ELEMENT_DESC { + const char *SemanticName; + UINT SemanticIndex; + DXGI_FORMAT Format; + UINT InputSlot; + UINT AlignedByteOffset; + D3D12_INPUT_CLASSIFICATION InputSlotClass; + UINT InstanceDataStepRate; +} D3D12_INPUT_ELEMENT_DESC; +typedef struct D3D12_INPUT_LAYOUT_DESC { + const D3D12_INPUT_ELEMENT_DESC *pInputElementDescs; + UINT NumElements; +} D3D12_INPUT_LAYOUT_DESC; +typedef enum D3D12_INDEX_BUFFER_STRIP_CUT_VALUE { + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED = 0, + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF = 1, + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF = 2 +} D3D12_INDEX_BUFFER_STRIP_CUT_VALUE; +typedef D3D_PRIMITIVE_TOPOLOGY D3D12_PRIMITIVE_TOPOLOGY; +typedef enum D3D12_PRIMITIVE_TOPOLOGY_TYPE { + D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED = 0, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT = 1, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE = 2, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE = 3, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH = 4 +} D3D12_PRIMITIVE_TOPOLOGY_TYPE; +typedef struct D3D12_CACHED_PIPELINE_STATE { + const void *pCachedBlob; + SIZE_T CachedBlobSizeInBytes; +} D3D12_CACHED_PIPELINE_STATE; +typedef enum D3D12_PIPELINE_STATE_FLAGS { + D3D12_PIPELINE_STATE_FLAG_NONE = 0x0, + D3D12_PIPELINE_STATE_FLAG_DEBUG = 0x1 +} D3D12_PIPELINE_STATE_FLAGS; +typedef struct D3D12_GRAPHICS_PIPELINE_STATE_DESC { + ID3D12RootSignature *pRootSignature; + D3D12_SHADER_BYTECODE VS; + D3D12_SHADER_BYTECODE PS; + D3D12_SHADER_BYTECODE DS; + D3D12_SHADER_BYTECODE HS; + D3D12_SHADER_BYTECODE GS; + D3D12_STREAM_OUTPUT_DESC StreamOutput; + D3D12_BLEND_DESC BlendState; + UINT SampleMask; + D3D12_RASTERIZER_DESC RasterizerState; + D3D12_DEPTH_STENCIL_DESC DepthStencilState; + D3D12_INPUT_LAYOUT_DESC InputLayout; + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue; + D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType; + UINT NumRenderTargets; + DXGI_FORMAT RTVFormats[8]; + DXGI_FORMAT DSVFormat; + DXGI_SAMPLE_DESC SampleDesc; + UINT NodeMask; + D3D12_CACHED_PIPELINE_STATE CachedPSO; + D3D12_PIPELINE_STATE_FLAGS Flags; +} D3D12_GRAPHICS_PIPELINE_STATE_DESC; +typedef struct D3D12_COMPUTE_PIPELINE_STATE_DESC { + ID3D12RootSignature *pRootSignature; + D3D12_SHADER_BYTECODE CS; + UINT NodeMask; + D3D12_CACHED_PIPELINE_STATE CachedPSO; + D3D12_PIPELINE_STATE_FLAGS Flags; +} D3D12_COMPUTE_PIPELINE_STATE_DESC; +typedef enum D3D12_COMMAND_LIST_TYPE { + D3D12_COMMAND_LIST_TYPE_DIRECT = 0, + D3D12_COMMAND_LIST_TYPE_BUNDLE = 1, + D3D12_COMMAND_LIST_TYPE_COMPUTE = 2, + D3D12_COMMAND_LIST_TYPE_COPY = 3 +} D3D12_COMMAND_LIST_TYPE; +typedef enum D3D12_COMMAND_QUEUE_PRIORITY { + D3D12_COMMAND_QUEUE_PRIORITY_NORMAL = 0, + D3D12_COMMAND_QUEUE_PRIORITY_HIGH = 100 +} D3D12_COMMAND_QUEUE_PRIORITY; +typedef enum D3D12_COMMAND_QUEUE_FLAGS { + D3D12_COMMAND_QUEUE_FLAG_NONE = 0x0, + D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1 +} D3D12_COMMAND_QUEUE_FLAGS; +typedef struct D3D12_COMMAND_QUEUE_DESC { + D3D12_COMMAND_LIST_TYPE Type; + INT Priority; + D3D12_COMMAND_QUEUE_FLAGS Flags; + UINT NodeMask; +} D3D12_COMMAND_QUEUE_DESC; +typedef struct D3D12_FEATURE_DATA_ARCHITECTURE { + UINT NodeIndex; + BOOL TileBasedRenderer; + BOOL UMA; + BOOL CacheCoherentUMA; +} D3D12_FEATURE_DATA_ARCHITECTURE; +typedef struct D3D12_FEATURE_DATA_FORMAT_INFO { + DXGI_FORMAT Format; + UINT8 PlaneCount; +} D3D12_FEATURE_DATA_FORMAT_INFO; +typedef struct D3D12_FEATURE_DATA_FEATURE_LEVELS { + UINT NumFeatureLevels; + const D3D_FEATURE_LEVEL *pFeatureLevelsRequested; + D3D_FEATURE_LEVEL MaxSupportedFeatureLevel; +} D3D12_FEATURE_DATA_FEATURE_LEVELS; +typedef enum D3D12_FEATURE { + D3D12_FEATURE_D3D12_OPTIONS = 0, + D3D12_FEATURE_ARCHITECTURE = 1, + D3D12_FEATURE_FEATURE_LEVELS = 2, + D3D12_FEATURE_FORMAT_SUPPORT = 3, + D3D12_FEATURE_FORMAT_INFO = 4, + D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = 5 +} D3D12_FEATURE; +typedef struct D3D12_MEMCPY_DEST { + void *pData; + SIZE_T RowPitch; + SIZE_T SlicePitch; +} D3D12_MEMCPY_DEST; +typedef struct D3D12_SUBRESOURCE_DATA { + const void *pData; + LONG_PTR RowPitch; + LONG_PTR SlicePitch; +} D3D12_SUBRESOURCE_DATA; +/***************************************************************************** + * ID3D12Object interface + */ +#ifndef __ID3D12Object_INTERFACE_DEFINED__ +#define __ID3D12Object_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12Object, 0xc4fec28f, 0x7966, 0x4e95, 0x9f,0x94, 0xf4,0x31,0xcb,0x56,0xc3,0xb8); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("c4fec28f-7966-4e95-9f94-f431cb56c3b8") +ID3D12Object : public IUnknown +{ + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + REFGUID guid, + UINT *data_size, + void *data) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + REFGUID guid, + UINT data_size, + const void *data) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + REFGUID guid, + const IUnknown *data) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetName( + const WCHAR *name) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12Object, 0xc4fec28f, 0x7966, 0x4e95, 0x9f,0x94, 0xf4,0x31,0xcb,0x56,0xc3,0xb8) +#endif +#else +typedef struct ID3D12ObjectVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12Object *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12Object *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12Object *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12Object *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12Object *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12Object *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12Object *This, + const WCHAR *name); + + END_INTERFACE +} ID3D12ObjectVtbl; + +interface ID3D12Object { + CONST_VTBL ID3D12ObjectVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12Object_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12Object_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12Object_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12Object_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12Object_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12Object_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12Object_SetName(This,name) (This)->lpVtbl->SetName(This,name) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12Object_QueryInterface(ID3D12Object* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12Object_AddRef(ID3D12Object* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12Object_Release(ID3D12Object* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12Object_GetPrivateData(ID3D12Object* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Object_SetPrivateData(ID3D12Object* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Object_SetPrivateDataInterface(ID3D12Object* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12Object_SetName(ID3D12Object* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12Object_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12DeviceChild interface + */ +#ifndef __ID3D12DeviceChild_INTERFACE_DEFINED__ +#define __ID3D12DeviceChild_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12DeviceChild, 0x905db94b, 0xa00c, 0x4140, 0x9d,0xf5, 0x2b,0x64,0xca,0x9e,0xa3,0x57); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("905db94b-a00c-4140-9df5-2b64ca9ea357") +ID3D12DeviceChild : public ID3D12Object +{ + virtual HRESULT STDMETHODCALLTYPE GetDevice( + REFIID riid, + void **device) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12DeviceChild, 0x905db94b, 0xa00c, 0x4140, 0x9d,0xf5, 0x2b,0x64,0xca,0x9e,0xa3,0x57) +#endif +#else +typedef struct ID3D12DeviceChildVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12DeviceChild *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12DeviceChild *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12DeviceChild *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12DeviceChild *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12DeviceChild *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12DeviceChild *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12DeviceChild *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12DeviceChild *This, + REFIID riid, + void **device); + + END_INTERFACE +} ID3D12DeviceChildVtbl; + +interface ID3D12DeviceChild { + CONST_VTBL ID3D12DeviceChildVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12DeviceChild_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12DeviceChild_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12DeviceChild_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12DeviceChild_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12DeviceChild_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12DeviceChild_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12DeviceChild_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12DeviceChild_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12DeviceChild_QueryInterface(ID3D12DeviceChild* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12DeviceChild_AddRef(ID3D12DeviceChild* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12DeviceChild_Release(ID3D12DeviceChild* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12DeviceChild_GetPrivateData(ID3D12DeviceChild* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12DeviceChild_SetPrivateData(ID3D12DeviceChild* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12DeviceChild_SetPrivateDataInterface(ID3D12DeviceChild* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12DeviceChild_SetName(ID3D12DeviceChild* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12DeviceChild_GetDevice(ID3D12DeviceChild* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12DeviceChild_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12Pageable interface + */ +#ifndef __ID3D12Pageable_INTERFACE_DEFINED__ +#define __ID3D12Pageable_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12Pageable, 0x63ee58fb, 0x1268, 0x4835, 0x86,0xda, 0xf0,0x08,0xce,0x62,0xf0,0xd6); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("63ee58fb-1268-4835-86da-f008ce62f0d6") +ID3D12Pageable : public ID3D12DeviceChild +{ +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12Pageable, 0x63ee58fb, 0x1268, 0x4835, 0x86,0xda, 0xf0,0x08,0xce,0x62,0xf0,0xd6) +#endif +#else +typedef struct ID3D12PageableVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12Pageable *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12Pageable *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12Pageable *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12Pageable *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12Pageable *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12Pageable *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12Pageable *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12Pageable *This, + REFIID riid, + void **device); + + END_INTERFACE +} ID3D12PageableVtbl; + +interface ID3D12Pageable { + CONST_VTBL ID3D12PageableVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12Pageable_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12Pageable_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12Pageable_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12Pageable_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12Pageable_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12Pageable_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12Pageable_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12Pageable_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12Pageable_QueryInterface(ID3D12Pageable* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12Pageable_AddRef(ID3D12Pageable* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12Pageable_Release(ID3D12Pageable* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12Pageable_GetPrivateData(ID3D12Pageable* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Pageable_SetPrivateData(ID3D12Pageable* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Pageable_SetPrivateDataInterface(ID3D12Pageable* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12Pageable_SetName(ID3D12Pageable* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12Pageable_GetDevice(ID3D12Pageable* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12Pageable_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12Resource interface + */ +#ifndef __ID3D12Resource_INTERFACE_DEFINED__ +#define __ID3D12Resource_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12Resource, 0x696442be, 0xa72e, 0x4059, 0xbc,0x79, 0x5b,0x5c,0x98,0x04,0x0f,0xad); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("696442be-a72e-4059-bc79-5b5c98040fad") +ID3D12Resource : public ID3D12Pageable +{ + virtual HRESULT STDMETHODCALLTYPE Map( + UINT sub_resource, + const D3D12_RANGE *read_range, + void **data) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + UINT sub_resource, + const D3D12_RANGE *written_range) = 0; + +#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS + virtual D3D12_RESOURCE_DESC* STDMETHODCALLTYPE GetDesc( + D3D12_RESOURCE_DESC *__ret) = 0; + D3D12_RESOURCE_DESC STDMETHODCALLTYPE GetDesc( + ) + { + D3D12_RESOURCE_DESC __ret; + return *GetDesc(&__ret); + } +#else + virtual D3D12_RESOURCE_DESC STDMETHODCALLTYPE GetDesc( + ) = 0; +#endif + + virtual D3D12_GPU_VIRTUAL_ADDRESS STDMETHODCALLTYPE GetGPUVirtualAddress( + ) = 0; + + virtual HRESULT STDMETHODCALLTYPE WriteToSubresource( + UINT dst_sub_resource, + const D3D12_BOX *dst_box, + const void *src_data, + UINT src_row_pitch, + UINT src_slice_pitch) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReadFromSubresource( + void *dst_data, + UINT dst_row_pitch, + UINT dst_slice_pitch, + UINT src_sub_resource, + const D3D12_BOX *src_box) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetHeapProperties( + D3D12_HEAP_PROPERTIES *heap_properties, + D3D12_HEAP_FLAGS *flags) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12Resource, 0x696442be, 0xa72e, 0x4059, 0xbc,0x79, 0x5b,0x5c,0x98,0x04,0x0f,0xad) +#endif +#else +typedef struct ID3D12ResourceVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12Resource *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12Resource *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12Resource *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12Resource *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12Resource *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12Resource *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12Resource *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12Resource *This, + REFIID riid, + void **device); + + /*** ID3D12Resource methods ***/ + HRESULT (STDMETHODCALLTYPE *Map)( + ID3D12Resource *This, + UINT sub_resource, + const D3D12_RANGE *read_range, + void **data); + + void (STDMETHODCALLTYPE *Unmap)( + ID3D12Resource *This, + UINT sub_resource, + const D3D12_RANGE *written_range); + + D3D12_RESOURCE_DESC * (STDMETHODCALLTYPE *GetDesc)( + ID3D12Resource *This, + D3D12_RESOURCE_DESC *__ret); + + D3D12_GPU_VIRTUAL_ADDRESS (STDMETHODCALLTYPE *GetGPUVirtualAddress)( + ID3D12Resource *This); + + HRESULT (STDMETHODCALLTYPE *WriteToSubresource)( + ID3D12Resource *This, + UINT dst_sub_resource, + const D3D12_BOX *dst_box, + const void *src_data, + UINT src_row_pitch, + UINT src_slice_pitch); + + HRESULT (STDMETHODCALLTYPE *ReadFromSubresource)( + ID3D12Resource *This, + void *dst_data, + UINT dst_row_pitch, + UINT dst_slice_pitch, + UINT src_sub_resource, + const D3D12_BOX *src_box); + + HRESULT (STDMETHODCALLTYPE *GetHeapProperties)( + ID3D12Resource *This, + D3D12_HEAP_PROPERTIES *heap_properties, + D3D12_HEAP_FLAGS *flags); + + END_INTERFACE +} ID3D12ResourceVtbl; + +interface ID3D12Resource { + CONST_VTBL ID3D12ResourceVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12Resource_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12Resource_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12Resource_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12Resource_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12Resource_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12Resource_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12Resource_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12Resource_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +/*** ID3D12Resource methods ***/ +#define ID3D12Resource_Map(This,sub_resource,read_range,data) (This)->lpVtbl->Map(This,sub_resource,read_range,data) +#define ID3D12Resource_Unmap(This,sub_resource,written_range) (This)->lpVtbl->Unmap(This,sub_resource,written_range) +#define ID3D12Resource_GetDesc(This) ID3D12Resource_GetDesc_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support +#define ID3D12Resource_GetGPUVirtualAddress(This) (This)->lpVtbl->GetGPUVirtualAddress(This) +#define ID3D12Resource_WriteToSubresource(This,dst_sub_resource,dst_box,src_data,src_row_pitch,src_slice_pitch) (This)->lpVtbl->WriteToSubresource(This,dst_sub_resource,dst_box,src_data,src_row_pitch,src_slice_pitch) +#define ID3D12Resource_ReadFromSubresource(This,dst_data,dst_row_pitch,dst_slice_pitch,src_sub_resource,src_box) (This)->lpVtbl->ReadFromSubresource(This,dst_data,dst_row_pitch,dst_slice_pitch,src_sub_resource,src_box) +#define ID3D12Resource_GetHeapProperties(This,heap_properties,flags) (This)->lpVtbl->GetHeapProperties(This,heap_properties,flags) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12Resource_QueryInterface(ID3D12Resource* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12Resource_AddRef(ID3D12Resource* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12Resource_Release(ID3D12Resource* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12Resource_GetPrivateData(ID3D12Resource* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Resource_SetPrivateData(ID3D12Resource* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Resource_SetPrivateDataInterface(ID3D12Resource* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12Resource_SetName(ID3D12Resource* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12Resource_GetDevice(ID3D12Resource* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +/*** ID3D12Resource methods ***/ +static FORCEINLINE HRESULT ID3D12Resource_Map(ID3D12Resource* This,UINT sub_resource,const D3D12_RANGE *read_range,void **data) { + return This->lpVtbl->Map(This,sub_resource,read_range,data); +} +static FORCEINLINE void ID3D12Resource_Unmap(ID3D12Resource* This,UINT sub_resource,const D3D12_RANGE *written_range) { + This->lpVtbl->Unmap(This,sub_resource,written_range); +} +static FORCEINLINE D3D12_RESOURCE_DESC ID3D12Resource_GetDesc(ID3D12Resource* This) { + D3D12_RESOURCE_DESC __ret; + return *This->lpVtbl->GetDesc(This,&__ret); +} +static FORCEINLINE D3D12_GPU_VIRTUAL_ADDRESS ID3D12Resource_GetGPUVirtualAddress(ID3D12Resource* This) { + return This->lpVtbl->GetGPUVirtualAddress(This); +} +static FORCEINLINE HRESULT ID3D12Resource_WriteToSubresource(ID3D12Resource* This,UINT dst_sub_resource,const D3D12_BOX *dst_box,const void *src_data,UINT src_row_pitch,UINT src_slice_pitch) { + return This->lpVtbl->WriteToSubresource(This,dst_sub_resource,dst_box,src_data,src_row_pitch,src_slice_pitch); +} +static FORCEINLINE HRESULT ID3D12Resource_ReadFromSubresource(ID3D12Resource* This,void *dst_data,UINT dst_row_pitch,UINT dst_slice_pitch,UINT src_sub_resource,const D3D12_BOX *src_box) { + return This->lpVtbl->ReadFromSubresource(This,dst_data,dst_row_pitch,dst_slice_pitch,src_sub_resource,src_box); +} +static FORCEINLINE HRESULT ID3D12Resource_GetHeapProperties(ID3D12Resource* This,D3D12_HEAP_PROPERTIES *heap_properties,D3D12_HEAP_FLAGS *flags) { + return This->lpVtbl->GetHeapProperties(This,heap_properties,flags); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12Resource_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12CommandList interface + */ +#ifndef __ID3D12CommandList_INTERFACE_DEFINED__ +#define __ID3D12CommandList_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12CommandList, 0x7116d91c, 0xe7e4, 0x47ce, 0xb8,0xc6, 0xec,0x81,0x68,0xf4,0x37,0xe5); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("7116d91c-e7e4-47ce-b8c6-ec8168f437e5") +ID3D12CommandList : public ID3D12DeviceChild +{ + virtual D3D12_COMMAND_LIST_TYPE STDMETHODCALLTYPE GetType( + ) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12CommandList, 0x7116d91c, 0xe7e4, 0x47ce, 0xb8,0xc6, 0xec,0x81,0x68,0xf4,0x37,0xe5) +#endif +#else +typedef struct ID3D12CommandListVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12CommandList *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12CommandList *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12CommandList *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12CommandList *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12CommandList *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12CommandList *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12CommandList *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12CommandList *This, + REFIID riid, + void **device); + + /*** ID3D12CommandList methods ***/ + D3D12_COMMAND_LIST_TYPE (STDMETHODCALLTYPE *GetType)( + ID3D12CommandList *This); + + END_INTERFACE +} ID3D12CommandListVtbl; + +interface ID3D12CommandList { + CONST_VTBL ID3D12CommandListVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12CommandList_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12CommandList_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12CommandList_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12CommandList_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12CommandList_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12CommandList_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12CommandList_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12CommandList_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +/*** ID3D12CommandList methods ***/ +#define ID3D12CommandList_GetType(This) (This)->lpVtbl->GetType(This) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12CommandList_QueryInterface(ID3D12CommandList* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12CommandList_AddRef(ID3D12CommandList* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12CommandList_Release(ID3D12CommandList* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12CommandList_GetPrivateData(ID3D12CommandList* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12CommandList_SetPrivateData(ID3D12CommandList* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12CommandList_SetPrivateDataInterface(ID3D12CommandList* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12CommandList_SetName(ID3D12CommandList* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12CommandList_GetDevice(ID3D12CommandList* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +/*** ID3D12CommandList methods ***/ +static FORCEINLINE D3D12_COMMAND_LIST_TYPE ID3D12CommandList_GetType(ID3D12CommandList* This) { + return This->lpVtbl->GetType(This); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12CommandList_INTERFACE_DEFINED__ */ + +typedef enum D3D12_TILE_COPY_FLAGS { + D3D12_TILE_COPY_FLAG_NONE = 0x0, + D3D12_TILE_COPY_FLAG_NO_HAZARD = 0x1, + 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; +typedef struct D3D12_INDEX_BUFFER_VIEW { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + DXGI_FORMAT Format; +} D3D12_INDEX_BUFFER_VIEW; +typedef struct D3D12_VERTEX_BUFFER_VIEW { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + UINT StrideInBytes; +} D3D12_VERTEX_BUFFER_VIEW; +typedef struct D3D12_STREAM_OUTPUT_BUFFER_VIEW { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT64 SizeInBytes; + D3D12_GPU_VIRTUAL_ADDRESS BufferFilledSizeLocation; +} D3D12_STREAM_OUTPUT_BUFFER_VIEW; +typedef enum D3D12_CLEAR_FLAGS { + D3D12_CLEAR_FLAG_DEPTH = 0x1, + D3D12_CLEAR_FLAG_STENCIL = 0x2 +} D3D12_CLEAR_FLAGS; +DEFINE_ENUM_FLAG_OPERATORS(D3D12_CLEAR_FLAGS); +typedef struct D3D12_DISCARD_REGION { + UINT NumRects; + const D3D12_RECT *pRects; + UINT FirstSubresource; + UINT NumSubresources; +} D3D12_DISCARD_REGION; +typedef enum D3D12_QUERY_TYPE { + D3D12_QUERY_TYPE_OCCLUSION = 0, + D3D12_QUERY_TYPE_BINARY_OCCLUSION = 1, + D3D12_QUERY_TYPE_TIMESTAMP = 2, + D3D12_QUERY_TYPE_PIPELINE_STATISTICS = 3, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0 = 4, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM1 = 5, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM2 = 6, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM3 = 7 +} D3D12_QUERY_TYPE; +typedef struct D3D12_QUERY_DATA_PIPELINE_STATISTICS { + UINT64 IAVertices; + UINT64 IAPrimitives; + UINT64 VSInvocations; + UINT64 GSInvocations; + UINT64 GSPrimitives; + UINT64 CInvocations; + UINT64 CPrimitives; + UINT64 PSInvocations; + UINT64 HSInvocations; + UINT64 DSInvocations; + UINT64 CSInvocations; +} D3D12_QUERY_DATA_PIPELINE_STATISTICS; +typedef enum D3D12_PREDICATION_OP { + D3D12_PREDICATION_OP_EQUAL_ZERO = 0, + D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1 +} D3D12_PREDICATION_OP; +/***************************************************************************** + * ID3D12DescriptorHeap interface + */ +#ifndef __ID3D12DescriptorHeap_INTERFACE_DEFINED__ +#define __ID3D12DescriptorHeap_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12DescriptorHeap, 0x8efb471d, 0x616c, 0x4f49, 0x90,0xf7, 0x12,0x7b,0xb7,0x63,0xfa,0x51); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("8efb471d-616c-4f49-90f7-127bb763fa51") +ID3D12DescriptorHeap : public ID3D12Pageable +{ +#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS + virtual D3D12_DESCRIPTOR_HEAP_DESC* STDMETHODCALLTYPE GetDesc( + D3D12_DESCRIPTOR_HEAP_DESC *__ret) = 0; + D3D12_DESCRIPTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( + ) + { + D3D12_DESCRIPTOR_HEAP_DESC __ret; + return *GetDesc(&__ret); + } +#else + virtual D3D12_DESCRIPTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( + ) = 0; +#endif + +#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS + virtual D3D12_CPU_DESCRIPTOR_HANDLE* STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart( + D3D12_CPU_DESCRIPTOR_HANDLE *__ret) = 0; + D3D12_CPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart( + ) + { + D3D12_CPU_DESCRIPTOR_HANDLE __ret; + return *GetCPUDescriptorHandleForHeapStart(&__ret); + } +#else + virtual D3D12_CPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart( + ) = 0; +#endif + +#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS + virtual D3D12_GPU_DESCRIPTOR_HANDLE* STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart( + D3D12_GPU_DESCRIPTOR_HANDLE *__ret) = 0; + D3D12_GPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart( + ) + { + D3D12_GPU_DESCRIPTOR_HANDLE __ret; + return *GetGPUDescriptorHandleForHeapStart(&__ret); + } +#else + virtual D3D12_GPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart( + ) = 0; +#endif + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12DescriptorHeap, 0x8efb471d, 0x616c, 0x4f49, 0x90,0xf7, 0x12,0x7b,0xb7,0x63,0xfa,0x51) +#endif +#else +typedef struct ID3D12DescriptorHeapVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12DescriptorHeap *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12DescriptorHeap *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12DescriptorHeap *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12DescriptorHeap *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12DescriptorHeap *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12DescriptorHeap *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12DescriptorHeap *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12DescriptorHeap *This, + REFIID riid, + void **device); + + /*** ID3D12DescriptorHeap methods ***/ + D3D12_DESCRIPTOR_HEAP_DESC * (STDMETHODCALLTYPE *GetDesc)( + ID3D12DescriptorHeap *This, + D3D12_DESCRIPTOR_HEAP_DESC *__ret); + + D3D12_CPU_DESCRIPTOR_HANDLE * (STDMETHODCALLTYPE *GetCPUDescriptorHandleForHeapStart)( + ID3D12DescriptorHeap *This, + D3D12_CPU_DESCRIPTOR_HANDLE *__ret); + + D3D12_GPU_DESCRIPTOR_HANDLE * (STDMETHODCALLTYPE *GetGPUDescriptorHandleForHeapStart)( + ID3D12DescriptorHeap *This, + D3D12_GPU_DESCRIPTOR_HANDLE *__ret); + + END_INTERFACE +} ID3D12DescriptorHeapVtbl; + +interface ID3D12DescriptorHeap { + CONST_VTBL ID3D12DescriptorHeapVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12DescriptorHeap_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12DescriptorHeap_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12DescriptorHeap_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12DescriptorHeap_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12DescriptorHeap_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12DescriptorHeap_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12DescriptorHeap_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12DescriptorHeap_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +/*** ID3D12DescriptorHeap methods ***/ +#define ID3D12DescriptorHeap_GetDesc(This) ID3D12DescriptorHeap_GetDesc_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support +#define ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(This) ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support +#define ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(This) ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12DescriptorHeap_QueryInterface(ID3D12DescriptorHeap* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12DescriptorHeap_AddRef(ID3D12DescriptorHeap* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12DescriptorHeap_Release(ID3D12DescriptorHeap* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12DescriptorHeap_GetPrivateData(ID3D12DescriptorHeap* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12DescriptorHeap_SetPrivateData(ID3D12DescriptorHeap* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12DescriptorHeap_SetPrivateDataInterface(ID3D12DescriptorHeap* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12DescriptorHeap_SetName(ID3D12DescriptorHeap* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12DescriptorHeap_GetDevice(ID3D12DescriptorHeap* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +/*** ID3D12DescriptorHeap methods ***/ +static FORCEINLINE D3D12_DESCRIPTOR_HEAP_DESC ID3D12DescriptorHeap_GetDesc(ID3D12DescriptorHeap* This) { + D3D12_DESCRIPTOR_HEAP_DESC __ret; + return *This->lpVtbl->GetDesc(This,&__ret); +} +static FORCEINLINE D3D12_CPU_DESCRIPTOR_HANDLE ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(ID3D12DescriptorHeap* This) { + D3D12_CPU_DESCRIPTOR_HANDLE __ret; + return *This->lpVtbl->GetCPUDescriptorHandleForHeapStart(This,&__ret); +} +static FORCEINLINE D3D12_GPU_DESCRIPTOR_HANDLE ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(ID3D12DescriptorHeap* This) { + D3D12_GPU_DESCRIPTOR_HANDLE __ret; + return *This->lpVtbl->GetGPUDescriptorHandleForHeapStart(This,&__ret); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12DescriptorHeap_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12QueryHeap interface + */ +#ifndef __ID3D12QueryHeap_INTERFACE_DEFINED__ +#define __ID3D12QueryHeap_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12QueryHeap, 0x0d9658ae, 0xed45, 0x469e, 0xa6,0x1d, 0x97,0x0e,0xc5,0x83,0xca,0xb4); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("0d9658ae-ed45-469e-a61d-970ec583cab4") +ID3D12QueryHeap : public ID3D12Pageable +{ +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12QueryHeap, 0x0d9658ae, 0xed45, 0x469e, 0xa6,0x1d, 0x97,0x0e,0xc5,0x83,0xca,0xb4) +#endif +#else +typedef struct ID3D12QueryHeapVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12QueryHeap *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12QueryHeap *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12QueryHeap *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12QueryHeap *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12QueryHeap *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12QueryHeap *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12QueryHeap *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12QueryHeap *This, + REFIID riid, + void **device); + + END_INTERFACE +} ID3D12QueryHeapVtbl; + +interface ID3D12QueryHeap { + CONST_VTBL ID3D12QueryHeapVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12QueryHeap_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12QueryHeap_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12QueryHeap_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12QueryHeap_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12QueryHeap_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12QueryHeap_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12QueryHeap_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12QueryHeap_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12QueryHeap_QueryInterface(ID3D12QueryHeap* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12QueryHeap_AddRef(ID3D12QueryHeap* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12QueryHeap_Release(ID3D12QueryHeap* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12QueryHeap_GetPrivateData(ID3D12QueryHeap* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12QueryHeap_SetPrivateData(ID3D12QueryHeap* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12QueryHeap_SetPrivateDataInterface(ID3D12QueryHeap* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12QueryHeap_SetName(ID3D12QueryHeap* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12QueryHeap_GetDevice(ID3D12QueryHeap* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12QueryHeap_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12CommandSignature interface + */ +#ifndef __ID3D12CommandSignature_INTERFACE_DEFINED__ +#define __ID3D12CommandSignature_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12CommandSignature, 0xc36a797c, 0xec80, 0x4f0a, 0x89,0x85, 0xa7,0xb2,0x47,0x50,0x82,0xd1); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("c36a797c-ec80-4f0a-8985-a7b2475082d1") +ID3D12CommandSignature : public ID3D12Pageable +{ +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12CommandSignature, 0xc36a797c, 0xec80, 0x4f0a, 0x89,0x85, 0xa7,0xb2,0x47,0x50,0x82,0xd1) +#endif +#else +typedef struct ID3D12CommandSignatureVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12CommandSignature *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12CommandSignature *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12CommandSignature *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12CommandSignature *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12CommandSignature *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12CommandSignature *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12CommandSignature *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12CommandSignature *This, + REFIID riid, + void **device); + + END_INTERFACE +} ID3D12CommandSignatureVtbl; + +interface ID3D12CommandSignature { + CONST_VTBL ID3D12CommandSignatureVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12CommandSignature_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12CommandSignature_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12CommandSignature_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12CommandSignature_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12CommandSignature_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12CommandSignature_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12CommandSignature_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12CommandSignature_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12CommandSignature_QueryInterface(ID3D12CommandSignature* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12CommandSignature_AddRef(ID3D12CommandSignature* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12CommandSignature_Release(ID3D12CommandSignature* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12CommandSignature_GetPrivateData(ID3D12CommandSignature* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12CommandSignature_SetPrivateData(ID3D12CommandSignature* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12CommandSignature_SetPrivateDataInterface(ID3D12CommandSignature* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12CommandSignature_SetName(ID3D12CommandSignature* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12CommandSignature_GetDevice(ID3D12CommandSignature* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12CommandSignature_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12GraphicsCommandList interface + */ +#ifndef __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12GraphicsCommandList, 0x5b160d0f, 0xac1b, 0x4185, 0x8b,0xa8, 0xb3,0xae,0x42,0xa5,0xa4,0x55); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("5b160d0f-ac1b-4185-8ba8-b3ae42a5a455") +ID3D12GraphicsCommandList : public ID3D12CommandList +{ + virtual HRESULT STDMETHODCALLTYPE Close( + ) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( + ID3D12CommandAllocator *allocator, + ID3D12PipelineState *initial_state) = 0; + + virtual HRESULT STDMETHODCALLTYPE ClearState( + ID3D12PipelineState *pipeline_state) = 0; + + virtual void STDMETHODCALLTYPE DrawInstanced( + UINT vertex_count_per_instance, + UINT instance_count, + UINT start_vertex_location, + UINT start_instance_location) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexedInstanced( + UINT index_count_per_instance, + UINT instance_count, + UINT start_vertex_location, + INT base_vertex_location, + UINT start_instance_location) = 0; + + virtual void STDMETHODCALLTYPE Dispatch( + UINT x, + UINT u, + UINT z) = 0; + + virtual void STDMETHODCALLTYPE CopyBufferRegion( + ID3D12Resource *dst_buffer, + UINT64 dst_offset, + ID3D12Resource *src_buffer, + UINT64 src_offset, + UINT64 byte_count) = 0; + + virtual void STDMETHODCALLTYPE CopyTextureRegion( + const D3D12_TEXTURE_COPY_LOCATION *dst, + UINT dst_x, + UINT dst_y, + UINT dst_z, + const D3D12_TEXTURE_COPY_LOCATION *src, + const D3D12_BOX *src_box) = 0; + + virtual void STDMETHODCALLTYPE CopyResource( + ID3D12Resource *dst_resource, + ID3D12Resource *src_resource) = 0; + + virtual void STDMETHODCALLTYPE CopyTiles( + ID3D12Resource *tiled_resource, + const D3D12_TILED_RESOURCE_COORDINATE *tile_region_start_coordinate, + const D3D12_TILE_REGION_SIZE *tile_region_size, + ID3D12Resource *buffer, + UINT64 buffer_offset, + D3D12_TILE_COPY_FLAGS flags) = 0; + + virtual void STDMETHODCALLTYPE ResolveSubresource( + ID3D12Resource *dst_resource, + UINT dst_sub_resource, + ID3D12Resource *src_resource, + UINT src_sub_resource, + DXGI_FORMAT format) = 0; + + virtual void STDMETHODCALLTYPE IASetPrimitiveTopology( + D3D12_PRIMITIVE_TOPOLOGY primitive_topology) = 0; + + virtual void STDMETHODCALLTYPE RSSetViewports( + UINT viewport_count, + const D3D12_VIEWPORT *viewports) = 0; + + virtual void STDMETHODCALLTYPE RSSetScissorRects( + UINT rect_count, + const D3D12_RECT *rects) = 0; + + virtual void STDMETHODCALLTYPE OMSetBlendFactor( + const FLOAT blend_factor[4]) = 0; + + virtual void STDMETHODCALLTYPE OMSetStencilRef( + UINT stencil_ref) = 0; + + virtual void STDMETHODCALLTYPE SetPipelineState( + ID3D12PipelineState *pipeline_state) = 0; + + virtual void STDMETHODCALLTYPE ResourceBarrier( + UINT barrier_count, + const D3D12_RESOURCE_BARRIER *barriers) = 0; + + virtual void STDMETHODCALLTYPE ExecuteBundle( + ID3D12GraphicsCommandList *command_list) = 0; + + virtual void STDMETHODCALLTYPE SetDescriptorHeaps( + UINT heap_count, + ID3D12DescriptorHeap *const *heaps) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootSignature( + ID3D12RootSignature *root_signature) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootSignature( + ID3D12RootSignature *root_signature) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootDescriptorTable( + UINT root_parameter_index, + D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootDescriptorTable( + UINT root_parameter_index, + D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRoot32BitConstant( + UINT root_parameter_index, + UINT data, + UINT dst_offset) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRoot32BitConstant( + UINT root_parameter_index, + UINT data, + UINT dst_offset) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRoot32BitConstants( + UINT root_parameter_index, + UINT constant_count, + const void *data, + UINT dst_offset) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRoot32BitConstants( + UINT root_parameter_index, + UINT constant_count, + const void *data, + UINT dst_offset) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootConstantBufferView( + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootConstantBufferView( + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootShaderResourceView( + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootShaderResourceView( + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootUnorderedAccessView( + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootUnorderedAccessView( + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address) = 0; + + virtual void STDMETHODCALLTYPE IASetIndexBuffer( + const D3D12_INDEX_BUFFER_VIEW *view) = 0; + + virtual void STDMETHODCALLTYPE IASetVertexBuffers( + UINT start_slot, + UINT view_count, + const D3D12_VERTEX_BUFFER_VIEW *views) = 0; + + virtual void STDMETHODCALLTYPE SOSetTargets( + UINT start_slot, + UINT view_count, + const D3D12_STREAM_OUTPUT_BUFFER_VIEW *views) = 0; + + virtual void STDMETHODCALLTYPE OMSetRenderTargets( + UINT render_target_descriptor_count, + const D3D12_CPU_DESCRIPTOR_HANDLE *render_target_descriptors, + BOOL single_descriptor_handle, + const D3D12_CPU_DESCRIPTOR_HANDLE *depth_stencil_descriptor) = 0; + + virtual void STDMETHODCALLTYPE ClearDepthStencilView( + D3D12_CPU_DESCRIPTOR_HANDLE dsv, + D3D12_CLEAR_FLAGS flags, + FLOAT depth, + UINT8 stencil, + UINT rect_count, + const D3D12_RECT *rects) = 0; + + virtual void STDMETHODCALLTYPE ClearRenderTargetView( + D3D12_CPU_DESCRIPTOR_HANDLE rtv, + const FLOAT color[4], + UINT rect_count, + const D3D12_RECT *rects) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewUint( + D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle, + D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, + ID3D12Resource *resource, + const UINT values[4], + UINT rect_count, + const D3D12_RECT *rects) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat( + D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle, + D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, + ID3D12Resource *resource, + const float values[4], + UINT rect_count, + const D3D12_RECT *rects) = 0; + + virtual void STDMETHODCALLTYPE DiscardResource( + ID3D12Resource *resource, + const D3D12_DISCARD_REGION *region) = 0; + + virtual void STDMETHODCALLTYPE BeginQuery( + ID3D12QueryHeap *heap, + D3D12_QUERY_TYPE type, + UINT index) = 0; + + virtual void STDMETHODCALLTYPE EndQuery( + ID3D12QueryHeap *heap, + D3D12_QUERY_TYPE type, + UINT index) = 0; + + virtual void STDMETHODCALLTYPE ResolveQueryData( + ID3D12QueryHeap *heap, + D3D12_QUERY_TYPE type, + UINT start_index, + UINT query_count, + ID3D12Resource *dst_buffer, + UINT64 aligned_dst_buffer_offset) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + ID3D12Resource *buffer, + UINT64 aligned_buffer_offset, + D3D12_PREDICATION_OP operation) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT metadata, + const void *data, + UINT size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT metadata, + const void *data, + UINT size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( + ) = 0; + + virtual void STDMETHODCALLTYPE ExecuteIndirect( + ID3D12CommandSignature *command_signature, + UINT max_command_count, + ID3D12Resource *arg_buffer, + UINT64 arg_buffer_offset, + ID3D12Resource *count_buffer, + UINT64 count_buffer_offset) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12GraphicsCommandList, 0x5b160d0f, 0xac1b, 0x4185, 0x8b,0xa8, 0xb3,0xae,0x42,0xa5,0xa4,0x55) +#endif +#else +typedef struct ID3D12GraphicsCommandListVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12GraphicsCommandList *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12GraphicsCommandList *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12GraphicsCommandList *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12GraphicsCommandList *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12GraphicsCommandList *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12GraphicsCommandList *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12GraphicsCommandList *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12GraphicsCommandList *This, + REFIID riid, + void **device); + + /*** ID3D12CommandList methods ***/ + D3D12_COMMAND_LIST_TYPE (STDMETHODCALLTYPE *GetType)( + ID3D12GraphicsCommandList *This); + + /*** ID3D12GraphicsCommandList methods ***/ + HRESULT (STDMETHODCALLTYPE *Close)( + ID3D12GraphicsCommandList *This); + + HRESULT (STDMETHODCALLTYPE *Reset)( + ID3D12GraphicsCommandList *This, + ID3D12CommandAllocator *allocator, + ID3D12PipelineState *initial_state); + + HRESULT (STDMETHODCALLTYPE *ClearState)( + ID3D12GraphicsCommandList *This, + ID3D12PipelineState *pipeline_state); + + void (STDMETHODCALLTYPE *DrawInstanced)( + ID3D12GraphicsCommandList *This, + UINT vertex_count_per_instance, + UINT instance_count, + UINT start_vertex_location, + UINT start_instance_location); + + void (STDMETHODCALLTYPE *DrawIndexedInstanced)( + ID3D12GraphicsCommandList *This, + UINT index_count_per_instance, + UINT instance_count, + UINT start_vertex_location, + INT base_vertex_location, + UINT start_instance_location); + + void (STDMETHODCALLTYPE *Dispatch)( + ID3D12GraphicsCommandList *This, + UINT x, + UINT u, + UINT z); + + void (STDMETHODCALLTYPE *CopyBufferRegion)( + ID3D12GraphicsCommandList *This, + ID3D12Resource *dst_buffer, + UINT64 dst_offset, + ID3D12Resource *src_buffer, + UINT64 src_offset, + UINT64 byte_count); + + void (STDMETHODCALLTYPE *CopyTextureRegion)( + ID3D12GraphicsCommandList *This, + const D3D12_TEXTURE_COPY_LOCATION *dst, + UINT dst_x, + UINT dst_y, + UINT dst_z, + const D3D12_TEXTURE_COPY_LOCATION *src, + const D3D12_BOX *src_box); + + void (STDMETHODCALLTYPE *CopyResource)( + ID3D12GraphicsCommandList *This, + ID3D12Resource *dst_resource, + ID3D12Resource *src_resource); + + void (STDMETHODCALLTYPE *CopyTiles)( + ID3D12GraphicsCommandList *This, + ID3D12Resource *tiled_resource, + const D3D12_TILED_RESOURCE_COORDINATE *tile_region_start_coordinate, + const D3D12_TILE_REGION_SIZE *tile_region_size, + ID3D12Resource *buffer, + UINT64 buffer_offset, + D3D12_TILE_COPY_FLAGS flags); + + void (STDMETHODCALLTYPE *ResolveSubresource)( + ID3D12GraphicsCommandList *This, + ID3D12Resource *dst_resource, + UINT dst_sub_resource, + ID3D12Resource *src_resource, + UINT src_sub_resource, + DXGI_FORMAT format); + + void (STDMETHODCALLTYPE *IASetPrimitiveTopology)( + ID3D12GraphicsCommandList *This, + D3D12_PRIMITIVE_TOPOLOGY primitive_topology); + + void (STDMETHODCALLTYPE *RSSetViewports)( + ID3D12GraphicsCommandList *This, + UINT viewport_count, + const D3D12_VIEWPORT *viewports); + + void (STDMETHODCALLTYPE *RSSetScissorRects)( + ID3D12GraphicsCommandList *This, + UINT rect_count, + const D3D12_RECT *rects); + + void (STDMETHODCALLTYPE *OMSetBlendFactor)( + ID3D12GraphicsCommandList *This, + const FLOAT blend_factor[4]); + + void (STDMETHODCALLTYPE *OMSetStencilRef)( + ID3D12GraphicsCommandList *This, + UINT stencil_ref); + + void (STDMETHODCALLTYPE *SetPipelineState)( + ID3D12GraphicsCommandList *This, + ID3D12PipelineState *pipeline_state); + + void (STDMETHODCALLTYPE *ResourceBarrier)( + ID3D12GraphicsCommandList *This, + UINT barrier_count, + const D3D12_RESOURCE_BARRIER *barriers); + + void (STDMETHODCALLTYPE *ExecuteBundle)( + ID3D12GraphicsCommandList *This, + ID3D12GraphicsCommandList *command_list); + + void (STDMETHODCALLTYPE *SetDescriptorHeaps)( + ID3D12GraphicsCommandList *This, + UINT heap_count, + ID3D12DescriptorHeap *const *heaps); + + void (STDMETHODCALLTYPE *SetComputeRootSignature)( + ID3D12GraphicsCommandList *This, + ID3D12RootSignature *root_signature); + + void (STDMETHODCALLTYPE *SetGraphicsRootSignature)( + ID3D12GraphicsCommandList *This, + ID3D12RootSignature *root_signature); + + void (STDMETHODCALLTYPE *SetComputeRootDescriptorTable)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor); + + void (STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor); + + void (STDMETHODCALLTYPE *SetComputeRoot32BitConstant)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + UINT data, + UINT dst_offset); + + void (STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + UINT data, + UINT dst_offset); + + void (STDMETHODCALLTYPE *SetComputeRoot32BitConstants)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + UINT constant_count, + const void *data, + UINT dst_offset); + + void (STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + UINT constant_count, + const void *data, + UINT dst_offset); + + void (STDMETHODCALLTYPE *SetComputeRootConstantBufferView)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address); + + void (STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address); + + void (STDMETHODCALLTYPE *SetComputeRootShaderResourceView)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address); + + void (STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address); + + void (STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address); + + void (STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView)( + ID3D12GraphicsCommandList *This, + UINT root_parameter_index, + D3D12_GPU_VIRTUAL_ADDRESS address); + + void (STDMETHODCALLTYPE *IASetIndexBuffer)( + ID3D12GraphicsCommandList *This, + const D3D12_INDEX_BUFFER_VIEW *view); + + void (STDMETHODCALLTYPE *IASetVertexBuffers)( + ID3D12GraphicsCommandList *This, + UINT start_slot, + UINT view_count, + const D3D12_VERTEX_BUFFER_VIEW *views); + + void (STDMETHODCALLTYPE *SOSetTargets)( + ID3D12GraphicsCommandList *This, + UINT start_slot, + UINT view_count, + const D3D12_STREAM_OUTPUT_BUFFER_VIEW *views); + + void (STDMETHODCALLTYPE *OMSetRenderTargets)( + ID3D12GraphicsCommandList *This, + UINT render_target_descriptor_count, + const D3D12_CPU_DESCRIPTOR_HANDLE *render_target_descriptors, + BOOL single_descriptor_handle, + const D3D12_CPU_DESCRIPTOR_HANDLE *depth_stencil_descriptor); + + void (STDMETHODCALLTYPE *ClearDepthStencilView)( + ID3D12GraphicsCommandList *This, + D3D12_CPU_DESCRIPTOR_HANDLE dsv, + D3D12_CLEAR_FLAGS flags, + FLOAT depth, + UINT8 stencil, + UINT rect_count, + const D3D12_RECT *rects); + + void (STDMETHODCALLTYPE *ClearRenderTargetView)( + ID3D12GraphicsCommandList *This, + D3D12_CPU_DESCRIPTOR_HANDLE rtv, + const FLOAT color[4], + UINT rect_count, + const D3D12_RECT *rects); + + void (STDMETHODCALLTYPE *ClearUnorderedAccessViewUint)( + ID3D12GraphicsCommandList *This, + D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle, + D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, + ID3D12Resource *resource, + const UINT values[4], + UINT rect_count, + const D3D12_RECT *rects); + + void (STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat)( + ID3D12GraphicsCommandList *This, + D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle, + D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, + ID3D12Resource *resource, + const float values[4], + UINT rect_count, + const D3D12_RECT *rects); + + void (STDMETHODCALLTYPE *DiscardResource)( + ID3D12GraphicsCommandList *This, + ID3D12Resource *resource, + const D3D12_DISCARD_REGION *region); + + void (STDMETHODCALLTYPE *BeginQuery)( + ID3D12GraphicsCommandList *This, + ID3D12QueryHeap *heap, + D3D12_QUERY_TYPE type, + UINT index); + + void (STDMETHODCALLTYPE *EndQuery)( + ID3D12GraphicsCommandList *This, + ID3D12QueryHeap *heap, + D3D12_QUERY_TYPE type, + UINT index); + + void (STDMETHODCALLTYPE *ResolveQueryData)( + ID3D12GraphicsCommandList *This, + ID3D12QueryHeap *heap, + D3D12_QUERY_TYPE type, + UINT start_index, + UINT query_count, + ID3D12Resource *dst_buffer, + UINT64 aligned_dst_buffer_offset); + + void (STDMETHODCALLTYPE *SetPredication)( + ID3D12GraphicsCommandList *This, + ID3D12Resource *buffer, + UINT64 aligned_buffer_offset, + D3D12_PREDICATION_OP operation); + + void (STDMETHODCALLTYPE *SetMarker)( + ID3D12GraphicsCommandList *This, + UINT metadata, + const void *data, + UINT size); + + void (STDMETHODCALLTYPE *BeginEvent)( + ID3D12GraphicsCommandList *This, + UINT metadata, + const void *data, + UINT size); + + void (STDMETHODCALLTYPE *EndEvent)( + ID3D12GraphicsCommandList *This); + + void (STDMETHODCALLTYPE *ExecuteIndirect)( + ID3D12GraphicsCommandList *This, + ID3D12CommandSignature *command_signature, + UINT max_command_count, + ID3D12Resource *arg_buffer, + UINT64 arg_buffer_offset, + ID3D12Resource *count_buffer, + UINT64 count_buffer_offset); + + END_INTERFACE +} ID3D12GraphicsCommandListVtbl; + +interface ID3D12GraphicsCommandList { + CONST_VTBL ID3D12GraphicsCommandListVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12GraphicsCommandList_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12GraphicsCommandList_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12GraphicsCommandList_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12GraphicsCommandList_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12GraphicsCommandList_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12GraphicsCommandList_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12GraphicsCommandList_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12GraphicsCommandList_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +/*** ID3D12CommandList methods ***/ +#define ID3D12GraphicsCommandList_GetType(This) (This)->lpVtbl->GetType(This) +/*** ID3D12GraphicsCommandList methods ***/ +#define ID3D12GraphicsCommandList_Close(This) (This)->lpVtbl->Close(This) +#define ID3D12GraphicsCommandList_Reset(This,allocator,initial_state) (This)->lpVtbl->Reset(This,allocator,initial_state) +#define ID3D12GraphicsCommandList_ClearState(This,pipeline_state) (This)->lpVtbl->ClearState(This,pipeline_state) +#define ID3D12GraphicsCommandList_DrawInstanced(This,vertex_count_per_instance,instance_count,start_vertex_location,start_instance_location) (This)->lpVtbl->DrawInstanced(This,vertex_count_per_instance,instance_count,start_vertex_location,start_instance_location) +#define ID3D12GraphicsCommandList_DrawIndexedInstanced(This,index_count_per_instance,instance_count,start_vertex_location,base_vertex_location,start_instance_location) (This)->lpVtbl->DrawIndexedInstanced(This,index_count_per_instance,instance_count,start_vertex_location,base_vertex_location,start_instance_location) +#define ID3D12GraphicsCommandList_Dispatch(This,x,u,z) (This)->lpVtbl->Dispatch(This,x,u,z) +#define ID3D12GraphicsCommandList_CopyBufferRegion(This,dst_buffer,dst_offset,src_buffer,src_offset,byte_count) (This)->lpVtbl->CopyBufferRegion(This,dst_buffer,dst_offset,src_buffer,src_offset,byte_count) +#define ID3D12GraphicsCommandList_CopyTextureRegion(This,dst,dst_x,dst_y,dst_z,src,src_box) (This)->lpVtbl->CopyTextureRegion(This,dst,dst_x,dst_y,dst_z,src,src_box) +#define ID3D12GraphicsCommandList_CopyResource(This,dst_resource,src_resource) (This)->lpVtbl->CopyResource(This,dst_resource,src_resource) +#define ID3D12GraphicsCommandList_CopyTiles(This,tiled_resource,tile_region_start_coordinate,tile_region_size,buffer,buffer_offset,flags) (This)->lpVtbl->CopyTiles(This,tiled_resource,tile_region_start_coordinate,tile_region_size,buffer,buffer_offset,flags) +#define ID3D12GraphicsCommandList_ResolveSubresource(This,dst_resource,dst_sub_resource,src_resource,src_sub_resource,format) (This)->lpVtbl->ResolveSubresource(This,dst_resource,dst_sub_resource,src_resource,src_sub_resource,format) +#define ID3D12GraphicsCommandList_IASetPrimitiveTopology(This,primitive_topology) (This)->lpVtbl->IASetPrimitiveTopology(This,primitive_topology) +#define ID3D12GraphicsCommandList_RSSetViewports(This,viewport_count,viewports) (This)->lpVtbl->RSSetViewports(This,viewport_count,viewports) +#define ID3D12GraphicsCommandList_RSSetScissorRects(This,rect_count,rects) (This)->lpVtbl->RSSetScissorRects(This,rect_count,rects) +#define ID3D12GraphicsCommandList_OMSetBlendFactor(This,blend_factor) (This)->lpVtbl->OMSetBlendFactor(This,blend_factor) +#define ID3D12GraphicsCommandList_OMSetStencilRef(This,stencil_ref) (This)->lpVtbl->OMSetStencilRef(This,stencil_ref) +#define ID3D12GraphicsCommandList_SetPipelineState(This,pipeline_state) (This)->lpVtbl->SetPipelineState(This,pipeline_state) +#define ID3D12GraphicsCommandList_ResourceBarrier(This,barrier_count,barriers) (This)->lpVtbl->ResourceBarrier(This,barrier_count,barriers) +#define ID3D12GraphicsCommandList_ExecuteBundle(This,command_list) (This)->lpVtbl->ExecuteBundle(This,command_list) +#define ID3D12GraphicsCommandList_SetDescriptorHeaps(This,heap_count,heaps) (This)->lpVtbl->SetDescriptorHeaps(This,heap_count,heaps) +#define ID3D12GraphicsCommandList_SetComputeRootSignature(This,root_signature) (This)->lpVtbl->SetComputeRootSignature(This,root_signature) +#define ID3D12GraphicsCommandList_SetGraphicsRootSignature(This,root_signature) (This)->lpVtbl->SetGraphicsRootSignature(This,root_signature) +#define ID3D12GraphicsCommandList_SetComputeRootDescriptorTable(This,root_parameter_index,base_descriptor) (This)->lpVtbl->SetComputeRootDescriptorTable(This,root_parameter_index,base_descriptor) +#define ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(This,root_parameter_index,base_descriptor) (This)->lpVtbl->SetGraphicsRootDescriptorTable(This,root_parameter_index,base_descriptor) +#define ID3D12GraphicsCommandList_SetComputeRoot32BitConstant(This,root_parameter_index,data,dst_offset) (This)->lpVtbl->SetComputeRoot32BitConstant(This,root_parameter_index,data,dst_offset) +#define ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstant(This,root_parameter_index,data,dst_offset) (This)->lpVtbl->SetGraphicsRoot32BitConstant(This,root_parameter_index,data,dst_offset) +#define ID3D12GraphicsCommandList_SetComputeRoot32BitConstants(This,root_parameter_index,constant_count,data,dst_offset) (This)->lpVtbl->SetComputeRoot32BitConstants(This,root_parameter_index,constant_count,data,dst_offset) +#define ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstants(This,root_parameter_index,constant_count,data,dst_offset) (This)->lpVtbl->SetGraphicsRoot32BitConstants(This,root_parameter_index,constant_count,data,dst_offset) +#define ID3D12GraphicsCommandList_SetComputeRootConstantBufferView(This,root_parameter_index,address) (This)->lpVtbl->SetComputeRootConstantBufferView(This,root_parameter_index,address) +#define ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(This,root_parameter_index,address) (This)->lpVtbl->SetGraphicsRootConstantBufferView(This,root_parameter_index,address) +#define ID3D12GraphicsCommandList_SetComputeRootShaderResourceView(This,root_parameter_index,address) (This)->lpVtbl->SetComputeRootShaderResourceView(This,root_parameter_index,address) +#define ID3D12GraphicsCommandList_SetGraphicsRootShaderResourceView(This,root_parameter_index,address) (This)->lpVtbl->SetGraphicsRootShaderResourceView(This,root_parameter_index,address) +#define ID3D12GraphicsCommandList_SetComputeRootUnorderedAccessView(This,root_parameter_index,address) (This)->lpVtbl->SetComputeRootUnorderedAccessView(This,root_parameter_index,address) +#define ID3D12GraphicsCommandList_SetGraphicsRootUnorderedAccessView(This,root_parameter_index,address) (This)->lpVtbl->SetGraphicsRootUnorderedAccessView(This,root_parameter_index,address) +#define ID3D12GraphicsCommandList_IASetIndexBuffer(This,view) (This)->lpVtbl->IASetIndexBuffer(This,view) +#define ID3D12GraphicsCommandList_IASetVertexBuffers(This,start_slot,view_count,views) (This)->lpVtbl->IASetVertexBuffers(This,start_slot,view_count,views) +#define ID3D12GraphicsCommandList_SOSetTargets(This,start_slot,view_count,views) (This)->lpVtbl->SOSetTargets(This,start_slot,view_count,views) +#define ID3D12GraphicsCommandList_OMSetRenderTargets(This,render_target_descriptor_count,render_target_descriptors,single_descriptor_handle,depth_stencil_descriptor) (This)->lpVtbl->OMSetRenderTargets(This,render_target_descriptor_count,render_target_descriptors,single_descriptor_handle,depth_stencil_descriptor) +#define ID3D12GraphicsCommandList_ClearDepthStencilView(This,dsv,flags,depth,stencil,rect_count,rects) (This)->lpVtbl->ClearDepthStencilView(This,dsv,flags,depth,stencil,rect_count,rects) +#define ID3D12GraphicsCommandList_ClearRenderTargetView(This,rtv,color,rect_count,rects) (This)->lpVtbl->ClearRenderTargetView(This,rtv,color,rect_count,rects) +#define ID3D12GraphicsCommandList_ClearUnorderedAccessViewUint(This,gpu_handle,cpu_handle,resource,values,rect_count,rects) (This)->lpVtbl->ClearUnorderedAccessViewUint(This,gpu_handle,cpu_handle,resource,values,rect_count,rects) +#define ID3D12GraphicsCommandList_ClearUnorderedAccessViewFloat(This,gpu_handle,cpu_handle,resource,values,rect_count,rects) (This)->lpVtbl->ClearUnorderedAccessViewFloat(This,gpu_handle,cpu_handle,resource,values,rect_count,rects) +#define ID3D12GraphicsCommandList_DiscardResource(This,resource,region) (This)->lpVtbl->DiscardResource(This,resource,region) +#define ID3D12GraphicsCommandList_BeginQuery(This,heap,type,index) (This)->lpVtbl->BeginQuery(This,heap,type,index) +#define ID3D12GraphicsCommandList_EndQuery(This,heap,type,index) (This)->lpVtbl->EndQuery(This,heap,type,index) +#define ID3D12GraphicsCommandList_ResolveQueryData(This,heap,type,start_index,query_count,dst_buffer,aligned_dst_buffer_offset) (This)->lpVtbl->ResolveQueryData(This,heap,type,start_index,query_count,dst_buffer,aligned_dst_buffer_offset) +#define ID3D12GraphicsCommandList_SetPredication(This,buffer,aligned_buffer_offset,operation) (This)->lpVtbl->SetPredication(This,buffer,aligned_buffer_offset,operation) +#define ID3D12GraphicsCommandList_SetMarker(This,metadata,data,size) (This)->lpVtbl->SetMarker(This,metadata,data,size) +#define ID3D12GraphicsCommandList_BeginEvent(This,metadata,data,size) (This)->lpVtbl->BeginEvent(This,metadata,data,size) +#define ID3D12GraphicsCommandList_EndEvent(This) (This)->lpVtbl->EndEvent(This) +#define ID3D12GraphicsCommandList_ExecuteIndirect(This,command_signature,max_command_count,arg_buffer,arg_buffer_offset,count_buffer,count_buffer_offset) (This)->lpVtbl->ExecuteIndirect(This,command_signature,max_command_count,arg_buffer,arg_buffer_offset,count_buffer,count_buffer_offset) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12GraphicsCommandList_QueryInterface(ID3D12GraphicsCommandList* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12GraphicsCommandList_AddRef(ID3D12GraphicsCommandList* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12GraphicsCommandList_Release(ID3D12GraphicsCommandList* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12GraphicsCommandList_GetPrivateData(ID3D12GraphicsCommandList* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12GraphicsCommandList_SetPrivateData(ID3D12GraphicsCommandList* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12GraphicsCommandList_SetPrivateDataInterface(ID3D12GraphicsCommandList* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12GraphicsCommandList_SetName(ID3D12GraphicsCommandList* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12GraphicsCommandList_GetDevice(ID3D12GraphicsCommandList* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +/*** ID3D12CommandList methods ***/ +static FORCEINLINE D3D12_COMMAND_LIST_TYPE ID3D12GraphicsCommandList_GetType(ID3D12GraphicsCommandList* This) { + return This->lpVtbl->GetType(This); +} +/*** ID3D12GraphicsCommandList methods ***/ +static FORCEINLINE HRESULT ID3D12GraphicsCommandList_Close(ID3D12GraphicsCommandList* This) { + return This->lpVtbl->Close(This); +} +static FORCEINLINE HRESULT ID3D12GraphicsCommandList_Reset(ID3D12GraphicsCommandList* This,ID3D12CommandAllocator *allocator,ID3D12PipelineState *initial_state) { + return This->lpVtbl->Reset(This,allocator,initial_state); +} +static FORCEINLINE HRESULT ID3D12GraphicsCommandList_ClearState(ID3D12GraphicsCommandList* This,ID3D12PipelineState *pipeline_state) { + return This->lpVtbl->ClearState(This,pipeline_state); +} +static FORCEINLINE void ID3D12GraphicsCommandList_DrawInstanced(ID3D12GraphicsCommandList* This,UINT vertex_count_per_instance,UINT instance_count,UINT start_vertex_location,UINT start_instance_location) { + This->lpVtbl->DrawInstanced(This,vertex_count_per_instance,instance_count,start_vertex_location,start_instance_location); +} +static FORCEINLINE void ID3D12GraphicsCommandList_DrawIndexedInstanced(ID3D12GraphicsCommandList* This,UINT index_count_per_instance,UINT instance_count,UINT start_vertex_location,INT base_vertex_location,UINT start_instance_location) { + This->lpVtbl->DrawIndexedInstanced(This,index_count_per_instance,instance_count,start_vertex_location,base_vertex_location,start_instance_location); +} +static FORCEINLINE void ID3D12GraphicsCommandList_Dispatch(ID3D12GraphicsCommandList* This,UINT x,UINT u,UINT z) { + This->lpVtbl->Dispatch(This,x,u,z); +} +static FORCEINLINE void ID3D12GraphicsCommandList_CopyBufferRegion(ID3D12GraphicsCommandList* This,ID3D12Resource *dst_buffer,UINT64 dst_offset,ID3D12Resource *src_buffer,UINT64 src_offset,UINT64 byte_count) { + This->lpVtbl->CopyBufferRegion(This,dst_buffer,dst_offset,src_buffer,src_offset,byte_count); +} +static FORCEINLINE void ID3D12GraphicsCommandList_CopyTextureRegion(ID3D12GraphicsCommandList* This,const D3D12_TEXTURE_COPY_LOCATION *dst,UINT dst_x,UINT dst_y,UINT dst_z,const D3D12_TEXTURE_COPY_LOCATION *src,const D3D12_BOX *src_box) { + This->lpVtbl->CopyTextureRegion(This,dst,dst_x,dst_y,dst_z,src,src_box); +} +static FORCEINLINE void ID3D12GraphicsCommandList_CopyResource(ID3D12GraphicsCommandList* This,ID3D12Resource *dst_resource,ID3D12Resource *src_resource) { + This->lpVtbl->CopyResource(This,dst_resource,src_resource); +} +static FORCEINLINE void ID3D12GraphicsCommandList_CopyTiles(ID3D12GraphicsCommandList* This,ID3D12Resource *tiled_resource,const D3D12_TILED_RESOURCE_COORDINATE *tile_region_start_coordinate,const D3D12_TILE_REGION_SIZE *tile_region_size,ID3D12Resource *buffer,UINT64 buffer_offset,D3D12_TILE_COPY_FLAGS flags) { + This->lpVtbl->CopyTiles(This,tiled_resource,tile_region_start_coordinate,tile_region_size,buffer,buffer_offset,flags); +} +static FORCEINLINE void ID3D12GraphicsCommandList_ResolveSubresource(ID3D12GraphicsCommandList* This,ID3D12Resource *dst_resource,UINT dst_sub_resource,ID3D12Resource *src_resource,UINT src_sub_resource,DXGI_FORMAT format) { + This->lpVtbl->ResolveSubresource(This,dst_resource,dst_sub_resource,src_resource,src_sub_resource,format); +} +static FORCEINLINE void ID3D12GraphicsCommandList_IASetPrimitiveTopology(ID3D12GraphicsCommandList* This,D3D12_PRIMITIVE_TOPOLOGY primitive_topology) { + This->lpVtbl->IASetPrimitiveTopology(This,primitive_topology); +} +static FORCEINLINE void ID3D12GraphicsCommandList_RSSetViewports(ID3D12GraphicsCommandList* This,UINT viewport_count,const D3D12_VIEWPORT *viewports) { + This->lpVtbl->RSSetViewports(This,viewport_count,viewports); +} +static FORCEINLINE void ID3D12GraphicsCommandList_RSSetScissorRects(ID3D12GraphicsCommandList* This,UINT rect_count,const D3D12_RECT *rects) { + This->lpVtbl->RSSetScissorRects(This,rect_count,rects); +} +static FORCEINLINE void ID3D12GraphicsCommandList_OMSetBlendFactor(ID3D12GraphicsCommandList* This,const FLOAT blend_factor[4]) { + This->lpVtbl->OMSetBlendFactor(This,blend_factor); +} +static FORCEINLINE void ID3D12GraphicsCommandList_OMSetStencilRef(ID3D12GraphicsCommandList* This,UINT stencil_ref) { + This->lpVtbl->OMSetStencilRef(This,stencil_ref); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetPipelineState(ID3D12GraphicsCommandList* This,ID3D12PipelineState *pipeline_state) { + This->lpVtbl->SetPipelineState(This,pipeline_state); +} +static FORCEINLINE void ID3D12GraphicsCommandList_ResourceBarrier(ID3D12GraphicsCommandList* This,UINT barrier_count,const D3D12_RESOURCE_BARRIER *barriers) { + This->lpVtbl->ResourceBarrier(This,barrier_count,barriers); +} +static FORCEINLINE void ID3D12GraphicsCommandList_ExecuteBundle(ID3D12GraphicsCommandList* This,ID3D12GraphicsCommandList *command_list) { + This->lpVtbl->ExecuteBundle(This,command_list); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetDescriptorHeaps(ID3D12GraphicsCommandList* This,UINT heap_count,ID3D12DescriptorHeap *const *heaps) { + This->lpVtbl->SetDescriptorHeaps(This,heap_count,heaps); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetComputeRootSignature(ID3D12GraphicsCommandList* This,ID3D12RootSignature *root_signature) { + This->lpVtbl->SetComputeRootSignature(This,root_signature); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetGraphicsRootSignature(ID3D12GraphicsCommandList* This,ID3D12RootSignature *root_signature) { + This->lpVtbl->SetGraphicsRootSignature(This,root_signature); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetComputeRootDescriptorTable(ID3D12GraphicsCommandList* This,UINT root_parameter_index,D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) { + This->lpVtbl->SetComputeRootDescriptorTable(This,root_parameter_index,base_descriptor); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(ID3D12GraphicsCommandList* This,UINT root_parameter_index,D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) { + This->lpVtbl->SetGraphicsRootDescriptorTable(This,root_parameter_index,base_descriptor); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetComputeRoot32BitConstant(ID3D12GraphicsCommandList* This,UINT root_parameter_index,UINT data,UINT dst_offset) { + This->lpVtbl->SetComputeRoot32BitConstant(This,root_parameter_index,data,dst_offset); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstant(ID3D12GraphicsCommandList* This,UINT root_parameter_index,UINT data,UINT dst_offset) { + This->lpVtbl->SetGraphicsRoot32BitConstant(This,root_parameter_index,data,dst_offset); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetComputeRoot32BitConstants(ID3D12GraphicsCommandList* This,UINT root_parameter_index,UINT constant_count,const void *data,UINT dst_offset) { + This->lpVtbl->SetComputeRoot32BitConstants(This,root_parameter_index,constant_count,data,dst_offset); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstants(ID3D12GraphicsCommandList* This,UINT root_parameter_index,UINT constant_count,const void *data,UINT dst_offset) { + This->lpVtbl->SetGraphicsRoot32BitConstants(This,root_parameter_index,constant_count,data,dst_offset); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetComputeRootConstantBufferView(ID3D12GraphicsCommandList* This,UINT root_parameter_index,D3D12_GPU_VIRTUAL_ADDRESS address) { + This->lpVtbl->SetComputeRootConstantBufferView(This,root_parameter_index,address); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(ID3D12GraphicsCommandList* This,UINT root_parameter_index,D3D12_GPU_VIRTUAL_ADDRESS address) { + This->lpVtbl->SetGraphicsRootConstantBufferView(This,root_parameter_index,address); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetComputeRootShaderResourceView(ID3D12GraphicsCommandList* This,UINT root_parameter_index,D3D12_GPU_VIRTUAL_ADDRESS address) { + This->lpVtbl->SetComputeRootShaderResourceView(This,root_parameter_index,address); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetGraphicsRootShaderResourceView(ID3D12GraphicsCommandList* This,UINT root_parameter_index,D3D12_GPU_VIRTUAL_ADDRESS address) { + This->lpVtbl->SetGraphicsRootShaderResourceView(This,root_parameter_index,address); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetComputeRootUnorderedAccessView(ID3D12GraphicsCommandList* This,UINT root_parameter_index,D3D12_GPU_VIRTUAL_ADDRESS address) { + This->lpVtbl->SetComputeRootUnorderedAccessView(This,root_parameter_index,address); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetGraphicsRootUnorderedAccessView(ID3D12GraphicsCommandList* This,UINT root_parameter_index,D3D12_GPU_VIRTUAL_ADDRESS address) { + This->lpVtbl->SetGraphicsRootUnorderedAccessView(This,root_parameter_index,address); +} +static FORCEINLINE void ID3D12GraphicsCommandList_IASetIndexBuffer(ID3D12GraphicsCommandList* This,const D3D12_INDEX_BUFFER_VIEW *view) { + This->lpVtbl->IASetIndexBuffer(This,view); +} +static FORCEINLINE void ID3D12GraphicsCommandList_IASetVertexBuffers(ID3D12GraphicsCommandList* This,UINT start_slot,UINT view_count,const D3D12_VERTEX_BUFFER_VIEW *views) { + This->lpVtbl->IASetVertexBuffers(This,start_slot,view_count,views); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SOSetTargets(ID3D12GraphicsCommandList* This,UINT start_slot,UINT view_count,const D3D12_STREAM_OUTPUT_BUFFER_VIEW *views) { + This->lpVtbl->SOSetTargets(This,start_slot,view_count,views); +} +static FORCEINLINE void ID3D12GraphicsCommandList_OMSetRenderTargets(ID3D12GraphicsCommandList* This,UINT render_target_descriptor_count,const D3D12_CPU_DESCRIPTOR_HANDLE *render_target_descriptors,BOOL single_descriptor_handle,const D3D12_CPU_DESCRIPTOR_HANDLE *depth_stencil_descriptor) { + This->lpVtbl->OMSetRenderTargets(This,render_target_descriptor_count,render_target_descriptors,single_descriptor_handle,depth_stencil_descriptor); +} +static FORCEINLINE void ID3D12GraphicsCommandList_ClearDepthStencilView(ID3D12GraphicsCommandList* This,D3D12_CPU_DESCRIPTOR_HANDLE dsv,D3D12_CLEAR_FLAGS flags,FLOAT depth,UINT8 stencil,UINT rect_count,const D3D12_RECT *rects) { + This->lpVtbl->ClearDepthStencilView(This,dsv,flags,depth,stencil,rect_count,rects); +} +static FORCEINLINE void ID3D12GraphicsCommandList_ClearRenderTargetView(ID3D12GraphicsCommandList* This,D3D12_CPU_DESCRIPTOR_HANDLE rtv,const FLOAT color[4],UINT rect_count,const D3D12_RECT *rects) { + This->lpVtbl->ClearRenderTargetView(This,rtv,color,rect_count,rects); +} +static FORCEINLINE void ID3D12GraphicsCommandList_ClearUnorderedAccessViewUint(ID3D12GraphicsCommandList* This,D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle,D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle,ID3D12Resource *resource,const UINT values[4],UINT rect_count,const D3D12_RECT *rects) { + This->lpVtbl->ClearUnorderedAccessViewUint(This,gpu_handle,cpu_handle,resource,values,rect_count,rects); +} +static FORCEINLINE void ID3D12GraphicsCommandList_ClearUnorderedAccessViewFloat(ID3D12GraphicsCommandList* This,D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle,D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle,ID3D12Resource *resource,const float values[4],UINT rect_count,const D3D12_RECT *rects) { + This->lpVtbl->ClearUnorderedAccessViewFloat(This,gpu_handle,cpu_handle,resource,values,rect_count,rects); +} +static FORCEINLINE void ID3D12GraphicsCommandList_DiscardResource(ID3D12GraphicsCommandList* This,ID3D12Resource *resource,const D3D12_DISCARD_REGION *region) { + This->lpVtbl->DiscardResource(This,resource,region); +} +static FORCEINLINE void ID3D12GraphicsCommandList_BeginQuery(ID3D12GraphicsCommandList* This,ID3D12QueryHeap *heap,D3D12_QUERY_TYPE type,UINT index) { + This->lpVtbl->BeginQuery(This,heap,type,index); +} +static FORCEINLINE void ID3D12GraphicsCommandList_EndQuery(ID3D12GraphicsCommandList* This,ID3D12QueryHeap *heap,D3D12_QUERY_TYPE type,UINT index) { + This->lpVtbl->EndQuery(This,heap,type,index); +} +static FORCEINLINE void ID3D12GraphicsCommandList_ResolveQueryData(ID3D12GraphicsCommandList* This,ID3D12QueryHeap *heap,D3D12_QUERY_TYPE type,UINT start_index,UINT query_count,ID3D12Resource *dst_buffer,UINT64 aligned_dst_buffer_offset) { + This->lpVtbl->ResolveQueryData(This,heap,type,start_index,query_count,dst_buffer,aligned_dst_buffer_offset); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetPredication(ID3D12GraphicsCommandList* This,ID3D12Resource *buffer,UINT64 aligned_buffer_offset,D3D12_PREDICATION_OP operation) { + This->lpVtbl->SetPredication(This,buffer,aligned_buffer_offset,operation); +} +static FORCEINLINE void ID3D12GraphicsCommandList_SetMarker(ID3D12GraphicsCommandList* This,UINT metadata,const void *data,UINT size) { + This->lpVtbl->SetMarker(This,metadata,data,size); +} +static FORCEINLINE void ID3D12GraphicsCommandList_BeginEvent(ID3D12GraphicsCommandList* This,UINT metadata,const void *data,UINT size) { + This->lpVtbl->BeginEvent(This,metadata,data,size); +} +static FORCEINLINE void ID3D12GraphicsCommandList_EndEvent(ID3D12GraphicsCommandList* This) { + This->lpVtbl->EndEvent(This); +} +static FORCEINLINE void ID3D12GraphicsCommandList_ExecuteIndirect(ID3D12GraphicsCommandList* This,ID3D12CommandSignature *command_signature,UINT max_command_count,ID3D12Resource *arg_buffer,UINT64 arg_buffer_offset,ID3D12Resource *count_buffer,UINT64 count_buffer_offset) { + This->lpVtbl->ExecuteIndirect(This,command_signature,max_command_count,arg_buffer,arg_buffer_offset,count_buffer,count_buffer_offset); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ */ + +typedef enum D3D12_TILE_RANGE_FLAGS { + D3D12_TILE_RANGE_FLAG_NONE = 0x0, + D3D12_TILE_RANGE_FLAG_NULL = 0x1, + D3D12_TILE_RANGE_FLAG_SKIP = 0x2, + D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE = 0x4 +} D3D12_TILE_RANGE_FLAGS; +typedef enum D3D12_TILE_MAPPING_FLAGS { + D3D12_TILE_MAPPING_FLAG_NONE = 0x0, + D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1 +} D3D12_TILE_MAPPING_FLAGS; +/***************************************************************************** + * ID3D12CommandQueue interface + */ +#ifndef __ID3D12CommandQueue_INTERFACE_DEFINED__ +#define __ID3D12CommandQueue_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12CommandQueue, 0x0ec870a6, 0x5d7e, 0x4c22, 0x8c,0xfc, 0x5b,0xaa,0xe0,0x76,0x16,0xed); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("0ec870a6-5d7e-4c22-8cfc-5baae07616ed") +ID3D12CommandQueue : public ID3D12Pageable +{ + virtual void STDMETHODCALLTYPE UpdateTileMappings( + ID3D12Resource *resource, + UINT region_count, + const D3D12_TILED_RESOURCE_COORDINATE *region_start_coordinates, + const D3D12_TILE_REGION_SIZE *region_sizes, + UINT range_count, + const D3D12_TILE_RANGE_FLAGS *range_flags, + UINT *heap_range_offsets, + UINT *range_tile_counts, + D3D12_TILE_MAPPING_FLAGS flags) = 0; + + virtual void STDMETHODCALLTYPE CopyTileMappings( + ID3D12Resource *dst_resource, + const D3D12_TILED_RESOURCE_COORDINATE *dst_region_start_coordinate, + ID3D12Resource *src_resource, + const D3D12_TILED_RESOURCE_COORDINATE *src_region_start_coordinate, + const D3D12_TILE_REGION_SIZE *region_size, + D3D12_TILE_MAPPING_FLAGS flags) = 0; + + virtual void STDMETHODCALLTYPE ExecuteCommandLists( + UINT command_list_count, + ID3D12CommandList *const *command_lists) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT metadata, + const void *data, + UINT size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT metadata, + const void *data, + UINT size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( + ) = 0; + + virtual HRESULT STDMETHODCALLTYPE Signal( + ID3D12Fence *fence, + UINT64 value) = 0; + + virtual HRESULT STDMETHODCALLTYPE Wait( + ID3D12Fence *fence, + UINT64 value) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetTimestampFrequency( + UINT64 *frequency) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetClockCalibration( + UINT64 *gpu_timestamp, + UINT64 *cpu_timestamp) = 0; + +#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS + virtual D3D12_COMMAND_QUEUE_DESC* STDMETHODCALLTYPE GetDesc( + D3D12_COMMAND_QUEUE_DESC *__ret) = 0; + D3D12_COMMAND_QUEUE_DESC STDMETHODCALLTYPE GetDesc( + ) + { + D3D12_COMMAND_QUEUE_DESC __ret; + return *GetDesc(&__ret); + } +#else + virtual D3D12_COMMAND_QUEUE_DESC STDMETHODCALLTYPE GetDesc( + ) = 0; +#endif + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12CommandQueue, 0x0ec870a6, 0x5d7e, 0x4c22, 0x8c,0xfc, 0x5b,0xaa,0xe0,0x76,0x16,0xed) +#endif +#else +typedef struct ID3D12CommandQueueVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12CommandQueue *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12CommandQueue *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12CommandQueue *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12CommandQueue *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12CommandQueue *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12CommandQueue *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12CommandQueue *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12CommandQueue *This, + REFIID riid, + void **device); + + /*** ID3D12CommandQueue methods ***/ + void (STDMETHODCALLTYPE *UpdateTileMappings)( + ID3D12CommandQueue *This, + ID3D12Resource *resource, + UINT region_count, + const D3D12_TILED_RESOURCE_COORDINATE *region_start_coordinates, + const D3D12_TILE_REGION_SIZE *region_sizes, + UINT range_count, + const D3D12_TILE_RANGE_FLAGS *range_flags, + UINT *heap_range_offsets, + UINT *range_tile_counts, + D3D12_TILE_MAPPING_FLAGS flags); + + void (STDMETHODCALLTYPE *CopyTileMappings)( + ID3D12CommandQueue *This, + ID3D12Resource *dst_resource, + const D3D12_TILED_RESOURCE_COORDINATE *dst_region_start_coordinate, + ID3D12Resource *src_resource, + const D3D12_TILED_RESOURCE_COORDINATE *src_region_start_coordinate, + const D3D12_TILE_REGION_SIZE *region_size, + D3D12_TILE_MAPPING_FLAGS flags); + + void (STDMETHODCALLTYPE *ExecuteCommandLists)( + ID3D12CommandQueue *This, + UINT command_list_count, + ID3D12CommandList *const *command_lists); + + void (STDMETHODCALLTYPE *SetMarker)( + ID3D12CommandQueue *This, + UINT metadata, + const void *data, + UINT size); + + void (STDMETHODCALLTYPE *BeginEvent)( + ID3D12CommandQueue *This, + UINT metadata, + const void *data, + UINT size); + + void (STDMETHODCALLTYPE *EndEvent)( + ID3D12CommandQueue *This); + + HRESULT (STDMETHODCALLTYPE *Signal)( + ID3D12CommandQueue *This, + ID3D12Fence *fence, + UINT64 value); + + HRESULT (STDMETHODCALLTYPE *Wait)( + ID3D12CommandQueue *This, + ID3D12Fence *fence, + UINT64 value); + + HRESULT (STDMETHODCALLTYPE *GetTimestampFrequency)( + ID3D12CommandQueue *This, + UINT64 *frequency); + + HRESULT (STDMETHODCALLTYPE *GetClockCalibration)( + ID3D12CommandQueue *This, + UINT64 *gpu_timestamp, + UINT64 *cpu_timestamp); + + D3D12_COMMAND_QUEUE_DESC * (STDMETHODCALLTYPE *GetDesc)( + ID3D12CommandQueue *This, + D3D12_COMMAND_QUEUE_DESC *__ret); + + END_INTERFACE +} ID3D12CommandQueueVtbl; + +interface ID3D12CommandQueue { + CONST_VTBL ID3D12CommandQueueVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12CommandQueue_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12CommandQueue_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12CommandQueue_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12CommandQueue_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12CommandQueue_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12CommandQueue_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12CommandQueue_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12CommandQueue_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +/*** ID3D12CommandQueue methods ***/ +#define ID3D12CommandQueue_UpdateTileMappings(This,resource,region_count,region_start_coordinates,region_sizes,range_count,range_flags,heap_range_offsets,range_tile_counts,flags) (This)->lpVtbl->UpdateTileMappings(This,resource,region_count,region_start_coordinates,region_sizes,range_count,range_flags,heap_range_offsets,range_tile_counts,flags) +#define ID3D12CommandQueue_CopyTileMappings(This,dst_resource,dst_region_start_coordinate,src_resource,src_region_start_coordinate,region_size,flags) (This)->lpVtbl->CopyTileMappings(This,dst_resource,dst_region_start_coordinate,src_resource,src_region_start_coordinate,region_size,flags) +#define ID3D12CommandQueue_ExecuteCommandLists(This,command_list_count,command_lists) (This)->lpVtbl->ExecuteCommandLists(This,command_list_count,command_lists) +#define ID3D12CommandQueue_SetMarker(This,metadata,data,size) (This)->lpVtbl->SetMarker(This,metadata,data,size) +#define ID3D12CommandQueue_BeginEvent(This,metadata,data,size) (This)->lpVtbl->BeginEvent(This,metadata,data,size) +#define ID3D12CommandQueue_EndEvent(This) (This)->lpVtbl->EndEvent(This) +#define ID3D12CommandQueue_Signal(This,fence,value) (This)->lpVtbl->Signal(This,fence,value) +#define ID3D12CommandQueue_Wait(This,fence,value) (This)->lpVtbl->Wait(This,fence,value) +#define ID3D12CommandQueue_GetTimestampFrequency(This,frequency) (This)->lpVtbl->GetTimestampFrequency(This,frequency) +#define ID3D12CommandQueue_GetClockCalibration(This,gpu_timestamp,cpu_timestamp) (This)->lpVtbl->GetClockCalibration(This,gpu_timestamp,cpu_timestamp) +#define ID3D12CommandQueue_GetDesc(This) ID3D12CommandQueue_GetDesc_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12CommandQueue_QueryInterface(ID3D12CommandQueue* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12CommandQueue_AddRef(ID3D12CommandQueue* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12CommandQueue_Release(ID3D12CommandQueue* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12CommandQueue_GetPrivateData(ID3D12CommandQueue* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12CommandQueue_SetPrivateData(ID3D12CommandQueue* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12CommandQueue_SetPrivateDataInterface(ID3D12CommandQueue* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12CommandQueue_SetName(ID3D12CommandQueue* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12CommandQueue_GetDevice(ID3D12CommandQueue* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +/*** ID3D12CommandQueue methods ***/ +static FORCEINLINE void ID3D12CommandQueue_UpdateTileMappings(ID3D12CommandQueue* This,ID3D12Resource *resource,UINT region_count,const D3D12_TILED_RESOURCE_COORDINATE *region_start_coordinates,const D3D12_TILE_REGION_SIZE *region_sizes,UINT range_count,const D3D12_TILE_RANGE_FLAGS *range_flags,UINT *heap_range_offsets,UINT *range_tile_counts,D3D12_TILE_MAPPING_FLAGS flags) { + This->lpVtbl->UpdateTileMappings(This,resource,region_count,region_start_coordinates,region_sizes,range_count,range_flags,heap_range_offsets,range_tile_counts,flags); +} +static FORCEINLINE void ID3D12CommandQueue_CopyTileMappings(ID3D12CommandQueue* This,ID3D12Resource *dst_resource,const D3D12_TILED_RESOURCE_COORDINATE *dst_region_start_coordinate,ID3D12Resource *src_resource,const D3D12_TILED_RESOURCE_COORDINATE *src_region_start_coordinate,const D3D12_TILE_REGION_SIZE *region_size,D3D12_TILE_MAPPING_FLAGS flags) { + This->lpVtbl->CopyTileMappings(This,dst_resource,dst_region_start_coordinate,src_resource,src_region_start_coordinate,region_size,flags); +} +static FORCEINLINE void ID3D12CommandQueue_ExecuteCommandLists(ID3D12CommandQueue* This,UINT command_list_count,ID3D12CommandList *const *command_lists) { + This->lpVtbl->ExecuteCommandLists(This,command_list_count,command_lists); +} +static FORCEINLINE void ID3D12CommandQueue_SetMarker(ID3D12CommandQueue* This,UINT metadata,const void *data,UINT size) { + This->lpVtbl->SetMarker(This,metadata,data,size); +} +static FORCEINLINE void ID3D12CommandQueue_BeginEvent(ID3D12CommandQueue* This,UINT metadata,const void *data,UINT size) { + This->lpVtbl->BeginEvent(This,metadata,data,size); +} +static FORCEINLINE void ID3D12CommandQueue_EndEvent(ID3D12CommandQueue* This) { + This->lpVtbl->EndEvent(This); +} +static FORCEINLINE HRESULT ID3D12CommandQueue_Signal(ID3D12CommandQueue* This,ID3D12Fence *fence,UINT64 value) { + return This->lpVtbl->Signal(This,fence,value); +} +static FORCEINLINE HRESULT ID3D12CommandQueue_Wait(ID3D12CommandQueue* This,ID3D12Fence *fence,UINT64 value) { + return This->lpVtbl->Wait(This,fence,value); +} +static FORCEINLINE HRESULT ID3D12CommandQueue_GetTimestampFrequency(ID3D12CommandQueue* This,UINT64 *frequency) { + return This->lpVtbl->GetTimestampFrequency(This,frequency); +} +static FORCEINLINE HRESULT ID3D12CommandQueue_GetClockCalibration(ID3D12CommandQueue* This,UINT64 *gpu_timestamp,UINT64 *cpu_timestamp) { + return This->lpVtbl->GetClockCalibration(This,gpu_timestamp,cpu_timestamp); +} +static FORCEINLINE D3D12_COMMAND_QUEUE_DESC ID3D12CommandQueue_GetDesc(ID3D12CommandQueue* This) { + D3D12_COMMAND_QUEUE_DESC __ret; + return *This->lpVtbl->GetDesc(This,&__ret); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12CommandQueue_INTERFACE_DEFINED__ */ + +typedef enum D3D12_FENCE_FLAGS { + D3D12_FENCE_FLAG_NONE = 0x0, + D3D12_FENCE_FLAG_SHARED = 0x1, + D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x2 +} D3D12_FENCE_FLAGS; +typedef enum D3D12_QUERY_HEAP_TYPE { + D3D12_QUERY_HEAP_TYPE_OCCLUSION = 0, + D3D12_QUERY_HEAP_TYPE_TIMESTAMP = 1, + D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS = 2, + D3D12_QUERY_HEAP_TYPE_SO_STATISTICS = 3 +} D3D12_QUERY_HEAP_TYPE; +typedef struct D3D12_QUERY_HEAP_DESC { + D3D12_QUERY_HEAP_TYPE Type; + UINT Count; + UINT NodeMask; +} D3D12_QUERY_HEAP_DESC; +typedef enum D3D12_INDIRECT_ARGUMENT_TYPE { + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW = 0, + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED = 1, + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH = 2, + D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW = 3, + D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW = 4, + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT = 5, + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW = 6, + D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW = 7, + D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW = 8 +} D3D12_INDIRECT_ARGUMENT_TYPE; +typedef struct D3D12_INDIRECT_ARGUMENT_DESC { + D3D12_INDIRECT_ARGUMENT_TYPE Type; + __C89_NAMELESS union { + struct { + UINT Slot; + } VertexBuffer; + struct { + UINT RootParameterIndex; + UINT DestOffsetIn32BitValues; + UINT Num32BitValuesToSet; + } Constant; + struct { + UINT RootParameterIndex; + } ConstantBufferView; + struct { + UINT RootParameterIndex; + } ShaderResourceView; + struct { + UINT RootParameterIndex; + } UnorderedAccessView; + } __C89_NAMELESSUNIONNAME; +} D3D12_INDIRECT_ARGUMENT_DESC; +typedef struct D3D12_COMMAND_SIGNATURE_DESC { + UINT ByteStride; + UINT NumArgumentDescs; + const D3D12_INDIRECT_ARGUMENT_DESC *pArgumentDescs; + UINT NodeMask; +} D3D12_COMMAND_SIGNATURE_DESC; +/***************************************************************************** + * ID3D12RootSignature interface + */ +#ifndef __ID3D12RootSignature_INTERFACE_DEFINED__ +#define __ID3D12RootSignature_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12RootSignature, 0xc54a6b66, 0x72df, 0x4ee8, 0x8b,0xe5, 0xa9,0x46,0xa1,0x42,0x92,0x14); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("c54a6b66-72df-4ee8-8be5-a946a1429214") +ID3D12RootSignature : public ID3D12DeviceChild +{ +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12RootSignature, 0xc54a6b66, 0x72df, 0x4ee8, 0x8b,0xe5, 0xa9,0x46,0xa1,0x42,0x92,0x14) +#endif +#else +typedef struct ID3D12RootSignatureVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12RootSignature *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12RootSignature *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12RootSignature *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12RootSignature *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12RootSignature *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12RootSignature *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12RootSignature *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12RootSignature *This, + REFIID riid, + void **device); + + END_INTERFACE +} ID3D12RootSignatureVtbl; + +interface ID3D12RootSignature { + CONST_VTBL ID3D12RootSignatureVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12RootSignature_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12RootSignature_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12RootSignature_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12RootSignature_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12RootSignature_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12RootSignature_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12RootSignature_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12RootSignature_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12RootSignature_QueryInterface(ID3D12RootSignature* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12RootSignature_AddRef(ID3D12RootSignature* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12RootSignature_Release(ID3D12RootSignature* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12RootSignature_GetPrivateData(ID3D12RootSignature* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12RootSignature_SetPrivateData(ID3D12RootSignature* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12RootSignature_SetPrivateDataInterface(ID3D12RootSignature* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12RootSignature_SetName(ID3D12RootSignature* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12RootSignature_GetDevice(ID3D12RootSignature* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12RootSignature_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12PipelineState interface + */ +#ifndef __ID3D12PipelineState_INTERFACE_DEFINED__ +#define __ID3D12PipelineState_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12PipelineState, 0x765a30f3, 0xf624, 0x4c6f, 0xa8,0x28, 0xac,0xe9,0x48,0x62,0x24,0x45); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("765a30f3-f624-4c6f-a828-ace948622445") +ID3D12PipelineState : public ID3D12Pageable +{ + virtual HRESULT STDMETHODCALLTYPE GetCachedBlob( + ID3DBlob **blob) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12PipelineState, 0x765a30f3, 0xf624, 0x4c6f, 0xa8,0x28, 0xac,0xe9,0x48,0x62,0x24,0x45) +#endif +#else +typedef struct ID3D12PipelineStateVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12PipelineState *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12PipelineState *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12PipelineState *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12PipelineState *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12PipelineState *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12PipelineState *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12PipelineState *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12PipelineState *This, + REFIID riid, + void **device); + + /*** ID3D12PipelineState methods ***/ + HRESULT (STDMETHODCALLTYPE *GetCachedBlob)( + ID3D12PipelineState *This, + ID3DBlob **blob); + + END_INTERFACE +} ID3D12PipelineStateVtbl; + +interface ID3D12PipelineState { + CONST_VTBL ID3D12PipelineStateVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12PipelineState_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12PipelineState_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12PipelineState_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12PipelineState_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12PipelineState_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12PipelineState_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12PipelineState_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12PipelineState_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +/*** ID3D12PipelineState methods ***/ +#define ID3D12PipelineState_GetCachedBlob(This,blob) (This)->lpVtbl->GetCachedBlob(This,blob) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12PipelineState_QueryInterface(ID3D12PipelineState* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12PipelineState_AddRef(ID3D12PipelineState* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12PipelineState_Release(ID3D12PipelineState* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12PipelineState_GetPrivateData(ID3D12PipelineState* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12PipelineState_SetPrivateData(ID3D12PipelineState* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12PipelineState_SetPrivateDataInterface(ID3D12PipelineState* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12PipelineState_SetName(ID3D12PipelineState* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12PipelineState_GetDevice(ID3D12PipelineState* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +/*** ID3D12PipelineState methods ***/ +static FORCEINLINE HRESULT ID3D12PipelineState_GetCachedBlob(ID3D12PipelineState* This,ID3DBlob **blob) { + return This->lpVtbl->GetCachedBlob(This,blob); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12PipelineState_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12Fence interface + */ +#ifndef __ID3D12Fence_INTERFACE_DEFINED__ +#define __ID3D12Fence_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12Fence, 0x0a753dcf, 0xc4d8, 0x4b91, 0xad,0xf6, 0xbe,0x5a,0x60,0xd9,0x5a,0x76); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("0a753dcf-c4d8-4b91-adf6-be5a60d95a76") +ID3D12Fence : public ID3D12Pageable +{ + virtual UINT64 STDMETHODCALLTYPE GetCompletedValue( + ) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetEventOnCompletion( + UINT64 value, + HANDLE event) = 0; + + virtual HRESULT STDMETHODCALLTYPE Signal( + UINT64 value) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12Fence, 0x0a753dcf, 0xc4d8, 0x4b91, 0xad,0xf6, 0xbe,0x5a,0x60,0xd9,0x5a,0x76) +#endif +#else +typedef struct ID3D12FenceVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12Fence *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12Fence *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12Fence *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12Fence *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12Fence *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12Fence *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12Fence *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12Fence *This, + REFIID riid, + void **device); + + /*** ID3D12Fence methods ***/ + UINT64 (STDMETHODCALLTYPE *GetCompletedValue)( + ID3D12Fence *This); + + HRESULT (STDMETHODCALLTYPE *SetEventOnCompletion)( + ID3D12Fence *This, + UINT64 value, + HANDLE event); + + HRESULT (STDMETHODCALLTYPE *Signal)( + ID3D12Fence *This, + UINT64 value); + + END_INTERFACE +} ID3D12FenceVtbl; + +interface ID3D12Fence { + CONST_VTBL ID3D12FenceVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12Fence_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12Fence_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12Fence_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12Fence_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12Fence_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12Fence_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12Fence_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12Fence_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +/*** ID3D12Fence methods ***/ +#define ID3D12Fence_GetCompletedValue(This) (This)->lpVtbl->GetCompletedValue(This) +#define ID3D12Fence_SetEventOnCompletion(This,value,event) (This)->lpVtbl->SetEventOnCompletion(This,value,event) +#define ID3D12Fence_Signal(This,value) (This)->lpVtbl->Signal(This,value) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12Fence_QueryInterface(ID3D12Fence* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12Fence_AddRef(ID3D12Fence* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12Fence_Release(ID3D12Fence* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12Fence_GetPrivateData(ID3D12Fence* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Fence_SetPrivateData(ID3D12Fence* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Fence_SetPrivateDataInterface(ID3D12Fence* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12Fence_SetName(ID3D12Fence* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12Fence_GetDevice(ID3D12Fence* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +/*** ID3D12Fence methods ***/ +static FORCEINLINE UINT64 ID3D12Fence_GetCompletedValue(ID3D12Fence* This) { + return This->lpVtbl->GetCompletedValue(This); +} +static FORCEINLINE HRESULT ID3D12Fence_SetEventOnCompletion(ID3D12Fence* This,UINT64 value,HANDLE event) { + return This->lpVtbl->SetEventOnCompletion(This,value,event); +} +static FORCEINLINE HRESULT ID3D12Fence_Signal(ID3D12Fence* This,UINT64 value) { + return This->lpVtbl->Signal(This,value); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12Fence_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12CommandAllocator interface + */ +#ifndef __ID3D12CommandAllocator_INTERFACE_DEFINED__ +#define __ID3D12CommandAllocator_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12CommandAllocator, 0x6102dee4, 0xaf59, 0x4b09, 0xb9,0x99, 0xb4,0x4d,0x73,0xf0,0x9b,0x24); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("6102dee4-af59-4b09-b999-b44d73f09b24") +ID3D12CommandAllocator : public ID3D12Pageable +{ + virtual HRESULT STDMETHODCALLTYPE Reset( + ) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12CommandAllocator, 0x6102dee4, 0xaf59, 0x4b09, 0xb9,0x99, 0xb4,0x4d,0x73,0xf0,0x9b,0x24) +#endif +#else +typedef struct ID3D12CommandAllocatorVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12CommandAllocator *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12CommandAllocator *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12CommandAllocator *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12CommandAllocator *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12CommandAllocator *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12CommandAllocator *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12CommandAllocator *This, + const WCHAR *name); + + /*** ID3D12DeviceChild methods ***/ + HRESULT (STDMETHODCALLTYPE *GetDevice)( + ID3D12CommandAllocator *This, + REFIID riid, + void **device); + + /*** ID3D12CommandAllocator methods ***/ + HRESULT (STDMETHODCALLTYPE *Reset)( + ID3D12CommandAllocator *This); + + END_INTERFACE +} ID3D12CommandAllocatorVtbl; + +interface ID3D12CommandAllocator { + CONST_VTBL ID3D12CommandAllocatorVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12CommandAllocator_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12CommandAllocator_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12CommandAllocator_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12CommandAllocator_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12CommandAllocator_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12CommandAllocator_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12CommandAllocator_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12DeviceChild methods ***/ +#define ID3D12CommandAllocator_GetDevice(This,riid,device) (This)->lpVtbl->GetDevice(This,riid,device) +/*** ID3D12CommandAllocator methods ***/ +#define ID3D12CommandAllocator_Reset(This) (This)->lpVtbl->Reset(This) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12CommandAllocator_QueryInterface(ID3D12CommandAllocator* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12CommandAllocator_AddRef(ID3D12CommandAllocator* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12CommandAllocator_Release(ID3D12CommandAllocator* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12CommandAllocator_GetPrivateData(ID3D12CommandAllocator* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12CommandAllocator_SetPrivateData(ID3D12CommandAllocator* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12CommandAllocator_SetPrivateDataInterface(ID3D12CommandAllocator* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12CommandAllocator_SetName(ID3D12CommandAllocator* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12DeviceChild methods ***/ +static FORCEINLINE HRESULT ID3D12CommandAllocator_GetDevice(ID3D12CommandAllocator* This,REFIID riid,void **device) { + return This->lpVtbl->GetDevice(This,riid,device); +} +/*** ID3D12CommandAllocator methods ***/ +static FORCEINLINE HRESULT ID3D12CommandAllocator_Reset(ID3D12CommandAllocator* This) { + return This->lpVtbl->Reset(This); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12CommandAllocator_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12Device interface + */ +#ifndef __ID3D12Device_INTERFACE_DEFINED__ +#define __ID3D12Device_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12Device, 0x189819f1, 0x1db6, 0x4b57, 0xbe,0x54, 0x18,0x21,0x33,0x9b,0x85,0xf7); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("189819f1-1db6-4b57-be54-1821339b85f7") +ID3D12Device : public ID3D12Object +{ + virtual UINT STDMETHODCALLTYPE GetNodeCount( + ) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandQueue( + const D3D12_COMMAND_QUEUE_DESC *desc, + REFIID riid, + void **command_queue) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandAllocator( + D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + void **command_allocator) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGraphicsPipelineState( + const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc, + REFIID riid, + void **pipeline_state) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateComputePipelineState( + const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, + REFIID riid, + void **pipeline_state) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandList( + UINT node_mask, + D3D12_COMMAND_LIST_TYPE type, + ID3D12CommandAllocator *command_allocator, + ID3D12PipelineState *initial_pipeline_state, + REFIID riid, + void **command_list) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( + D3D12_FEATURE feature, + void *feature_data, + UINT feature_data_size) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDescriptorHeap( + const D3D12_DESCRIPTOR_HEAP_DESC *desc, + REFIID riid, + void **descriptor_heap) = 0; + + virtual UINT STDMETHODCALLTYPE GetDescriptorHandleIncrementSize( + D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRootSignature( + UINT node_mask, + const void *bytecode, + SIZE_T bytecode_length, + REFIID riid, + void **root_signature) = 0; + + virtual void STDMETHODCALLTYPE CreateConstantBufferView( + const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateShaderResourceView( + ID3D12Resource *resource, + const D3D12_SHADER_RESOURCE_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateUnorderedAccessView( + ID3D12Resource *resource, + ID3D12Resource *counter_resource, + const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateRenderTargetView( + ID3D12Resource *resource, + const D3D12_RENDER_TARGET_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateDepthStencilView( + ID3D12Resource *resource, + const D3D12_DEPTH_STENCIL_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateSampler( + const D3D12_SAMPLER_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor) = 0; + + virtual void STDMETHODCALLTYPE CopyDescriptors( + UINT dst_descriptor_range_count, + const D3D12_CPU_DESCRIPTOR_HANDLE *dst_descriptor_range_offsets, + const UINT *dst_descriptor_range_sizes, + UINT src_descriptor_range_count, + const D3D12_CPU_DESCRIPTOR_HANDLE *src_descriptor_range_offsets, + const UINT *src_descriptor_range_sizes, + D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) = 0; + + virtual void STDMETHODCALLTYPE CopyDescriptorsSimple( + UINT descriptor_count, + const D3D12_CPU_DESCRIPTOR_HANDLE dst_descriptor_range_offset, + const D3D12_CPU_DESCRIPTOR_HANDLE src_descriptor_range_offset, + D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) = 0; + +#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS + virtual D3D12_RESOURCE_ALLOCATION_INFO* STDMETHODCALLTYPE GetResourceAllocationInfo( + D3D12_RESOURCE_ALLOCATION_INFO *__ret, + UINT visible_mask, + UINT reource_desc_count, + const D3D12_RESOURCE_DESC *resource_descs) = 0; + D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo( + UINT visible_mask, + UINT reource_desc_count, + const D3D12_RESOURCE_DESC *resource_descs) + { + D3D12_RESOURCE_ALLOCATION_INFO __ret; + return *GetResourceAllocationInfo(&__ret, visible_mask, reource_desc_count, resource_descs); + } +#else + virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo( + UINT visible_mask, + UINT reource_desc_count, + const D3D12_RESOURCE_DESC *resource_descs) = 0; +#endif + +#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS + virtual D3D12_HEAP_PROPERTIES* STDMETHODCALLTYPE GetCustomHeapProperties( + D3D12_HEAP_PROPERTIES *__ret, + UINT node_mask, + D3D12_HEAP_TYPE heap_type) = 0; + D3D12_HEAP_PROPERTIES STDMETHODCALLTYPE GetCustomHeapProperties( + UINT node_mask, + D3D12_HEAP_TYPE heap_type) + { + D3D12_HEAP_PROPERTIES __ret; + return *GetCustomHeapProperties(&__ret, node_mask, heap_type); + } +#else + virtual D3D12_HEAP_PROPERTIES STDMETHODCALLTYPE GetCustomHeapProperties( + UINT node_mask, + D3D12_HEAP_TYPE heap_type) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource( + const D3D12_HEAP_PROPERTIES *heap_properties, + D3D12_HEAP_FLAGS heap_flags, + const D3D12_RESOURCE_DESC *desc, + D3D12_RESOURCE_STATES initial_state, + const D3D12_CLEAR_VALUE *optimized_clear_value, + REFIID riid, + void **resource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateHeap( + const D3D12_HEAP_DESC *desc, + REFIID riid, + void **heap) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource( + ID3D12Heap *heap, + UINT64 heap_offset, + const D3D12_RESOURCE_DESC *desc, + D3D12_RESOURCE_STATES initial_state, + const D3D12_CLEAR_VALUE *optimized_clear_value, + REFIID riid, + void **resource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateReservedResource( + const D3D12_RESOURCE_DESC *desc, + D3D12_RESOURCE_STATES initial_state, + const D3D12_CLEAR_VALUE *optimized_clear_value, + REFIID riid, + void **resource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSharedHandle( + ID3D12DeviceChild *object, + const SECURITY_ATTRIBUTES *attributes, + DWORD access, + const WCHAR *name, + HANDLE *handle) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedHandle( + HANDLE handle, + REFIID riid, + void **object) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedHandleByName( + const WCHAR *name, + DWORD access, + HANDLE *handle) = 0; + + virtual HRESULT STDMETHODCALLTYPE MakeResident( + UINT object_count, + ID3D12Pageable *const *objects) = 0; + + virtual HRESULT STDMETHODCALLTYPE Evict( + UINT object_count, + ID3D12Pageable *const *objects) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateFence( + UINT64 initial_value, + D3D12_FENCE_FLAGS flags, + REFIID riid, + void **fence) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( + ) = 0; + + virtual void STDMETHODCALLTYPE GetCopyableFootprints( + const D3D12_RESOURCE_DESC *desc, + UINT first_sub_resource, + UINT sub_resource_count, + UINT64 base_offset, + D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, + UINT *row_count, + UINT64 *row_size, + UINT64 *total_bytes) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateQueryHeap( + const D3D12_QUERY_HEAP_DESC *desc, + REFIID riid, + void **heap) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetStablePowerState( + BOOL enable) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandSignature( + const D3D12_COMMAND_SIGNATURE_DESC *desc, + ID3D12RootSignature *root_signature, + REFIID riid, + void **command_signature) = 0; + + virtual void STDMETHODCALLTYPE GetResourceTiling( + ID3D12Resource *resource, + UINT *total_tile_count, + D3D12_PACKED_MIP_INFO *packed_mip_info, + D3D12_TILE_SHAPE *standard_tile_shape, + UINT *sub_resource_tiling_count, + UINT first_sub_resource_tiling, + D3D12_SUBRESOURCE_TILING *sub_resource_tilings) = 0; + +#ifdef WIDL_EXPLICIT_AGGREGATE_RETURNS + virtual LUID* STDMETHODCALLTYPE GetAdapterLuid( + LUID *__ret) = 0; + LUID STDMETHODCALLTYPE GetAdapterLuid( + ) + { + LUID __ret; + return *GetAdapterLuid(&__ret); + } +#else + virtual LUID STDMETHODCALLTYPE GetAdapterLuid( + ) = 0; +#endif + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12Device, 0x189819f1, 0x1db6, 0x4b57, 0xbe,0x54, 0x18,0x21,0x33,0x9b,0x85,0xf7) +#endif +#else +typedef struct ID3D12DeviceVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12Device *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12Device *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12Device *This); + + /*** ID3D12Object methods ***/ + HRESULT (STDMETHODCALLTYPE *GetPrivateData)( + ID3D12Device *This, + REFGUID guid, + UINT *data_size, + void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateData)( + ID3D12Device *This, + REFGUID guid, + UINT data_size, + const void *data); + + HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)( + ID3D12Device *This, + REFGUID guid, + const IUnknown *data); + + HRESULT (STDMETHODCALLTYPE *SetName)( + ID3D12Device *This, + const WCHAR *name); + + /*** ID3D12Device methods ***/ + UINT (STDMETHODCALLTYPE *GetNodeCount)( + ID3D12Device *This); + + HRESULT (STDMETHODCALLTYPE *CreateCommandQueue)( + ID3D12Device *This, + const D3D12_COMMAND_QUEUE_DESC *desc, + REFIID riid, + void **command_queue); + + HRESULT (STDMETHODCALLTYPE *CreateCommandAllocator)( + ID3D12Device *This, + D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + void **command_allocator); + + HRESULT (STDMETHODCALLTYPE *CreateGraphicsPipelineState)( + ID3D12Device *This, + const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc, + REFIID riid, + void **pipeline_state); + + HRESULT (STDMETHODCALLTYPE *CreateComputePipelineState)( + ID3D12Device *This, + const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, + REFIID riid, + void **pipeline_state); + + HRESULT (STDMETHODCALLTYPE *CreateCommandList)( + ID3D12Device *This, + UINT node_mask, + D3D12_COMMAND_LIST_TYPE type, + ID3D12CommandAllocator *command_allocator, + ID3D12PipelineState *initial_pipeline_state, + REFIID riid, + void **command_list); + + HRESULT (STDMETHODCALLTYPE *CheckFeatureSupport)( + ID3D12Device *This, + D3D12_FEATURE feature, + void *feature_data, + UINT feature_data_size); + + HRESULT (STDMETHODCALLTYPE *CreateDescriptorHeap)( + ID3D12Device *This, + const D3D12_DESCRIPTOR_HEAP_DESC *desc, + REFIID riid, + void **descriptor_heap); + + UINT (STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize)( + ID3D12Device *This, + D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type); + + HRESULT (STDMETHODCALLTYPE *CreateRootSignature)( + ID3D12Device *This, + UINT node_mask, + const void *bytecode, + SIZE_T bytecode_length, + REFIID riid, + void **root_signature); + + void (STDMETHODCALLTYPE *CreateConstantBufferView)( + ID3D12Device *This, + const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor); + + void (STDMETHODCALLTYPE *CreateShaderResourceView)( + ID3D12Device *This, + ID3D12Resource *resource, + const D3D12_SHADER_RESOURCE_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor); + + void (STDMETHODCALLTYPE *CreateUnorderedAccessView)( + ID3D12Device *This, + ID3D12Resource *resource, + ID3D12Resource *counter_resource, + const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor); + + void (STDMETHODCALLTYPE *CreateRenderTargetView)( + ID3D12Device *This, + ID3D12Resource *resource, + const D3D12_RENDER_TARGET_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor); + + void (STDMETHODCALLTYPE *CreateDepthStencilView)( + ID3D12Device *This, + ID3D12Resource *resource, + const D3D12_DEPTH_STENCIL_VIEW_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor); + + void (STDMETHODCALLTYPE *CreateSampler)( + ID3D12Device *This, + const D3D12_SAMPLER_DESC *desc, + D3D12_CPU_DESCRIPTOR_HANDLE descriptor); + + void (STDMETHODCALLTYPE *CopyDescriptors)( + ID3D12Device *This, + UINT dst_descriptor_range_count, + const D3D12_CPU_DESCRIPTOR_HANDLE *dst_descriptor_range_offsets, + const UINT *dst_descriptor_range_sizes, + UINT src_descriptor_range_count, + const D3D12_CPU_DESCRIPTOR_HANDLE *src_descriptor_range_offsets, + const UINT *src_descriptor_range_sizes, + D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type); + + void (STDMETHODCALLTYPE *CopyDescriptorsSimple)( + ID3D12Device *This, + UINT descriptor_count, + const D3D12_CPU_DESCRIPTOR_HANDLE dst_descriptor_range_offset, + const D3D12_CPU_DESCRIPTOR_HANDLE src_descriptor_range_offset, + D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type); + + D3D12_RESOURCE_ALLOCATION_INFO * (STDMETHODCALLTYPE *GetResourceAllocationInfo)( + ID3D12Device *This, + D3D12_RESOURCE_ALLOCATION_INFO *__ret, + UINT visible_mask, + UINT reource_desc_count, + const D3D12_RESOURCE_DESC *resource_descs); + + D3D12_HEAP_PROPERTIES * (STDMETHODCALLTYPE *GetCustomHeapProperties)( + ID3D12Device *This, + D3D12_HEAP_PROPERTIES *__ret, + UINT node_mask, + D3D12_HEAP_TYPE heap_type); + + HRESULT (STDMETHODCALLTYPE *CreateCommittedResource)( + ID3D12Device *This, + const D3D12_HEAP_PROPERTIES *heap_properties, + D3D12_HEAP_FLAGS heap_flags, + const D3D12_RESOURCE_DESC *desc, + D3D12_RESOURCE_STATES initial_state, + const D3D12_CLEAR_VALUE *optimized_clear_value, + REFIID riid, + void **resource); + + HRESULT (STDMETHODCALLTYPE *CreateHeap)( + ID3D12Device *This, + const D3D12_HEAP_DESC *desc, + REFIID riid, + void **heap); + + HRESULT (STDMETHODCALLTYPE *CreatePlacedResource)( + ID3D12Device *This, + ID3D12Heap *heap, + UINT64 heap_offset, + const D3D12_RESOURCE_DESC *desc, + D3D12_RESOURCE_STATES initial_state, + const D3D12_CLEAR_VALUE *optimized_clear_value, + REFIID riid, + void **resource); + + HRESULT (STDMETHODCALLTYPE *CreateReservedResource)( + ID3D12Device *This, + const D3D12_RESOURCE_DESC *desc, + D3D12_RESOURCE_STATES initial_state, + const D3D12_CLEAR_VALUE *optimized_clear_value, + REFIID riid, + void **resource); + + HRESULT (STDMETHODCALLTYPE *CreateSharedHandle)( + ID3D12Device *This, + ID3D12DeviceChild *object, + const SECURITY_ATTRIBUTES *attributes, + DWORD access, + const WCHAR *name, + HANDLE *handle); + + HRESULT (STDMETHODCALLTYPE *OpenSharedHandle)( + ID3D12Device *This, + HANDLE handle, + REFIID riid, + void **object); + + HRESULT (STDMETHODCALLTYPE *OpenSharedHandleByName)( + ID3D12Device *This, + const WCHAR *name, + DWORD access, + HANDLE *handle); + + HRESULT (STDMETHODCALLTYPE *MakeResident)( + ID3D12Device *This, + UINT object_count, + ID3D12Pageable *const *objects); + + HRESULT (STDMETHODCALLTYPE *Evict)( + ID3D12Device *This, + UINT object_count, + ID3D12Pageable *const *objects); + + HRESULT (STDMETHODCALLTYPE *CreateFence)( + ID3D12Device *This, + UINT64 initial_value, + D3D12_FENCE_FLAGS flags, + REFIID riid, + void **fence); + + HRESULT (STDMETHODCALLTYPE *GetDeviceRemovedReason)( + ID3D12Device *This); + + void (STDMETHODCALLTYPE *GetCopyableFootprints)( + ID3D12Device *This, + const D3D12_RESOURCE_DESC *desc, + UINT first_sub_resource, + UINT sub_resource_count, + UINT64 base_offset, + D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, + UINT *row_count, + UINT64 *row_size, + UINT64 *total_bytes); + + HRESULT (STDMETHODCALLTYPE *CreateQueryHeap)( + ID3D12Device *This, + const D3D12_QUERY_HEAP_DESC *desc, + REFIID riid, + void **heap); + + HRESULT (STDMETHODCALLTYPE *SetStablePowerState)( + ID3D12Device *This, + BOOL enable); + + HRESULT (STDMETHODCALLTYPE *CreateCommandSignature)( + ID3D12Device *This, + const D3D12_COMMAND_SIGNATURE_DESC *desc, + ID3D12RootSignature *root_signature, + REFIID riid, + void **command_signature); + + void (STDMETHODCALLTYPE *GetResourceTiling)( + ID3D12Device *This, + ID3D12Resource *resource, + UINT *total_tile_count, + D3D12_PACKED_MIP_INFO *packed_mip_info, + D3D12_TILE_SHAPE *standard_tile_shape, + UINT *sub_resource_tiling_count, + UINT first_sub_resource_tiling, + D3D12_SUBRESOURCE_TILING *sub_resource_tilings); + + LUID * (STDMETHODCALLTYPE *GetAdapterLuid)( + ID3D12Device *This, + LUID *__ret); + + END_INTERFACE +} ID3D12DeviceVtbl; + +interface ID3D12Device { + CONST_VTBL ID3D12DeviceVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12Device_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12Device_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12Device_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Object methods ***/ +#define ID3D12Device_GetPrivateData(This,guid,data_size,data) (This)->lpVtbl->GetPrivateData(This,guid,data_size,data) +#define ID3D12Device_SetPrivateData(This,guid,data_size,data) (This)->lpVtbl->SetPrivateData(This,guid,data_size,data) +#define ID3D12Device_SetPrivateDataInterface(This,guid,data) (This)->lpVtbl->SetPrivateDataInterface(This,guid,data) +#define ID3D12Device_SetName(This,name) (This)->lpVtbl->SetName(This,name) +/*** ID3D12Device methods ***/ +#define ID3D12Device_GetNodeCount(This) (This)->lpVtbl->GetNodeCount(This) +#define ID3D12Device_CreateCommandQueue(This,desc,riid,command_queue) (This)->lpVtbl->CreateCommandQueue(This,desc,riid,command_queue) +#define ID3D12Device_CreateCommandAllocator(This,type,riid,command_allocator) (This)->lpVtbl->CreateCommandAllocator(This,type,riid,command_allocator) +#define ID3D12Device_CreateGraphicsPipelineState(This,desc,riid,pipeline_state) (This)->lpVtbl->CreateGraphicsPipelineState(This,desc,riid,pipeline_state) +#define ID3D12Device_CreateComputePipelineState(This,desc,riid,pipeline_state) (This)->lpVtbl->CreateComputePipelineState(This,desc,riid,pipeline_state) +#define ID3D12Device_CreateCommandList(This,node_mask,type,command_allocator,initial_pipeline_state,riid,command_list) (This)->lpVtbl->CreateCommandList(This,node_mask,type,command_allocator,initial_pipeline_state,riid,command_list) +#define ID3D12Device_CheckFeatureSupport(This,feature,feature_data,feature_data_size) (This)->lpVtbl->CheckFeatureSupport(This,feature,feature_data,feature_data_size) +#define ID3D12Device_CreateDescriptorHeap(This,desc,riid,descriptor_heap) (This)->lpVtbl->CreateDescriptorHeap(This,desc,riid,descriptor_heap) +#define ID3D12Device_GetDescriptorHandleIncrementSize(This,descriptor_heap_type) (This)->lpVtbl->GetDescriptorHandleIncrementSize(This,descriptor_heap_type) +#define ID3D12Device_CreateRootSignature(This,node_mask,bytecode,bytecode_length,riid,root_signature) (This)->lpVtbl->CreateRootSignature(This,node_mask,bytecode,bytecode_length,riid,root_signature) +#define ID3D12Device_CreateConstantBufferView(This,desc,descriptor) (This)->lpVtbl->CreateConstantBufferView(This,desc,descriptor) +#define ID3D12Device_CreateShaderResourceView(This,resource,desc,descriptor) (This)->lpVtbl->CreateShaderResourceView(This,resource,desc,descriptor) +#define ID3D12Device_CreateUnorderedAccessView(This,resource,counter_resource,desc,descriptor) (This)->lpVtbl->CreateUnorderedAccessView(This,resource,counter_resource,desc,descriptor) +#define ID3D12Device_CreateRenderTargetView(This,resource,desc,descriptor) (This)->lpVtbl->CreateRenderTargetView(This,resource,desc,descriptor) +#define ID3D12Device_CreateDepthStencilView(This,resource,desc,descriptor) (This)->lpVtbl->CreateDepthStencilView(This,resource,desc,descriptor) +#define ID3D12Device_CreateSampler(This,desc,descriptor) (This)->lpVtbl->CreateSampler(This,desc,descriptor) +#define ID3D12Device_CopyDescriptors(This,dst_descriptor_range_count,dst_descriptor_range_offsets,dst_descriptor_range_sizes,src_descriptor_range_count,src_descriptor_range_offsets,src_descriptor_range_sizes,descriptor_heap_type) (This)->lpVtbl->CopyDescriptors(This,dst_descriptor_range_count,dst_descriptor_range_offsets,dst_descriptor_range_sizes,src_descriptor_range_count,src_descriptor_range_offsets,src_descriptor_range_sizes,descriptor_heap_type) +#define ID3D12Device_CopyDescriptorsSimple(This,descriptor_count,dst_descriptor_range_offset,src_descriptor_range_offset,descriptor_heap_type) (This)->lpVtbl->CopyDescriptorsSimple(This,descriptor_count,dst_descriptor_range_offset,src_descriptor_range_offset,descriptor_heap_type) +#define ID3D12Device_GetResourceAllocationInfo(This,visible_mask,reource_desc_count,resource_descs) ID3D12Device_GetResourceAllocationInfo_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support +#define ID3D12Device_GetCustomHeapProperties(This,node_mask,heap_type) ID3D12Device_GetCustomHeapProperties_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support +#define ID3D12Device_CreateCommittedResource(This,heap_properties,heap_flags,desc,initial_state,optimized_clear_value,riid,resource) (This)->lpVtbl->CreateCommittedResource(This,heap_properties,heap_flags,desc,initial_state,optimized_clear_value,riid,resource) +#define ID3D12Device_CreateHeap(This,desc,riid,heap) (This)->lpVtbl->CreateHeap(This,desc,riid,heap) +#define ID3D12Device_CreatePlacedResource(This,heap,heap_offset,desc,initial_state,optimized_clear_value,riid,resource) (This)->lpVtbl->CreatePlacedResource(This,heap,heap_offset,desc,initial_state,optimized_clear_value,riid,resource) +#define ID3D12Device_CreateReservedResource(This,desc,initial_state,optimized_clear_value,riid,resource) (This)->lpVtbl->CreateReservedResource(This,desc,initial_state,optimized_clear_value,riid,resource) +#define ID3D12Device_CreateSharedHandle(This,object,attributes,access,name,handle) (This)->lpVtbl->CreateSharedHandle(This,object,attributes,access,name,handle) +#define ID3D12Device_OpenSharedHandle(This,handle,riid,object) (This)->lpVtbl->OpenSharedHandle(This,handle,riid,object) +#define ID3D12Device_OpenSharedHandleByName(This,name,access,handle) (This)->lpVtbl->OpenSharedHandleByName(This,name,access,handle) +#define ID3D12Device_MakeResident(This,object_count,objects) (This)->lpVtbl->MakeResident(This,object_count,objects) +#define ID3D12Device_Evict(This,object_count,objects) (This)->lpVtbl->Evict(This,object_count,objects) +#define ID3D12Device_CreateFence(This,initial_value,flags,riid,fence) (This)->lpVtbl->CreateFence(This,initial_value,flags,riid,fence) +#define ID3D12Device_GetDeviceRemovedReason(This) (This)->lpVtbl->GetDeviceRemovedReason(This) +#define ID3D12Device_GetCopyableFootprints(This,desc,first_sub_resource,sub_resource_count,base_offset,layouts,row_count,row_size,total_bytes) (This)->lpVtbl->GetCopyableFootprints(This,desc,first_sub_resource,sub_resource_count,base_offset,layouts,row_count,row_size,total_bytes) +#define ID3D12Device_CreateQueryHeap(This,desc,riid,heap) (This)->lpVtbl->CreateQueryHeap(This,desc,riid,heap) +#define ID3D12Device_SetStablePowerState(This,enable) (This)->lpVtbl->SetStablePowerState(This,enable) +#define ID3D12Device_CreateCommandSignature(This,desc,root_signature,riid,command_signature) (This)->lpVtbl->CreateCommandSignature(This,desc,root_signature,riid,command_signature) +#define ID3D12Device_GetResourceTiling(This,resource,total_tile_count,packed_mip_info,standard_tile_shape,sub_resource_tiling_count,first_sub_resource_tiling,sub_resource_tilings) (This)->lpVtbl->GetResourceTiling(This,resource,total_tile_count,packed_mip_info,standard_tile_shape,sub_resource_tiling_count,first_sub_resource_tiling,sub_resource_tilings) +#define ID3D12Device_GetAdapterLuid(This) ID3D12Device_GetAdapterLuid_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12Device_QueryInterface(ID3D12Device* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12Device_AddRef(ID3D12Device* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12Device_Release(ID3D12Device* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Object methods ***/ +static FORCEINLINE HRESULT ID3D12Device_GetPrivateData(ID3D12Device* This,REFGUID guid,UINT *data_size,void *data) { + return This->lpVtbl->GetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Device_SetPrivateData(ID3D12Device* This,REFGUID guid,UINT data_size,const void *data) { + return This->lpVtbl->SetPrivateData(This,guid,data_size,data); +} +static FORCEINLINE HRESULT ID3D12Device_SetPrivateDataInterface(ID3D12Device* This,REFGUID guid,const IUnknown *data) { + return This->lpVtbl->SetPrivateDataInterface(This,guid,data); +} +static FORCEINLINE HRESULT ID3D12Device_SetName(ID3D12Device* This,const WCHAR *name) { + return This->lpVtbl->SetName(This,name); +} +/*** ID3D12Device methods ***/ +static FORCEINLINE UINT ID3D12Device_GetNodeCount(ID3D12Device* This) { + return This->lpVtbl->GetNodeCount(This); +} +static FORCEINLINE HRESULT ID3D12Device_CreateCommandQueue(ID3D12Device* This,const D3D12_COMMAND_QUEUE_DESC *desc,REFIID riid,void **command_queue) { + return This->lpVtbl->CreateCommandQueue(This,desc,riid,command_queue); +} +static FORCEINLINE HRESULT ID3D12Device_CreateCommandAllocator(ID3D12Device* This,D3D12_COMMAND_LIST_TYPE type,REFIID riid,void **command_allocator) { + return This->lpVtbl->CreateCommandAllocator(This,type,riid,command_allocator); +} +static FORCEINLINE HRESULT ID3D12Device_CreateGraphicsPipelineState(ID3D12Device* This,const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc,REFIID riid,void **pipeline_state) { + return This->lpVtbl->CreateGraphicsPipelineState(This,desc,riid,pipeline_state); +} +static FORCEINLINE HRESULT ID3D12Device_CreateComputePipelineState(ID3D12Device* This,const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc,REFIID riid,void **pipeline_state) { + return This->lpVtbl->CreateComputePipelineState(This,desc,riid,pipeline_state); +} +static FORCEINLINE HRESULT ID3D12Device_CreateCommandList(ID3D12Device* This,UINT node_mask,D3D12_COMMAND_LIST_TYPE type,ID3D12CommandAllocator *command_allocator,ID3D12PipelineState *initial_pipeline_state,REFIID riid,void **command_list) { + return This->lpVtbl->CreateCommandList(This,node_mask,type,command_allocator,initial_pipeline_state,riid,command_list); +} +static FORCEINLINE HRESULT ID3D12Device_CheckFeatureSupport(ID3D12Device* This,D3D12_FEATURE feature,void *feature_data,UINT feature_data_size) { + return This->lpVtbl->CheckFeatureSupport(This,feature,feature_data,feature_data_size); +} +static FORCEINLINE HRESULT ID3D12Device_CreateDescriptorHeap(ID3D12Device* This,const D3D12_DESCRIPTOR_HEAP_DESC *desc,REFIID riid,void **descriptor_heap) { + return This->lpVtbl->CreateDescriptorHeap(This,desc,riid,descriptor_heap); +} +static FORCEINLINE UINT ID3D12Device_GetDescriptorHandleIncrementSize(ID3D12Device* This,D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) { + return This->lpVtbl->GetDescriptorHandleIncrementSize(This,descriptor_heap_type); +} +static FORCEINLINE HRESULT ID3D12Device_CreateRootSignature(ID3D12Device* This,UINT node_mask,const void *bytecode,SIZE_T bytecode_length,REFIID riid,void **root_signature) { + return This->lpVtbl->CreateRootSignature(This,node_mask,bytecode,bytecode_length,riid,root_signature); +} +static FORCEINLINE void ID3D12Device_CreateConstantBufferView(ID3D12Device* This,const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc,D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { + This->lpVtbl->CreateConstantBufferView(This,desc,descriptor); +} +static FORCEINLINE void ID3D12Device_CreateShaderResourceView(ID3D12Device* This,ID3D12Resource *resource,const D3D12_SHADER_RESOURCE_VIEW_DESC *desc,D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { + This->lpVtbl->CreateShaderResourceView(This,resource,desc,descriptor); +} +static FORCEINLINE void ID3D12Device_CreateUnorderedAccessView(ID3D12Device* This,ID3D12Resource *resource,ID3D12Resource *counter_resource,const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc,D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { + This->lpVtbl->CreateUnorderedAccessView(This,resource,counter_resource,desc,descriptor); +} +static FORCEINLINE void ID3D12Device_CreateRenderTargetView(ID3D12Device* This,ID3D12Resource *resource,const D3D12_RENDER_TARGET_VIEW_DESC *desc,D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { + This->lpVtbl->CreateRenderTargetView(This,resource,desc,descriptor); +} +static FORCEINLINE void ID3D12Device_CreateDepthStencilView(ID3D12Device* This,ID3D12Resource *resource,const D3D12_DEPTH_STENCIL_VIEW_DESC *desc,D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { + This->lpVtbl->CreateDepthStencilView(This,resource,desc,descriptor); +} +static FORCEINLINE void ID3D12Device_CreateSampler(ID3D12Device* This,const D3D12_SAMPLER_DESC *desc,D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { + This->lpVtbl->CreateSampler(This,desc,descriptor); +} +static FORCEINLINE void ID3D12Device_CopyDescriptors(ID3D12Device* This,UINT dst_descriptor_range_count,const D3D12_CPU_DESCRIPTOR_HANDLE *dst_descriptor_range_offsets,const UINT *dst_descriptor_range_sizes,UINT src_descriptor_range_count,const D3D12_CPU_DESCRIPTOR_HANDLE *src_descriptor_range_offsets,const UINT *src_descriptor_range_sizes,D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) { + This->lpVtbl->CopyDescriptors(This,dst_descriptor_range_count,dst_descriptor_range_offsets,dst_descriptor_range_sizes,src_descriptor_range_count,src_descriptor_range_offsets,src_descriptor_range_sizes,descriptor_heap_type); +} +static FORCEINLINE void ID3D12Device_CopyDescriptorsSimple(ID3D12Device* This,UINT descriptor_count,const D3D12_CPU_DESCRIPTOR_HANDLE dst_descriptor_range_offset,const D3D12_CPU_DESCRIPTOR_HANDLE src_descriptor_range_offset,D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) { + This->lpVtbl->CopyDescriptorsSimple(This,descriptor_count,dst_descriptor_range_offset,src_descriptor_range_offset,descriptor_heap_type); +} +static FORCEINLINE D3D12_RESOURCE_ALLOCATION_INFO ID3D12Device_GetResourceAllocationInfo(ID3D12Device* This,UINT visible_mask,UINT reource_desc_count,const D3D12_RESOURCE_DESC *resource_descs) { + D3D12_RESOURCE_ALLOCATION_INFO __ret; + return *This->lpVtbl->GetResourceAllocationInfo(This,&__ret,visible_mask,reource_desc_count,resource_descs); +} +static FORCEINLINE D3D12_HEAP_PROPERTIES ID3D12Device_GetCustomHeapProperties(ID3D12Device* This,UINT node_mask,D3D12_HEAP_TYPE heap_type) { + D3D12_HEAP_PROPERTIES __ret; + return *This->lpVtbl->GetCustomHeapProperties(This,&__ret,node_mask,heap_type); +} +static FORCEINLINE HRESULT ID3D12Device_CreateCommittedResource(ID3D12Device* This,const D3D12_HEAP_PROPERTIES *heap_properties,D3D12_HEAP_FLAGS heap_flags,const D3D12_RESOURCE_DESC *desc,D3D12_RESOURCE_STATES initial_state,const D3D12_CLEAR_VALUE *optimized_clear_value,REFIID riid,void **resource) { + return This->lpVtbl->CreateCommittedResource(This,heap_properties,heap_flags,desc,initial_state,optimized_clear_value,riid,resource); +} +static FORCEINLINE HRESULT ID3D12Device_CreateHeap(ID3D12Device* This,const D3D12_HEAP_DESC *desc,REFIID riid,void **heap) { + return This->lpVtbl->CreateHeap(This,desc,riid,heap); +} +static FORCEINLINE HRESULT ID3D12Device_CreatePlacedResource(ID3D12Device* This,ID3D12Heap *heap,UINT64 heap_offset,const D3D12_RESOURCE_DESC *desc,D3D12_RESOURCE_STATES initial_state,const D3D12_CLEAR_VALUE *optimized_clear_value,REFIID riid,void **resource) { + return This->lpVtbl->CreatePlacedResource(This,heap,heap_offset,desc,initial_state,optimized_clear_value,riid,resource); +} +static FORCEINLINE HRESULT ID3D12Device_CreateReservedResource(ID3D12Device* This,const D3D12_RESOURCE_DESC *desc,D3D12_RESOURCE_STATES initial_state,const D3D12_CLEAR_VALUE *optimized_clear_value,REFIID riid,void **resource) { + return This->lpVtbl->CreateReservedResource(This,desc,initial_state,optimized_clear_value,riid,resource); +} +static FORCEINLINE HRESULT ID3D12Device_CreateSharedHandle(ID3D12Device* This,ID3D12DeviceChild *object,const SECURITY_ATTRIBUTES *attributes,DWORD access,const WCHAR *name,HANDLE *handle) { + return This->lpVtbl->CreateSharedHandle(This,object,attributes,access,name,handle); +} +static FORCEINLINE HRESULT ID3D12Device_OpenSharedHandle(ID3D12Device* This,HANDLE handle,REFIID riid,void **object) { + return This->lpVtbl->OpenSharedHandle(This,handle,riid,object); +} +static FORCEINLINE HRESULT ID3D12Device_OpenSharedHandleByName(ID3D12Device* This,const WCHAR *name,DWORD access,HANDLE *handle) { + return This->lpVtbl->OpenSharedHandleByName(This,name,access,handle); +} +static FORCEINLINE HRESULT ID3D12Device_MakeResident(ID3D12Device* This,UINT object_count,ID3D12Pageable *const *objects) { + return This->lpVtbl->MakeResident(This,object_count,objects); +} +static FORCEINLINE HRESULT ID3D12Device_Evict(ID3D12Device* This,UINT object_count,ID3D12Pageable *const *objects) { + return This->lpVtbl->Evict(This,object_count,objects); +} +static FORCEINLINE HRESULT ID3D12Device_CreateFence(ID3D12Device* This,UINT64 initial_value,D3D12_FENCE_FLAGS flags,REFIID riid,void **fence) { + return This->lpVtbl->CreateFence(This,initial_value,flags,riid,fence); +} +static FORCEINLINE HRESULT ID3D12Device_GetDeviceRemovedReason(ID3D12Device* This) { + return This->lpVtbl->GetDeviceRemovedReason(This); +} +static FORCEINLINE void ID3D12Device_GetCopyableFootprints(ID3D12Device* This,const D3D12_RESOURCE_DESC *desc,UINT first_sub_resource,UINT sub_resource_count,UINT64 base_offset,D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts,UINT *row_count,UINT64 *row_size,UINT64 *total_bytes) { + This->lpVtbl->GetCopyableFootprints(This,desc,first_sub_resource,sub_resource_count,base_offset,layouts,row_count,row_size,total_bytes); +} +static FORCEINLINE HRESULT ID3D12Device_CreateQueryHeap(ID3D12Device* This,const D3D12_QUERY_HEAP_DESC *desc,REFIID riid,void **heap) { + return This->lpVtbl->CreateQueryHeap(This,desc,riid,heap); +} +static FORCEINLINE HRESULT ID3D12Device_SetStablePowerState(ID3D12Device* This,BOOL enable) { + return This->lpVtbl->SetStablePowerState(This,enable); +} +static FORCEINLINE HRESULT ID3D12Device_CreateCommandSignature(ID3D12Device* This,const D3D12_COMMAND_SIGNATURE_DESC *desc,ID3D12RootSignature *root_signature,REFIID riid,void **command_signature) { + return This->lpVtbl->CreateCommandSignature(This,desc,root_signature,riid,command_signature); +} +static FORCEINLINE void ID3D12Device_GetResourceTiling(ID3D12Device* This,ID3D12Resource *resource,UINT *total_tile_count,D3D12_PACKED_MIP_INFO *packed_mip_info,D3D12_TILE_SHAPE *standard_tile_shape,UINT *sub_resource_tiling_count,UINT first_sub_resource_tiling,D3D12_SUBRESOURCE_TILING *sub_resource_tilings) { + This->lpVtbl->GetResourceTiling(This,resource,total_tile_count,packed_mip_info,standard_tile_shape,sub_resource_tiling_count,first_sub_resource_tiling,sub_resource_tilings); +} +static FORCEINLINE LUID ID3D12Device_GetAdapterLuid(ID3D12Device* This) { + LUID __ret; + return *This->lpVtbl->GetAdapterLuid(This,&__ret); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12Device_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12Debug interface + */ +#ifndef __ID3D12Debug_INTERFACE_DEFINED__ +#define __ID3D12Debug_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12Debug, 0x344488b7, 0x6846, 0x474b, 0xb9,0x89, 0xf0,0x27,0x44,0x82,0x45,0xe0); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("344488b7-6846-474b-b989-f027448245e0") +ID3D12Debug : public IUnknown +{ + virtual void STDMETHODCALLTYPE EnableDebugLayer( + ) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12Debug, 0x344488b7, 0x6846, 0x474b, 0xb9,0x89, 0xf0,0x27,0x44,0x82,0x45,0xe0) +#endif +#else +typedef struct ID3D12DebugVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12Debug *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12Debug *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12Debug *This); + + /*** ID3D12Debug methods ***/ + void (STDMETHODCALLTYPE *EnableDebugLayer)( + ID3D12Debug *This); + + END_INTERFACE +} ID3D12DebugVtbl; + +interface ID3D12Debug { + CONST_VTBL ID3D12DebugVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12Debug_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12Debug_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12Debug_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12Debug methods ***/ +#define ID3D12Debug_EnableDebugLayer(This) (This)->lpVtbl->EnableDebugLayer(This) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12Debug_QueryInterface(ID3D12Debug* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12Debug_AddRef(ID3D12Debug* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12Debug_Release(ID3D12Debug* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12Debug methods ***/ +static FORCEINLINE void ID3D12Debug_EnableDebugLayer(ID3D12Debug* This) { + This->lpVtbl->EnableDebugLayer(This); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12Debug_INTERFACE_DEFINED__ */ + +/***************************************************************************** + * ID3D12RootSignatureDeserializer interface + */ +#ifndef __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ +#define __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_ID3D12RootSignatureDeserializer, 0x34ab647b, 0x3cc8, 0x46ac, 0x84,0x1b, 0xc0,0x96,0x56,0x45,0xc0,0x46); +#if defined(__cplusplus) && !defined(CINTERFACE) +MIDL_INTERFACE("34ab647b-3cc8-46ac-841b-c0965645c046") +ID3D12RootSignatureDeserializer : public IUnknown +{ + virtual const D3D12_ROOT_SIGNATURE_DESC * STDMETHODCALLTYPE GetRootSignatureDesc( + ) = 0; + +}; +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(ID3D12RootSignatureDeserializer, 0x34ab647b, 0x3cc8, 0x46ac, 0x84,0x1b, 0xc0,0x96,0x56,0x45,0xc0,0x46) +#endif +#else +typedef struct ID3D12RootSignatureDeserializerVtbl { + BEGIN_INTERFACE + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + ID3D12RootSignatureDeserializer *This, + REFIID riid, + void **ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + ID3D12RootSignatureDeserializer *This); + + ULONG (STDMETHODCALLTYPE *Release)( + ID3D12RootSignatureDeserializer *This); + + /*** ID3D12RootSignatureDeserializer methods ***/ + const D3D12_ROOT_SIGNATURE_DESC * (STDMETHODCALLTYPE *GetRootSignatureDesc)( + ID3D12RootSignatureDeserializer *This); + + END_INTERFACE +} ID3D12RootSignatureDeserializerVtbl; + +interface ID3D12RootSignatureDeserializer { + CONST_VTBL ID3D12RootSignatureDeserializerVtbl* lpVtbl; +}; + +#ifdef COBJMACROS +#ifndef WIDL_C_INLINE_WRAPPERS +/*** IUnknown methods ***/ +#define ID3D12RootSignatureDeserializer_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) +#define ID3D12RootSignatureDeserializer_AddRef(This) (This)->lpVtbl->AddRef(This) +#define ID3D12RootSignatureDeserializer_Release(This) (This)->lpVtbl->Release(This) +/*** ID3D12RootSignatureDeserializer methods ***/ +#define ID3D12RootSignatureDeserializer_GetRootSignatureDesc(This) (This)->lpVtbl->GetRootSignatureDesc(This) +#else +/*** IUnknown methods ***/ +static FORCEINLINE HRESULT ID3D12RootSignatureDeserializer_QueryInterface(ID3D12RootSignatureDeserializer* This,REFIID riid,void **ppvObject) { + return This->lpVtbl->QueryInterface(This,riid,ppvObject); +} +static FORCEINLINE ULONG ID3D12RootSignatureDeserializer_AddRef(ID3D12RootSignatureDeserializer* This) { + return This->lpVtbl->AddRef(This); +} +static FORCEINLINE ULONG ID3D12RootSignatureDeserializer_Release(ID3D12RootSignatureDeserializer* This) { + return This->lpVtbl->Release(This); +} +/*** ID3D12RootSignatureDeserializer methods ***/ +static FORCEINLINE const D3D12_ROOT_SIGNATURE_DESC * ID3D12RootSignatureDeserializer_GetRootSignatureDesc(ID3D12RootSignatureDeserializer* This) { + return This->lpVtbl->GetRootSignatureDesc(This); +} +#endif +#endif + +#endif + + +#endif /* __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ */ + +HRESULT __stdcall D3D12CreateRootSignatureDeserializer(const void *data,SIZE_T data_size,REFIID iid,void **deserializer); + +HRESULT __stdcall D3D12SerializeRootSignature(const D3D12_ROOT_SIGNATURE_DESC *root_signature_desc,D3D_ROOT_SIGNATURE_VERSION version,ID3DBlob **blob,ID3DBlob **error_blob); + +HRESULT __stdcall D3D12SerializeVersionedRootSignature(const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *root_signature_desc,ID3DBlob **blob,ID3DBlob **error_blob); + +typedef HRESULT (__stdcall *PFN_D3D12_CREATE_DEVICE)(IUnknown *adapter,D3D_FEATURE_LEVEL minimum_feature_level,REFIID iid,void **device); +HRESULT __stdcall D3D12CreateDevice(IUnknown *adapter,D3D_FEATURE_LEVEL minimum_feature_level,REFIID iid,void **device); + +typedef HRESULT (__stdcall *PFN_D3D12_GET_DEBUG_INTERFACE)(REFIID iid,void **debug); +HRESULT __stdcall D3D12GetDebugInterface(REFIID iid,void **debug); + +HRESULT __stdcall D3D12EnableExperimentalFeatures(UINT feature_count,const IID *iids,void *configurations,UINT *configurations_sizes); + +/* Begin additional prototypes for all interfaces */ + + +/* End additional prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __d3d12_h__ */ diff --git a/lib/amd_ags.lib b/lib/amd_ags.lib new file mode 100644 index 00000000..7d098edd Binary files /dev/null and b/lib/amd_ags.lib differ diff --git a/lib/d3dcompiler_43.lib b/lib/d3dcompiler_43.lib new file mode 100644 index 00000000..201bab8a Binary files /dev/null and b/lib/d3dcompiler_43.lib differ diff --git a/lib32/amd_ags.lib b/lib32/amd_ags.lib new file mode 100644 index 00000000..6796ea1b Binary files /dev/null and b/lib32/amd_ags.lib differ diff --git a/lib32/d3dcompiler_43.lib b/lib32/d3dcompiler_43.lib new file mode 100644 index 00000000..d5578505 Binary files /dev/null and b/lib32/d3dcompiler_43.lib differ diff --git a/meson.build b/meson.build index 134ca862..9c586f42 100644 --- a/meson.build +++ b/meson.build @@ -225,19 +225,31 @@ else cpp_nvml_args = [] endif +if (target_machine.cpu_family() == 'x86_64') + mango_library_path = meson.source_root() + '/lib' +else + mango_library_path = meson.source_root() + '/lib32' +endif + if ['windows', 'mingw'].contains(host_machine.system()) subdir('modules/minhook') - lib_dxgi = cc.find_library('dxgi') - lib_d3d11 = cc.find_library('d3d11') - lib_d3d12 = cc.find_library('d3d12') - lib_d3dcompiler = cc.find_library('d3dcompiler') - lib_xinput = cc.find_library('xinput') + lib_dxgi = cc.find_library('dxgi') + lib_d3d11 = cc.find_library('d3d11') + lib_d3d12 = cc.find_library('d3d12') + lib_d3dcompiler = cc.find_library('d3dcompiler') + lib_d3dcompiler_43 = cc.find_library('d3dcompiler_43', dirs : mango_library_path) + lib_xinput = cc.find_library('xinput') + lib_ags = cc.find_library('amd_ags', dirs : mango_library_path) + lib_d3dcompiler_47 = cc.find_library('d3dcompiler_47') windows_deps = [ minhook_dep, lib_dxgi, lib_d3d11, lib_d3d12, + lib_ags, lib_d3dcompiler, + lib_d3dcompiler_43, + lib_d3dcompiler_47, lib_xinput, ] else diff --git a/src/ags.cpp b/src/ags.cpp new file mode 100644 index 00000000..ac27d96a --- /dev/null +++ b/src/ags.cpp @@ -0,0 +1,231 @@ +// +// Copyright (c) 2019 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. +// + +//----------------------------------------------------------------------------- +// File: AGSSample.cpp +//----------------------------------------------------------------------------- + +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include +#include +#include + + + +const char* getVendorName( int vendorId ) +{ + switch ( vendorId ) + { + case 0x1002: return "AMD"; + case 0x8086: return "INTEL"; + case 0x10DE: return "NVIDIA"; + default: return "unknown"; + } +} + + +void PrintDisplayInfo( const AGSGPUInfo& gpuInfo ) +{ + for ( int gpuIndex = 0; gpuIndex < gpuInfo.numDevices; gpuIndex++ ) + { + const AGSDeviceInfo& device = gpuInfo.devices[ gpuIndex ]; + + printf( "\n---------- Device %d%s, %s\n", gpuIndex, device.isPrimaryDevice ? " [primary]" : "", device.adapterString ); + + printf( "Vendor id: 0x%04X (%s)\n", device.vendorId, getVendorName( device.vendorId ) ); + printf( "Device id: 0x%04X\n", device.deviceId ); + printf( "Revision id: 0x%04X\n\n", device.revisionId ); + + const char* asicFamily[] = + { + "unknown", + "Pre GCN", + "GCN Gen1", + "GCN Gen2", + "GCN Gen3", + "GCN Gen4", + "Vega", + "RDNA" + }; + + if ( device.vendorId == 0x1002 ) + { + char wgpInfo[ 256 ] = {}; + if ( device.asicFamily >= AGSDeviceInfo::AsicFamily_RDNA ) + { + sprintf_s( wgpInfo, ", %d WGPs", device.numWGPs ); + } + + printf( "Architecture: %s, %d CUs%s, %d ROPs\n", asicFamily[ device.asicFamily ], device.numCUs, wgpInfo, device.numROPs ); + printf( " core clock %d MHz, memory clock %d MHz\n", device.coreClock, device.memoryClock ); + printf( " %.1f Tflops\n", device.teraFlops ); + printf( "local memory: %d MBs (%.1f GB/s)\n\n", (int)( device.localMemoryInBytes / ( 1024 * 1024 ) ), (float)device.memoryBandwidth / 1024.0f ); + } + + printf( "\n" ); + + if ( device.eyefinityEnabled ) + { + printf( "SLS grid is %d displays wide by %d displays tall\n", device.eyefinityGridWidth, device.eyefinityGridHeight ); + printf( "SLS resolution is %d x %d pixels%s\n", device.eyefinityResolutionX, device.eyefinityResolutionY, device.eyefinityBezelCompensated ? ", bezel-compensated" : "" ); + } + else + { + printf( "Eyefinity not enabled on this device\n" ); + } + + printf( "\n" ); + + for ( int i = 0; i < device.numDisplays; i++ ) + { + const AGSDisplayInfo& display = device.displays[ i ]; + + printf( "\t---------- Display %d %s----------------------------------------\n", i, display.displayFlags & AGS_DISPLAYFLAG_PRIMARY_DISPLAY ? "[primary]" : "---------" ); + + printf( "\tdevice name: %s\n", display.displayDeviceName ); + printf( "\tmonitor name: %s\n\n", display.name ); + + printf( "\tMax resolution: %d x %d, %.1f Hz\n", display.maxResolutionX, display.maxResolutionY, display.maxRefreshRate ); + printf( "\tCurrent resolution: %d x %d, Offset (%d, %d), %.1f Hz\n", display.currentResolution.width, display.currentResolution.height, display.currentResolution.offsetX, display.currentResolution.offsetY, display.currentRefreshRate ); + printf( "\tVisible resolution: %d x %d, Offset (%d, %d)\n\n", display.visibleResolution.width, display.visibleResolution.height, display.visibleResolution.offsetX, display.visibleResolution.offsetY ); + + printf( "\tchromaticity red: %f, %f\n", display.chromaticityRedX, display.chromaticityRedY ); + printf( "\tchromaticity green: %f, %f\n", display.chromaticityGreenX, display.chromaticityGreenY ); + printf( "\tchromaticity blue: %f, %f\n", display.chromaticityBlueX, display.chromaticityBlueY ); + printf( "\tchromaticity white point: %f, %f\n\n", display.chromaticityWhitePointX, display.chromaticityWhitePointY ); + + printf( "\tluminance: [min, max, avg] %f, %f, %f\n", display.minLuminance, display.maxLuminance, display.avgLuminance ); + + printf( "\tscreen reflectance diffuse %f\n", display.screenDiffuseReflectance ); + printf( "\tscreen reflectance specular %f\n\n", display.screenSpecularReflectance ); + + if ( display.displayFlags & AGS_DISPLAYFLAG_HDR10 ) + printf( "\tHDR10 supported\n" ); + + if ( display.displayFlags & AGS_DISPLAYFLAG_DOLBYVISION ) + printf( "\tDolby Vision supported\n" ); + + if ( display.displayFlags & AGS_DISPLAYFLAG_FREESYNC ) + printf( "\tFreesync supported\n" ); + + if ( display.displayFlags & AGS_DISPLAYFLAG_FREESYNC_HDR ) + printf( "\tFreesync HDR supported\n" ); + + printf( "\n" ); + + if ( display.displayFlags & AGS_DISPLAYFLAG_EYEFINITY_IN_GROUP ) + { + printf( "\tEyefinity Display [%s mode] %s\n", display.displayFlags & AGS_DISPLAYFLAG_EYEFINITY_IN_PORTRAIT_MODE ? "portrait" : "landscape", display.displayFlags & AGS_DISPLAYFLAG_EYEFINITY_PREFERRED_DISPLAY ? " (preferred display)" : "" ); + + printf( "\tGrid coord [%d, %d]\n", display.eyefinityGridCoordX, display.eyefinityGridCoordY ); + } + + printf( "\tlogical display index: %d\n", display.logicalDisplayIndex ); + printf( "\tADL adapter index: %d\n\n", display.adlAdapterIndex ); + + printf( "\n" ); + } + } +} + + +void testDriver( const char* driver, unsigned int driverToCompareAgainst ) +{ + AGSDriverVersionResult result = agsCheckDriverVersion( driver, driverToCompareAgainst ); + + // int major = (driverToCompareAgainst & 0xFFC00000) >> 22; + // int minor = (driverToCompareAgainst & 0x003FF000) >> 12; + // int patch = (driverToCompareAgainst & 0x00000FFF); + + // if ( result == AGS_SOFTWAREVERSIONCHECK_UNDEFINED ) + // { + // printf( "Driver check could not determine the driver version for %s\n", driver ); + // } + // else + // { + // printf( "Driver check shows the installed %s driver is %s the %d.%d.%d required version\n", driver, result == AGS_SOFTWAREVERSIONCHECK_OK ? "newer or the same as" : "older than", major, minor, patch ); + // } +} + +int main(int , char**) +{ + // Enable run-time memory check for debug builds. + // (When _DEBUG is not defined, calls to _CrtSetDbgFlag are removed during preprocessing.) + _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); + + AGSContext* agsContext = nullptr; + + int displayIndex = 0; + DISPLAY_DEVICEA displayDevice; + displayDevice.cb = sizeof( displayDevice ); + while ( EnumDisplayDevicesA( 0, displayIndex, &displayDevice, 0 ) ) + { + printf( "Display Device: %d: %s, %s %s%s\n", displayIndex, displayDevice.DeviceString, displayDevice.DeviceName, displayDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE ? "(primary)" : "", displayDevice.StateFlags & DISPLAY_DEVICE_ACTIVE ? "" : " [disabled]" ); + displayIndex++; + } + + // { + // printf( "\n" ); + // testDriver( "18.8.randombetadriver", AGS_MAKE_VERSION( 18, 8, 2 ) ); + // testDriver( "18.8.123randomdriver", AGS_MAKE_VERSION( 18, 8, 2 ) ); + // testDriver( "18.9.randomdriver", AGS_MAKE_VERSION( 18, 8, 2 ) ); + // testDriver( "18.8.2", AGS_MAKE_VERSION( 18, 8, 2 ) ); + // testDriver( "18.8.2", AGS_MAKE_VERSION( 18, 8, 1 ) ); + // testDriver( "18.8.2", AGS_MAKE_VERSION( 18, 8, 3 ) ); + // printf( "\n" ); + // } + + AGSGPUInfo gpuInfo; + + AGSConfiguration config = {}; + if ( agsInit( &agsContext, &config, &gpuInfo ) == AGS_SUCCESS ) + { + printf( "\nAGS Library initialized: v%d.%d.%d\n", gpuInfo.agsVersionMajor, gpuInfo.agsVersionMinor, gpuInfo.agsVersionPatch ); + printf( "Is%s WACK compliant for use in UWP apps\n", gpuInfo.isWACKCompliant ? "" : " *not*" ); + printf( "-----------------------------------------------------------------\n" ); + + printf( "Radeon Software Version: %s\n", gpuInfo.radeonSoftwareVersion ); + printf( "Driver Version: %s\n", gpuInfo.driverVersion ); + printf( "-----------------------------------------------------------------\n" ); + PrintDisplayInfo( gpuInfo ); + printf( "-----------------------------------------------------------------\n" ); + + if ( agsDeInit( agsContext ) != AGS_SUCCESS ) + { + printf( "Failed to cleanup AGS Library\n" ); + } + } + else + { + printf( "Failed to initialize AGS Library\n" ); + } + + printf( "\ndone\n" ); + + _getch(); + + return 0; +} + diff --git a/src/ags.h b/src/ags.h new file mode 100644 index 00000000..331245a0 --- /dev/null +++ b/src/ags.h @@ -0,0 +1 @@ +int query_ags(void); \ No newline at end of file diff --git a/src/meson.build b/src/meson.build index 5b840ab7..0447d26d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -49,6 +49,7 @@ if ['windows', 'mingw'].contains(host_machine.system()) 'loaders/loader_nvml_win32.cpp', 'cpu_win32.cpp', 'nvapi.cpp', + 'ags.cpp', # 'MangoHud.def', ) endif